From fcb820ca825e0763e76405aa38143ff009691e5c Mon Sep 17 00:00:00 2001 From: Chris Rasys Date: Sat, 1 Jul 2023 15:55:12 +0000 Subject: [PATCH] Break out Site Updates into own page and datafile --- hugo/config/_default/hugo.toml | 12 +++++ hugo/content/sidebar/site-updates.md | 31 +----------- hugo/content/site_updates.md | 8 +++ hugo/data/site_updates.toml | 49 +++++++++++++++++++ .../layouts/shortcodes/date_listing.html | 12 +++++ 5 files changed, 82 insertions(+), 30 deletions(-) create mode 100644 hugo/content/site_updates.md create mode 100644 hugo/data/site_updates.toml create mode 100644 hugo/themes/cmrasys/layouts/shortcodes/date_listing.html diff --git a/hugo/config/_default/hugo.toml b/hugo/config/_default/hugo.toml index 5cc9b89..470db88 100644 --- a/hugo/config/_default/hugo.toml +++ b/hugo/config/_default/hugo.toml @@ -91,3 +91,15 @@ canonifyURLs = true name = "About" url = "/about/" weight = 4 + [[menu.main]] + parent = 'about' + name = "About Me" + identifier = 'about_me' + url = "/about/" + weight = 1 + [[menu.main]] + parent = 'about' + name = "Site Updates" + identifier = 'updates' + url = "/site_updates/" + weight = 2 diff --git a/hugo/content/sidebar/site-updates.md b/hugo/content/sidebar/site-updates.md index a3bfed5..f31b154 100644 --- a/hugo/content/sidebar/site-updates.md +++ b/hugo/content/sidebar/site-updates.md @@ -5,33 +5,4 @@ type: sidebar weight: 3 --- -June 29, 2023 - -- Minor update to Taxonomy page layout - -June 25, 2023 - -- Generate multiple image sizes for mobile - -June 17, 2023 - -- Add Disqus commenting -- Create [staging site](http://staging.cmrasys.com/) - -June 16, 2023 - -- Compress CSS assets -- Add section headers -- Add current page in paginator to breadcrumb - -June 15, 2023 - -- Add 'Site Updates' to Sidebar -- Add breadcrumb navigation -- Qualify display of dates on posts -- Add commit info to posts -- Fix taxonomy listings - -June 14, 2023 - -- Taxonomy pages now show posts within each section +{{< date_listing "site_updates" "updates" 4 >}} diff --git a/hugo/content/site_updates.md b/hugo/content/site_updates.md new file mode 100644 index 0000000..b90f003 --- /dev/null +++ b/hugo/content/site_updates.md @@ -0,0 +1,8 @@ +--- +title: Site Updates +type: page +layout: basic +displayClass: article +--- + +{{< date_listing "site_updates" "updates" >}} diff --git a/hugo/data/site_updates.toml b/hugo/data/site_updates.toml new file mode 100644 index 0000000..674c219 --- /dev/null +++ b/hugo/data/site_updates.toml @@ -0,0 +1,49 @@ +[[updates]] + date = 1686758400 + entries = [ + "Taxonomy pages now show posts within each section" + ] + +[[updates]] + date = 1686844800 + entries = [ + "Add 'Site Updates' to Sidebar", + "Add breadcrumb navigation", + "Qualify display of dates on posts", + "Add commit info to posts", + "Fix taxonomy listings" + ] + +[[updates]] + date = 1686931200 + entries = [ + "Compress CSS assets", + "Add section headers", + "Add current page in paginator to breadcrumb" + ] + +[[updates]] + date = 1687017600 + entries = [ + "Add Disqus commenting", + "Create [staging site](http://staging.cmrasys.com/)" + ] + +[[updates]] + date = 1687708800 + entries = [ + "Generate multiple image sizes for mobile" + ] + +[[updates]] + date = 1688054400 + entries = [ + "Minor update to Taxonomy page layout" + ] + +[[updates]] + date = 1688227200 + entries = [ + "Added separate [Site Updates](/site_updates/) page", + "Broke out Site Update information into data file for portability" + ] \ No newline at end of file diff --git a/hugo/themes/cmrasys/layouts/shortcodes/date_listing.html b/hugo/themes/cmrasys/layouts/shortcodes/date_listing.html new file mode 100644 index 0000000..d6cd879 --- /dev/null +++ b/hugo/themes/cmrasys/layouts/shortcodes/date_listing.html @@ -0,0 +1,12 @@ +{{ $lookup := index (index .Site.Data (.Get 0)) (.Get 1) }} +{{ $format := "January 2, 2006" }} +{{ $count := (.Get 2) | default ($lookup | len)}} + +{{ range first $count (sort $lookup ".date" "desc") }} +

{{ .date | int | dateFormat $format }}

+ +{{ end }} \ No newline at end of file