From 55959cc4e1fc2aed16e8ba2a751eb7c0ab6c9f91 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Sun, 18 Jun 2023 11:27:18 -0700 Subject: [PATCH] fix: redirects and rewrites --- .eleventy.js | 1 + _redirects | 25 ++++++++++++++ netlify.toml | 92 +--------------------------------------------------- 3 files changed, 27 insertions(+), 91 deletions(-) create mode 100644 _redirects diff --git a/.eleventy.js b/.eleventy.js index e3047a71..6e7867a9 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -42,6 +42,7 @@ module.exports = function (eleventyConfig) { eleventyConfig.addPassthroughCopy('src/assets') eleventyConfig.addPassthroughCopy('src/robots.txt') eleventyConfig.addPassthroughCopy('src/contribute.json') + eleventyConfig.addPassthroughCopy('_redirects') // shortcodes eleventyConfig.addShortcode('version', () => now) diff --git a/_redirects b/_redirects new file mode 100644 index 00000000..84c4159c --- /dev/null +++ b/_redirects @@ -0,0 +1,25 @@ +# feeds +/rss.xml /feed.xml 301! + +# mastodon +/.well-known/host-meta* https://social.lol/.well-known/host-meta:splat 301 +/.well-known/nodeinfo* https://social.lol/.well-known/nodeinfo:splat 301 + +# rewrites +/feeds/all.xml /feed.xml 200! +/favicon.ico /assets/img/favicon/favicon.ico 200! +/static/favicons/apple-touch-icon.png /assets/img/favicon/apple-touch-icon.png 200! + +# blog posts +/blog/fixing-safari-icloud-syncing /posts/2022/fixing-safari-icloud-syncing/ 301! +/blog/migrating-to-fastmail /posts/2022/migrating-to-fastmail/ 301! +/blog/client-side-webmentions-in-nextjs /posts/2023/client-side-webmentions-in-nextjs/ 301! +/blog/apple-centric-digital-privacy-tools /posts/2022/apple-centric-digital-privacy-tools/ 301! +/blog/automating-rss-syndication-with-nextjs-github /posts/2023/automating-rss-syndication-with-nextjs-github/ 301! +/blog/apple-music-a-tale-of-woe /posts/2021/apple-music-a-tale-of-woe/ 301! +/blog/adding-client-side-rendered-webmentions-to-my-blog /posts/2023/client-side-webmentions-in-nextjs/ 301! +/blog/automating-email-cleanup-in-gmail /posts/2022/automating-email-cleanup-in-gmail/ 301! +/blog/fastmail-handling-inbound-email-with-regex-filters-now-with-chatgpt /posts/2023/fastmail-handling-inbound-email-with-regex-filters-now-with-chatgpt/ 301! +/blog/simple-api-fetch-hooks-with-swr /posts/2022/simple-api-fetch-hooks-with-swr/ 301! +/2023/02/automatingandprobablyoverengineeringmy-nowpage /posts/2023/automating-and-overengineering-my-now-page/ 301! +/2023/01/workflows-handling-inbound-email-on-fastmail-with-regular-expressions /posts/2023/fastmail-handling-inbound-email-with-regex-filters-now-with-chatgpt/ 301! \ No newline at end of file diff --git a/netlify.toml b/netlify.toml index 086a4f0e..ee718d89 100644 --- a/netlify.toml +++ b/netlify.toml @@ -58,94 +58,4 @@ for = "/follow.xml" [[headers]] for = "/.well-known/webfinger" [headers.values] - Content-Type = "application/jrd+json; charset=utf-8" - -### -# SITE REDIRECTS -### -[[redirects]] -from = "/rss.xml" -to = "/feed.xml" -status = 301 - -[[redirects]] -from = "/blog/fixing-safari-icloud-syncing" -to = "/posts/2022/fixing-safari-icloud-syncing/" -status = 301 - -[[redirects]] -from = "/blog/migrating-to-fastmail" -to = "/posts/2022/migrating-to-fastmail/" -status = 301 - -[[redirects]] -from = "/blog/client-side-webmentions-in-nextjs" -to = "/posts/2023/client-side-webmentions-in-nextjs/" -status = 301 - -[[redirects]] -from = "/blog/apple-centric-digital-privacy-tools" -to = "/posts/2022/apple-centric-digital-privacy-tools/" -status = 301 - -[[redirects]] -from = "/blog/automating-rss-syndication-with-nextjs-github" -to = "/posts/2023/automating-rss-syndication-with-nextjs-github/" -status = 301 - -[[redirects]] -from = "/blog/apple-music-a-tale-of-woe" -to = "/posts/2021/apple-music-a-tale-of-woe/" -status = 301 - -[[redirects]] -from = "/blog/adding-client-side-rendered-webmentions-to-my-blog" -to = "/posts/2023/client-side-webmentions-in-nextjs/" -status = 301 - -[[redirects]] -from = "/blog/automating-email-cleanup-in-gmail" -to = "/posts/2022/automating-email-cleanup-in-gmail/" -status = 301 - -[[redirects]] -from = "/blog/fastmail-handling-inbound-email-with-regex-filters-now-with-chatgpt" -to = "/posts/2023/fastmail-handling-inbound-email-with-regex-filters-now-with-chatgpt/" -status = 301 - -[[redirects]] -from = "/blog/simple-api-fetch-hooks-with-swr" -to = "/posts/2022/simple-api-fetch-hooks-with-swr/" -status = 301 - -[[redirects]] -from = "/2023/02/automatingandprobablyoverengineeringmy-nowpage" -to = "/posts/2023/automating-and-overengineering-my-now-page/" -status = 301 - -[[redirects]] -from = "/2023/01/workflows-handling-inbound-email-on-fastmail-with-regular-expressions" -to = "/posts/2023/fastmail-handling-inbound-email-with-regex-filters-now-with-chatgpt/" -status = 301 - -### -# SITE REWRITES -### - -[[redirects]] -from = "/feeds/all.xml" -to = "/feed.xml" -status = 200 -force = true - -[[redirects]] -from = "/favicon.ico" -to = "/assets/img/favicon/favicon.ico" -status = 200 -force = true - -[[redirects]] -from = "/static/favicons/apple-touch-icon.png" -to = "/assets/img/favicon/apple-touch-icon.png" -status = 200 -force = true \ No newline at end of file + Content-Type = "application/jrd+json; charset=utf-8" \ No newline at end of file