Skip to content

Commit

Permalink
fix: match all previous URLs but drop notes- prefix (retain redirect)
Browse files Browse the repository at this point in the history
  • Loading branch information
awendland committed Jan 21, 2024
1 parent 9f80629 commit 18482ac
Show file tree
Hide file tree
Showing 14 changed files with 96 additions and 28 deletions.
4 changes: 4 additions & 0 deletions content/blurbs/2011-09-01-middle-school.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
date: '2011-09-01'
heading: Middle School
visibility: public
# `render: link` to include this page in .Site.RegularPages but not write it to disk, `sitemap_exclude: true` to filter it out in layouts/_default/sitemap.xml
sitemap_exclude: true
_build:
render: link
---
4 changes: 4 additions & 0 deletions content/blurbs/2015-08-01-high-school.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
date: '2015-08-01'
heading: 'High School'
visibility: public
# `render: link` to include this page in .Site.RegularPages but not write it to disk, `sitemap_exclude: true` to filter it out in layouts/_default/sitemap.xml
sitemap_exclude: true
_build:
render: link
---
4 changes: 4 additions & 0 deletions content/blurbs/2016-05-16-college-kickoff.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
date: '2016-05-16'
heading: 'College Kickoff'
visibility: public
# `render: link` to include this page in .Site.RegularPages but not write it to disk, `sitemap_exclude: true` to filter it out in layouts/_default/sitemap.xml
sitemap_exclude: true
_build:
render: link
---

Woohoo! Fun college things! One of those fun college things was
Expand Down
4 changes: 4 additions & 0 deletions content/blurbs/2018-06-01-startup-hiatus.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
date: '2018-06-01'
heading: '3 Year Startup Hiatus'
visibility: public
# `render: link` to include this page in .Site.RegularPages but not write it to disk, `sitemap_exclude: true` to filter it out in layouts/_default/sitemap.xml
sitemap_exclude: true
_build:
render: link
---

Co-founder and CTO at <a href="https://luminopia.com">Luminopia</a>, where we were working to cure lazy
Expand Down
4 changes: 4 additions & 0 deletions content/blurbs/2020-05-20-college-return.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
date: '2020-05-20'
heading: 'Back to College'
visibility: public
# `render: link` to include this page in .Site.RegularPages but not write it to disk, `sitemap_exclude: true` to filter it out in layouts/_default/sitemap.xml
sitemap_exclude: true
_build:
render: link
---
4 changes: 4 additions & 0 deletions content/blurbs/2021-03-01-new-grad.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
date: '2021-03-01'
heading: 'Newly Graduated'
visibility: public
# `render: link` to include this page in .Site.RegularPages but not write it to disk, `sitemap_exclude: true` to filter it out in layouts/_default/sitemap.xml
sitemap_exclude: true
_build:
render: link
---
4 changes: 4 additions & 0 deletions content/blurbs/2023-12-31-nyc.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
date: '2023-12-31'
heading: 'Living in NYC'
visibility: public
# `render: link` to include this page in .Site.RegularPages but not write it to disk, `sitemap_exclude: true` to filter it out in layouts/_default/sitemap.xml
sitemap_exclude: true
_build:
render: link
---
2 changes: 2 additions & 0 deletions content/notes/big-trees/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Big Trees 🌳
order: 2
lastmod: 2021-04-21T01:20:25.854Z
visibility: public
aliases:
- /notes-big-trees/
---

Other great big tree websites: [Gathering Growth Foundation](https://www.google.com/url?q=https://www.gatheringgrowth.org/champion-trees&sa=D&source=editors&ust=1705382884188700&usg=AOvVaw37iqn%5FinYwTvMJD9ywiQ-T)
Expand Down
2 changes: 2 additions & 0 deletions content/notes/dev-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ title: Developer Resources 💻
order: 4
lastmod: 2021-03-09T23:46:58.857Z
visibility: public
aliases:
- /notes-dev-resources/
---

<!-- markdownlint-disable MD034 -->
Expand Down
2 changes: 2 additions & 0 deletions content/notes/healthcare.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Healthcare 🩺
order: 1
lastmod: 2023-03-16T01:51:52.641Z
visibility: public
aliases:
- /notes-healthcare/
---

## Resources
Expand Down
8 changes: 7 additions & 1 deletion hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ title: Alex W.'s Blog

permalinks:
posts: "/:filename/"
notes: "/note-:filename/"
collected-notes: "/:filename/"
notes: "/:filename/"

disableKinds:
- "taxonomy"
- "term"
- "section"

outputFormats:
RSS:
Expand Down
24 changes: 24 additions & 0 deletions layouts/_default/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
{{ range where .Data.Pages "Params.sitemap_exclude" "ne" true }}
{{- if .Permalink -}}
<url>
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
<xhtml:link
rel="alternate"
hreflang="{{ .Language.LanguageCode }}"
href="{{ .Permalink }}"
/>{{ end }}
<xhtml:link
rel="alternate"
hreflang="{{ .Language.LanguageCode }}"
href="{{ .Permalink }}"
/>{{ end }}
</url>
{{- end -}}
{{ end }}
</urlset>
56 changes: 30 additions & 26 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,31 +55,35 @@
><span style="display: inline-block">{{ .Title }}</span></a
>{{ if ne (add $i 1) (len $notes) }}, {{end}}{{ end }}.
</p>
{{ $t := slice "blurbs" }} {{ $t = $t | append .Site.Params.mainSections }} {{
range (where .Site.RegularPages "Type" "in" $t) }} {{ if eq .Type "blurbs" }}
<h3>{{ .Params.heading }}</h3>
{{ if .Content }}
<p>{{ .Content }}</p>
{{ end }} {{ else }}
<div class="timelineLinkEntry">
<time
class="timelineLinkEntry_time"
datetime="{{ .Date.Format .Site.Params.dateFormat.iso }}"
title="{{ .Date.Format .Site.Params.dateFormat.iso }}"
>
{{ .Date.Format .Site.Params.dateFormat.humanDateShort }}
</time>
<span
style="
width: 2em;
flex-shrink: 0;
display: inline-block;
font-size: small;
"
>{{ .Params.emoji }}</span
>
<a class="timelineLinkEntry_title" href="{{ .RelPermalink }}">{{ .Title }}</a>
</div>
{{ end }} {{ end }}
{{ $t := slice "blurbs" }}
{{ $t = $t | append .Site.Params.mainSections }}
{{ range (where .Site.RegularPages "Type" "in" $t) }}
{{ if eq .Type "blurbs" }}
<h3>{{ .Params.heading }}</h3>
{{ if .Content }}
<p>{{ .Content }}</p>
{{ end }}
{{ else }}
<div class="timelineLinkEntry">
<time
class="timelineLinkEntry_time"
datetime="{{ .Date.Format .Site.Params.dateFormat.iso }}"
title="{{ .Date.Format .Site.Params.dateFormat.iso }}"
>
{{ .Date.Format .Site.Params.dateFormat.humanDateShort }}
</time>
<span
style="
width: 2em;
flex-shrink: 0;
display: inline-block;
font-size: small;
"
>{{ .Params.emoji }}</span
>
<a class="timelineLinkEntry_title" href="{{ .RelPermalink }}">{{ .Title }}</a>
</div>
{{ end }}
{{ end }}
</main>
{{ end }}
2 changes: 1 addition & 1 deletion scripts/hygiene-sitemap-to-url-list.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
import { readFileSync } from "fs";

const sitemapPath = process.argv[3] || "public/sitemap.xml";
const sitemapPath = process.argv[2] || "public/sitemap.xml";

const urls = readFileSync(sitemapPath, "utf8")
.split("\n")
Expand Down

0 comments on commit 18482ac

Please sign in to comment.