From a39faf0214c5056f406fbaf08b948f06b2ea459b Mon Sep 17 00:00:00 2001 From: "James R. Cogley" Date: Fri, 22 Nov 2024 22:26:06 +0900 Subject: [PATCH] finalize text and add update dates --- README.md | 2 +- deno.lock | 12 ++++++++++++ plugins.ts | 15 ++++++++++++++- src/_includes/layouts/base.vto | 4 +++- src/index.md | 5 +++-- src/repo-readme.vto | 4 +++- 6 files changed, 36 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e0cb4ce..c3c8169 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,6 @@ I have spent my career in IT in Japan, doing a wide range of activities, such as | Item | Value | | --- | --- | | Total Files | 5 | -| Repo Size in MB | 4473 | +| Repo Size in MB | 4666 | diff --git a/deno.lock b/deno.lock index 07f490c..b0403f0 100644 --- a/deno.lock +++ b/deno.lock @@ -32,6 +32,7 @@ "npm:@js-temporal/polyfill@0.4.4": "0.4.4", "npm:autoprefixer@10.4.20": "10.4.20_postcss@8.4.47", "npm:estree-walker@3.0.3": "3.0.3", + "npm:highlight.js@11.10.0": "11.10.0", "npm:ico-endec@0.1.6": "0.1.6", "npm:markdown-it-attrs@4.2.0": "4.2.0_markdown-it@14.1.0", "npm:markdown-it-deflist@3.0.0": "3.0.0", @@ -39,6 +40,7 @@ "npm:meriyah@6.0.3": "6.0.3", "npm:postcss-import@16.1.0": "16.1.0_postcss@8.4.47", "npm:postcss@8.4.47": "8.4.47", + "npm:prismjs@1.29.0": "1.29.0", "npm:sharp@0.33.5": "0.33.5", "npm:simple-icons@12.2.0": "12.2.0", "npm:svg2png-wasm@1.4.1": "1.4.1" @@ -310,6 +312,9 @@ "function-bind" ] }, + "highlight.js@11.10.0": { + "integrity": "sha512-SYVnVFswQER+zu1laSya563s+F8VDGt7o35d4utbamowvUNLLMovFqwCLSocpZTz3MgaSRA1IbqRWZv97dtErQ==" + }, "ico-endec@0.1.6": { "integrity": "sha512-ZdLU38ZoED3g1j3iEyzcQj+wAkY2xfWNkymszfJPoxucIUhK7NayQ+/C4Kv0nDFMIsbtbEHldv3V8PU494/ueQ==" }, @@ -395,6 +400,9 @@ "source-map-js" ] }, + "prismjs@1.29.0": { + "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==" + }, "punycode.js@2.3.1": { "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==" }, @@ -739,6 +747,7 @@ "https://deno.land/x/lume@v2.4.2/deps/front_matter.ts": "279c53db46ac7f557f217ffb7fbd0c307ad6cbd8ff64d91cd8b023a3b50b2c92", "https://deno.land/x/lume@v2.4.2/deps/fs.ts": "bd02b4f76a5579908f28d8af86c3adce1dc5c6024a229e4f3b013a1540856546", "https://deno.land/x/lume@v2.4.2/deps/hex.ts": "345dabf92ede0e4b1aed5b6d831099bcf62ec0f75d45519e42194ee527f7c8b9", + "https://deno.land/x/lume@v2.4.2/deps/highlight.ts": "e9a13912eb5884fce7711457a1529206cbc0a9b6ddc5db4ecabc219af6a9a910", "https://deno.land/x/lume@v2.4.2/deps/http.ts": "acc7512e6835c9f127b6e90b46b1aa8ccab433ccc0d1e38466eacf66c0eaf28b", "https://deno.land/x/lume@v2.4.2/deps/init.ts": "05d45af66ebdfe63e43540618f51ece8f99d98dc49de890f10eeb43abe9ed0f3", "https://deno.land/x/lume@v2.4.2/deps/jsonc.ts": "e359eb0ef9f5f15518e6afe9bafb5b48bd5798dc000c8e210953c29cb319e607", @@ -746,6 +755,7 @@ "https://deno.land/x/lume@v2.4.2/deps/markdown_it.ts": "f68bb28890f77347ac7bc980026ea52e3cf0940278a3930428f5900be9e6491f", "https://deno.land/x/lume@v2.4.2/deps/path.ts": "2cb9b457032c687de61df71a5855a97d7de18386bfe3048c03377c733e96b3ab", "https://deno.land/x/lume@v2.4.2/deps/postcss.ts": "4bd702f1315a05d7793f140bba403c433203197e0dc65b381724aa9f6822c448", + "https://deno.land/x/lume@v2.4.2/deps/prism.ts": "808c1b1131ec63f0ea20914e2035befa00946f84acb5a02e0c8358c193cd085c", "https://deno.land/x/lume@v2.4.2/deps/sharp.ts": "67d02a65eda73fc23cc76220c95a832ccbc842bdb7eab205761da27352c38aae", "https://deno.land/x/lume@v2.4.2/deps/svg2png.ts": "d761fb39c37e5c5ba4ac2db25768cf0c2ff34643d3d1847a9fe736449175d5ec", "https://deno.land/x/lume@v2.4.2/deps/temporal.ts": "1958b134c4186b0ab39316fa33ba19d1a4203e2ea445080429d60d296b91a552", @@ -760,6 +770,7 @@ "https://deno.land/x/lume@v2.4.2/middlewares/reload_client.js": "992ac4a2f4a9fb4a1ab5f23f674ef202a43d73652cdebcf7b1552b482a7410ef", "https://deno.land/x/lume@v2.4.2/mod.ts": "f93dcbc0ccb7a9e6cab93d0e8f1f0643b112f3084bedc603379dc1b47d7d380d", "https://deno.land/x/lume@v2.4.2/plugins/base_path.ts": "ddaffaac8166137244c79cf72b1cd77a074160e52ec59ad49c06cfee4aef7f64", + "https://deno.land/x/lume@v2.4.2/plugins/code_highlight.ts": "723b114f98e97c3a2d65890638109d144e1adbd7f474f73d05dac5f47d0851c8", "https://deno.land/x/lume@v2.4.2/plugins/favicon.ts": "5822264902eb1ab06d9b5c56767ac2997f40c31eba66983b083d02af2d7244e5", "https://deno.land/x/lume@v2.4.2/plugins/json.ts": "67e5e2e00f8e8640f33c1f97a2bf82a7c97a67a838804637b87b16b72f9042e1", "https://deno.land/x/lume@v2.4.2/plugins/markdown.ts": "c7027605edee274762edb20f7040ccba6415c5fe656cc6e25ce91c448f467fd8", @@ -768,6 +779,7 @@ "https://deno.land/x/lume@v2.4.2/plugins/modules.ts": "e64197315d930e462aca24e444d0cfcefb37bfea168b2306122b892a1e1c5b8e", "https://deno.land/x/lume@v2.4.2/plugins/paginate.ts": "7dfee977a205dfe0af33a3e406f73017badd2d4593cf27e5bd897da7ab12ba8a", "https://deno.land/x/lume@v2.4.2/plugins/postcss.ts": "0f3e78e44c7503e8d597ed286c5eab39ad5e212cb7912424b7ad2a072e8d07aa", + "https://deno.land/x/lume@v2.4.2/plugins/prism.ts": "345d4480dc358481f929e152f7311d7c23f6ba2215157c2b74e0f73f5624e090", "https://deno.land/x/lume@v2.4.2/plugins/search.ts": "ff570560c6ca95598a1cbfb3a77611477ee7dbb53300bcc3ba14d18c9e5eba79", "https://deno.land/x/lume@v2.4.2/plugins/source_maps.ts": "6260905d95155c1fd44eb221a8dee096c6c13052899477bd84e8e180d3a740b3", "https://deno.land/x/lume@v2.4.2/plugins/toml.ts": "72c75546056e503a59752e33dc25542f2aa21d743bd47f498d722b97958212f5", diff --git a/plugins.ts b/plugins.ts index fcb96e5..b1277f0 100644 --- a/plugins.ts +++ b/plugins.ts @@ -6,6 +6,8 @@ import favicon from "lume/plugins/favicon.ts"; import metas from "lume/plugins/metas.ts"; import postcss from "lume/plugins/postcss.ts"; import transformImages from "lume/plugins/transform_images.ts"; +import prism from "lume/plugins/prism.ts"; +import { getGitDate } from "lume/core/utils/date.ts"; /** Configure the site */ export default function () { @@ -17,6 +19,7 @@ export default function () { .mergeKey("extra_head", "stringArray") .use(transformImages()) .use(simpleIcons()) + .use(prism()) site.data("textColor", (hex: string) => { const color = new Color(`#${hex}`); @@ -24,7 +27,17 @@ export default function () { const onBlack = Math.abs(color.contrastWCAG21("black")); return (onWhite + 0.5) > onBlack ? "white" : "black"; }); - + + site.preprocess([".html"], (pages) => { + for (const page of pages) { + const src = page.src.entry?.src; + + if (src) { + page.data.lastmod = getGitDate("modified", src); + } + } + }); + site.copy([".jpg", ".webp", ".png"]); }; } \ No newline at end of file diff --git a/src/_includes/layouts/base.vto b/src/_includes/layouts/base.vto index 457c118..e581e9b 100644 --- a/src/_includes/layouts/base.vto +++ b/src/_includes/layouts/base.vto @@ -11,6 +11,7 @@ + {{# #}} @@ -36,7 +37,7 @@ Avatar

{{ header.title }}

- {{ header.description |> md }} + {{ header.description |> md |> toUpperCase() }}
{{ content }} @@ -79,6 +80,7 @@ {{ if footer }} {{ /if }} diff --git a/src/index.md b/src/index.md index 501a83e..9619607 100644 --- a/src/index.md +++ b/src/index.md @@ -1,6 +1,7 @@ --- layout: layouts/base.vto url: / +date: Git Last Modified header: title: Rick Cogley description: Make a dynamic Github profile with Lume SSG! @@ -117,9 +118,9 @@ on: - cron: "6 21 * * *" ``` -## How to use? +## How to get yours? -Go to the repo, "use this template" then tweak it how you like. +Go to my [profile repo](https://github.com/rickcogley/rickcogley), and click "use this template" to make your own copy. If you don't have a profile repo already, save the repo as your username. Then tweak it how you like including updating the RSS feeds. Or, setup Deno and Lume, and copy in the files manually. ## Is it good? diff --git a/src/repo-readme.vto b/src/repo-readme.vto index e354dd9..70bc653 100644 --- a/src/repo-readme.vto +++ b/src/repo-readme.vto @@ -1,8 +1,10 @@ --- url: /repo-readme.md +date: Git Last Modified --- [![PGP Public Key](https://img.shields.io/badge/PGP-Public_Key-orange?style=flat-square&logo=monkey%20tie)](https://cogley.jp/pgp) [![Proven.lol Lightweight Proof](https://img.shields.io/badge/Proven.lol-Lightweight_Proof-green?style=flat-square&logo=cachet)](https://proven.lol/6265e6) -**Today is:** {{ todaysDateENUS }}{{ set today = todaysDateYYYYMMDD }}{{ if holidays[today] }} ({{ holidays[today] }}){{ /if }} +**Today is:** {{ todaysDateENUS }}{{ set today = todaysDateYYYYMMDD }}{{ if holidays[today] }} ({{ holidays[today] }}){{ /if }} +**Last Updated:** {{ date }} ### Hi there 👋