Skip to content

Commit

Permalink
Break out Site Updates into own page and datafile
Browse files Browse the repository at this point in the history
  • Loading branch information
Skrath committed Jul 1, 2023
1 parent b7bac66 commit fcb820c
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 30 deletions.
12 changes: 12 additions & 0 deletions hugo/config/_default/hugo.toml
Expand Up @@ -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
31 changes: 1 addition & 30 deletions hugo/content/sidebar/site-updates.md
Expand Up @@ -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 >}}
8 changes: 8 additions & 0 deletions hugo/content/site_updates.md
@@ -0,0 +1,8 @@
---
title: Site Updates
type: page
layout: basic
displayClass: article
---

{{< date_listing "site_updates" "updates" >}}
49 changes: 49 additions & 0 deletions 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"
]
12 changes: 12 additions & 0 deletions 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") }}
<p>{{ .date | int | dateFormat $format }}</p>
<ul>
{{ range .entries }}
<li>{{ $.Page.RenderString . }}</li>
{{ end }}
</ul>
{{ end }}

0 comments on commit fcb820c

Please sign in to comment.