Change permalink format

This commit is contained in:
Shadowfacts 2020-01-12 15:52:09 -05:00
parent 528825ec96
commit c94aa3f6cf
Signed by untrusted user: shadowfacts
GPG Key ID: 94A5AB95422746E5
24 changed files with 30 additions and 25 deletions

View File

@ -20,7 +20,7 @@ export default async function posts(): Promise<Page[]> {
let postMeta = <PostMetadata>page.metadata; let postMeta = <PostMetadata>page.metadata;
postMeta.date = dateFns.parse(postMeta.date); postMeta.date = dateFns.parse(postMeta.date);
postMeta.slug = postMeta.slug || slugify(postMeta.title); postMeta.slug = postMeta.slug || slugify(postMeta.title);
postMeta.permalink = `/${postMeta.category}/${postMeta.date.getFullYear()}/${postMeta.slug}/`; postMeta.permalink = `/${postMeta.date.getFullYear()}/${postMeta.slug}/`;
} }
page.text = util.render(page.text, { metadata: page.metadata }, postPath); page.text = util.render(page.text, { metadata: page.metadata }, postPath);

24
package-lock.json generated
View File

@ -1357,7 +1357,7 @@
}, },
"load-json-file": { "load-json-file": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
"integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
"requires": { "requires": {
"graceful-fs": "^4.1.2", "graceful-fs": "^4.1.2",
@ -1494,7 +1494,7 @@
}, },
"meow": { "meow": {
"version": "3.7.0", "version": "3.7.0",
"resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", "resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
"integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=",
"requires": { "requires": {
"camelcase-keys": "^2.0.0", "camelcase-keys": "^2.0.0",
@ -1547,7 +1547,7 @@
}, },
"minimist": { "minimist": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
}, },
"mkdirp": { "mkdirp": {
@ -1638,7 +1638,7 @@
"dependencies": { "dependencies": {
"semver": { "semver": {
"version": "5.3.0", "version": "5.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", "resolved": "http://registry.npmjs.org/semver/-/semver-5.3.0.tgz",
"integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=" "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8="
} }
} }
@ -1743,12 +1743,12 @@
}, },
"os-homedir": { "os-homedir": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M="
}, },
"os-locale": { "os-locale": {
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", "resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
"integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
"requires": { "requires": {
"lcid": "^1.0.0" "lcid": "^1.0.0"
@ -1756,7 +1756,7 @@
}, },
"os-tmpdir": { "os-tmpdir": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
}, },
"osenv": { "osenv": {
@ -1933,7 +1933,7 @@
}, },
"pify": { "pify": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
}, },
"pinkie": { "pinkie": {
@ -2105,7 +2105,7 @@
}, },
"readable-stream": { "readable-stream": {
"version": "2.3.6", "version": "2.3.6",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"requires": { "requires": {
"core-util-is": "~1.0.0", "core-util-is": "~1.0.0",
@ -2353,7 +2353,7 @@
}, },
"source-map": { "source-map": {
"version": "0.4.4", "version": "0.4.4",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", "resolved": "http://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
"integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=",
"requires": { "requires": {
"amdefine": ">=0.0.4" "amdefine": ">=0.0.4"
@ -2458,7 +2458,7 @@
}, },
"string-width": { "string-width": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "resolved": "http://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
@ -2873,7 +2873,7 @@
}, },
"wrap-ansi": { "wrap-ansi": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
"integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
"requires": { "requires": {
"string-width": "^1.0.1", "string-width": "^1.0.1",

View File

@ -17,7 +17,7 @@ metadata.layout = "default.html.ejs"
</summary> </summary>
<p id="comments-info"> <p id="comments-info">
Comments powered by ActivityPub. To respond to this post or to another comment, copy its URL into the search interface of your client for Mastodon, Pleroma, or other compatible software. Comments powered by ActivityPub. To respond to this post or to another comment, copy its URL into the search interface of your client for Mastodon, Pleroma, or other compatible software.
<a href="/meta/2019/reincarnation/#activity-pub">Learn more</a>. <a href="/2019/reincarnation/#activity-pub">Learn more</a>.
</p> </p>
<noscript> <noscript>
<p id="comments-js-warning"> <p id="comments-js-warning">

View File

@ -2,7 +2,7 @@
metadata.title = "Hello, World!" metadata.title = "Hello, World!"
metadata.category = "meta" metadata.category = "meta"
metadata.date = "2016-05-06 11:13:18 -0400" metadata.date = "2016-05-06 11:13:18 -0400"
metadata.oldPermalink = "/meta/2016/06/07/hello-world/" metadata.oldPermalink = ["/meta/2016/06/07/hello-world/", "/meta/2016/hello-world/"]
metadata.shortDesc = "Hello again, world! Welcome to the third iteration of my website." metadata.shortDesc = "Hello again, world! Welcome to the third iteration of my website."
``` ```

View File

@ -2,7 +2,7 @@
metadata.title = "1.9.4 Porting Spree" metadata.title = "1.9.4 Porting Spree"
metadata.category = "minecraft" metadata.category = "minecraft"
metadata.date = "2016-05-21 17:47:18 -0400" metadata.date = "2016-05-21 17:47:18 -0400"
metadata.oldPermalink = "/mods/2016/05/21/194-porting-spree/" metadata.oldPermalink = ["/mods/2016/05/21/194-porting-spree/", "/minecraft/2016/1-9-4-porting-spree/"]
metadata.shortDesc = "Now that Forge for 1.9.4 is out, I've begun the log and arduous process of porting my mods to 1.9.4 (if by long and arduous, you mean short and trivial)." metadata.shortDesc = "Now that Forge for 1.9.4 is out, I've begun the log and arduous process of porting my mods to 1.9.4 (if by long and arduous, you mean short and trivial)."
``` ```

View File

@ -2,7 +2,7 @@
metadata.title = "Introducing RTFM" metadata.title = "Introducing RTFM"
metadata.category = "minecraft" metadata.category = "minecraft"
metadata.date = "2016-06-29 12:00:00 -0400" metadata.date = "2016-06-29 12:00:00 -0400"
metadata.oldPermalink = "/meta/2016/06/29/introducing-rtfm/" metadata.oldPermalink = ["/meta/2016/06/29/introducing-rtfm/", "/minecraft/2016/introducing-rtfm/"]
metadata.shortDesc = "RTFM is the brand new website that will contain the documentation for all of my projects, currently it only contains documentation for MC mods." metadata.shortDesc = "RTFM is the brand new website that will contain the documentation for all of my projects, currently it only contains documentation for MC mods."
``` ```

View File

@ -2,7 +2,7 @@
metadata.title = "Forge Modding Tutorials for 1.10.2" metadata.title = "Forge Modding Tutorials for 1.10.2"
metadata.category = "minecraft" metadata.category = "minecraft"
metadata.date = "2016-06-30 10:35:00 -0400" metadata.date = "2016-06-30 10:35:00 -0400"
metadata.oldPermalink = "/meta/2016/06/30/forge-1102-tutorials/" metadata.oldPermalink = ["/meta/2016/06/30/forge-1102-tutorials/", "/minecraft/2016/forge-modding-tutorials-for-1-10-2"]
metadata.shortDesc = "The Forge modding tutorials have all the been updated to MC 1.10.2 as has the GitHub repo." metadata.shortDesc = "The Forge modding tutorials have all the been updated to MC 1.10.2 as has the GitHub repo."
``` ```

View File

@ -2,7 +2,7 @@
metadata.title = "Introducing Mirror" metadata.title = "Introducing Mirror"
metadata.category = "java" metadata.category = "java"
metadata.date = "2016-07-28 16:45:00 -0400" metadata.date = "2016-07-28 16:45:00 -0400"
metadata.oldPermalink = "/java/2016/07/28/introducing-mirror/" metadata.oldPermalink = ["/java/2016/07/28/introducing-mirror/", "/java/2016/introducing-mirror/"]
metadata.shortDesc = "Allow me to introduce my latest project, Mirror. Mirror is a reflection library for Java designed to take advantage of the streams, lambdas, and optionals introduced in Java 8." metadata.shortDesc = "Allow me to introduce my latest project, Mirror. Mirror is a reflection library for Java designed to take advantage of the streams, lambdas, and optionals introduced in Java 8."
``` ```

View File

@ -2,7 +2,7 @@
metadata.title = "Kotlin and Minecraft Forge" metadata.title = "Kotlin and Minecraft Forge"
metadata.category = "minecraft" metadata.category = "minecraft"
metadata.date = "2016-08-06 16:45:30 -0400" metadata.date = "2016-08-06 16:45:30 -0400"
metadata.oldPermalink = "/forge/2016/08/06/kotlin-and-forge/" metadata.oldPermalink = ["/forge/2016/08/06/kotlin-and-forge/", "/minecraft/2016/kotlin-and-minecraft-forge/"]
metadata.shortDesc = "So, you wanna use Kotlin in your Forge mod? Well there's good news, I've just released Forgelin, a fork of Emberwalker's Forgelin, a library that provides utilities for using Kotlin with Minecraft/Forge. " metadata.shortDesc = "So, you wanna use Kotlin in your Forge mod? Well there's good news, I've just released Forgelin, a fork of Emberwalker's Forgelin, a library that provides utilities for using Kotlin with Minecraft/Forge. "
``` ```

View File

@ -2,7 +2,7 @@
metadata.title = "The Great Redesign" metadata.title = "The Great Redesign"
metadata.category = "meta" metadata.category = "meta"
metadata.date = "2016-08-07 15:39:48 -0400" metadata.date = "2016-08-07 15:39:48 -0400"
metadata.oldPermalink = "/meta/2016/08/07/the-great-redesign/" metadata.oldPermalink = ["/meta/2016/08/07/the-great-redesign/", "/meta/2016/the-great-redesign/"]
metadata.shortDesc = "Welcome to the fourth iteration of my website." metadata.shortDesc = "Welcome to the fourth iteration of my website."
``` ```

View File

@ -2,7 +2,7 @@
metadata.title = "Type: A FOSS clone of typing.io" metadata.title = "Type: A FOSS clone of typing.io"
metadata.category = "misc" metadata.category = "misc"
metadata.date = "2016-10-08 17:29:42 -0400" metadata.date = "2016-10-08 17:29:42 -0400"
metadata.oldPermalink = "/misc/2016/10/08/type/" metadata.oldPermalink = ["/misc/2016/10/08/type/", "/misc/2016/type/"]
metadata.shortDesc = "I made an awesome FOSS clone of typing.io that you can check out at type.shadowfacts.net." metadata.shortDesc = "I made an awesome FOSS clone of typing.io that you can check out at type.shadowfacts.net."
``` ```

View File

@ -2,7 +2,7 @@
metadata.title = "The Pretty Good Minor Update" metadata.title = "The Pretty Good Minor Update"
metadata.category = "meta" metadata.category = "meta"
metadata.date = "2017-02-17 14:30:42 -0400" metadata.date = "2017-02-17 14:30:42 -0400"
metadata.oldPermalink = "/meta/2017/02/17/the-pretty-good-minor-update/" metadata.oldPermalink = ["/meta/2017/02/17/the-pretty-good-minor-update/", "/meta/2017/the-pretty-good-minor-update/"]
metadata.shortDesc = "It's been about six months since the last time I redesigned the site, and while I didn't want to redesign it yet again, I felt it could use a little update to make sure everything's still good." metadata.shortDesc = "It's been about six months since the last time I redesigned the site, and while I didn't want to redesign it yet again, I felt it could use a little update to make sure everything's still good."
``` ```

View File

@ -2,11 +2,11 @@
metadata.title = "Comments Powered by GitHub" metadata.title = "Comments Powered by GitHub"
metadata.category = "meta" metadata.category = "meta"
metadata.date = "2017-04-23 09:05:42 -0400" metadata.date = "2017-04-23 09:05:42 -0400"
metadata.oldPermalink = "/meta/2017/04/23/comments-powered-by-github/" metadata.oldPermalink = ["/meta/2017/04/23/comments-powered-by-github/", "/meta/2017/comments-powered-by-git-hub/"]
metadata.shortDesc = "I built a way of commenting on my static website using GitHub to store comments." metadata.shortDesc = "I built a way of commenting on my static website using GitHub to store comments."
``` ```
**NOTE:** This article has been superseded by the [ActivityPub comments system](/meta/2019/reincarnation/#activity-pub). **NOTE:** This article has been superseded by the [ActivityPub comments system](/2019/reincarnation/#activity-pub).
After seeing [this article][orig] the other morning about replacing the Disqus comments on a blog powered by a static site generator (like this one) with comments backed by a GitHub issue and some front-end JavaScript to load and display them, I thought it would be fun to implement something similar. First I only built the code for displaying comments, similar to the aforementioned article, but I decided to take it one step further by allowing users to submit comments directly from my site. After seeing [this article][orig] the other morning about replacing the Disqus comments on a blog powered by a static site generator (like this one) with comments backed by a GitHub issue and some front-end JavaScript to load and display them, I thought it would be fun to implement something similar. First I only built the code for displaying comments, similar to the aforementioned article, but I decided to take it one step further by allowing users to submit comments directly from my site.

View File

@ -3,6 +3,7 @@ metadata.title = "Reincarnation"
metadata.category = "meta" metadata.category = "meta"
metadata.date = "2019-09-18 10:34:42 -0400" metadata.date = "2019-09-18 10:34:42 -0400"
metadata.shortDesc = "Stand by for reincarnation." metadata.shortDesc = "Stand by for reincarnation."
metadata.oldPermalink = "/meta/2019/reincarnation/"
``` ```
<figure> <figure>

View File

@ -3,6 +3,7 @@ metadata.title = "ActivityPub Resources"
metadata.category = "activitypub" metadata.category = "activitypub"
metadata.date = "2019-09-22 17:50:42 -0400" metadata.date = "2019-09-22 17:50:42 -0400"
metadata.shortDesc = "A compilation of resources I found useful in learning/implementing ActivityPub." metadata.shortDesc = "A compilation of resources I found useful in learning/implementing ActivityPub."
metadata.oldPermalink = "/activitypub/2019/activity-pub-resources/"
``` ```
This isn't really going to be a blog most, but more of a collection of tidbits and resources I found helpful in implenting the [ActivityPub integration](/meta/2019/reincarnation/#activity-pub) for the new version of my blog. This isn't really going to be a blog most, but more of a collection of tidbits and resources I found helpful in implenting the [ActivityPub integration](/meta/2019/reincarnation/#activity-pub) for the new version of my blog.

View File

@ -3,6 +3,7 @@ metadata.title = "Learning Elixir"
metadata.category = "elixir" metadata.category = "elixir"
metadata.date = "2019-10-10 12:29:42 -0400" metadata.date = "2019-10-10 12:29:42 -0400"
metadata.shortDesc = "How I learned Elixir and why I love it." metadata.shortDesc = "How I learned Elixir and why I love it."
metadata.oldPermalink = "/elixir/2019/learning-elixir/"
``` ```
About a year ago, I set out to learn the [Elixir](https://elixir-lang.org) programming language. At the time, it was mainly so I could contribute to [Pleroma](https://pleroma.social), but I've since fallen in love with the language. About a year ago, I set out to learn the [Elixir](https://elixir-lang.org) programming language. At the time, it was mainly so I could contribute to [Pleroma](https://pleroma.social), but I've since fallen in love with the language.

View File

@ -3,6 +3,7 @@ metadata.title = "Building a JavaScript-Free Slide-Over Menu"
metadata.category = "web" metadata.category = "web"
metadata.date = "2019-11-11 21:08:42 -0400" metadata.date = "2019-11-11 21:08:42 -0400"
metadata.shortDesc = "Building a slide-over hamburger menu without using JavaScript." metadata.shortDesc = "Building a slide-over hamburger menu without using JavaScript."
metadata.oldPermalink = "/web/2019/js-free-hamburger-menu/"
metadata.slug = "js-free-hamburger-menu" metadata.slug = "js-free-hamburger-menu"
``` ```

View File

@ -3,6 +3,7 @@ metadata.title = "Mocking HTTP Requests for iOS App UI Tests"
metadata.category = "ios" metadata.category = "ios"
metadata.date = "2019-12-22 19:12:42 -0400" metadata.date = "2019-12-22 19:12:42 -0400"
metadata.shortDesc = "Integrating a tiny web server into your Xcode UI test target to mock HTTP requests." metadata.shortDesc = "Integrating a tiny web server into your Xcode UI test target to mock HTTP requests."
metadata.oldPermalink = "/ios/2019/mock-http-ios-ui-testing/"
metadata.slug = "mock-http-ios-ui-testing" metadata.slug = "mock-http-ios-ui-testing"
``` ```

View File

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB