1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-27 09:38:27 -04:00
jarv.is/netlify.toml
Jake Jarvis 2909e934e7
rename atom shortcodes from .atom.xml to .atom.atom, and stop using symlinks
let's see if this fixes the issue of the wrong shortcode types (usually AMP) being chosen inconsistently
2020-07-19 12:29:51 -04:00

238 lines
5.9 KiB
TOML

[build]
command = "yarn build"
publish = "public"
functions = ".netlify/functions"
[build.environment]
NODE_VERSION = "14"
YARN_VERSION = "1.22.4"
YARN_FLAGS = "--no-ignore-optional --frozen-lockfile"
GO_VERSION = "1.14.6"
# Ensure *only* Pretty URLs are enabled, even though this is already set up in
# the Netlify dashboard.
[build.processing]
skip_processing = false
[build.processing.css]
bundle = false
minify = false
[build.processing.js]
bundle = false
minify = false
[build.processing.html]
pretty_urls = true
[build.processing.images]
compress = false
[context.deploy-preview]
command = "yarn build:hugo --environment development --baseURL $DEPLOY_PRIME_URL --buildDrafts --buildFuture"
[context.branch-deploy]
command = "yarn build:hugo --environment development --baseURL $DEPLOY_PRIME_URL --buildDrafts --buildFuture"
# https://github.com/netlify/cli/blob/master/docs/netlify-dev.md#netlifytoml-dev-block
[dev]
framework = "#custom"
command = "yarn start:hugo --baseURL=/ --appendPort=false --disableLiveReload"
targetPort = 1337
port = 1338
autoLaunch = false
# Cache resoures between builds:
# https://github.com/jakejarvis/netlify-plugin-cache
[[plugins]]
package = "@netlify/plugin-local-install-core"
[[plugins]]
package = "./plugins/netlify-plugin-cache"
[plugins.inputs]
paths = ["resources", "public", "_vendor"]
[[plugins]]
package = "netlify-plugin-debug-cache"
# The most important headers and redirects are specified in the _headers and
# _redirects files generated by Hugo. These are additional custom rules.
# PGP key: open in browser, download correctly
[[headers]]
for = "/jarvis.asc"
[headers.values]
Cache-Control = "no-cache"
Content-Type = "text/plain; charset=UTF-8"
Content-Disposition = "inline; filename=\"jarvis.asc\""
# AMP cache invalidation key requirements:
# https://developers.google.com/amp/cache/update-cache#update-cache-guidelines
[[headers]]
for = "/.well-known/amphtml/apikey.pub"
[headers.values]
Content-Type = "text/plain; charset=UTF-8"
# Redirect Netlify and www subdomains to primary domain:
[[redirects]]
from = "https://jakejarvis.netlify.com/*"
to = "https://jarv.is/:splat"
status = 301
force = true
[[redirects]]
from = "https://jakejarvis.netlify.app/*"
to = "https://jarv.is/:splat"
status = 301
force = true
[[redirects]]
from = "https://www.jarv.is/*"
to = "https://jarv.is/:splat"
status = 301
force = true
# Support ancient RSS subscriptions and links from WordPress era:
[[redirects]]
from = "/feed"
to = "/feed.xml"
status = 301
[[redirects]]
from = "/rss"
to = "/feed.xml"
status = 301
[[redirects]]
from = "/index.xml"
to = "/feed.xml"
status = 301
[[redirects]]
from = "/index.php"
to = "/"
status = 301
[[redirects]]
from = "/blog/*"
to = "/notes/"
status = 301
[[redirects]]
from = "/archives/*"
to = "/notes/"
status = 301
[[redirects]]
# Not sure if these XML-RPC requests are malicious but forward them to
# webmention.io anyway.
from = "/xmlrpc.php"
to = "https://webmention.io/jarv.is/xmlrpc"
status = 302
# Proxy data to Simple Analytics endpoints:
[[redirects]]
from = "/api/views/send*"
to = "https://queue.simpleanalyticscdn.com/simple.gif:splat"
status = 200
force = true
[[redirects]]
from = "/api/views/append*"
to = "https://queue.simpleanalyticscdn.com/append:splat"
status = 200
force = true
[[redirects]]
# This noscript pixel needs to pass unknown arguments along for AMP pages:
# https://amp.dev/documentation/components/amp-pixel/
from = "/api/views/noscript.gif*"
to = "https://queue.simpleanalyticscdn.com/noscript.gif:splat"
status = 200
force = true
# TEMPORARY: Moved analytics endpoints above into /api/views
[[redirects]]
from = "/sa/*"
to = "/api/views/:splat"
status = 301
# Prettier URLs for Netlify Functions (must come after /api/views rules above)
[[redirects]]
from = "/api/*"
to = "/.netlify/functions/:splat"
status = 200
# More miscellaneous mirrors/redirects:
[[redirects]]
from = "/resume"
to = "/resume.pdf"
status = 302
[[redirects]]
from = "/me.jpg"
to = "/img/me.jpg"
status = 301
[[redirects]]
from = "/me_large.jpg"
to = "/img/me.jpg"
status = 301
[[redirects]]
from = "/img/me_large.jpg"
to = "/img/me.jpg"
status = 301
[[redirects]]
from = "/favicon.ico"
to = "/img/favicon.ico"
status = 200
[[redirects]]
from = "/apple-touch-icon.png"
to = "/img/apple-touch-icon.png"
status = 200
[[redirects]]
from = "/safari-pinned-tab.svg"
to = "/img/safari-pinned-tab.svg"
status = 200
[[redirects]]
from = "/keybase.txt"
to = "/.well-known/keybase.txt"
status = 301
[[redirects]]
from = "/twemoji/svg/*"
to = "/vendor/emoji/svg/:splat"
status = 301
# Moved these random sites/projects elsewhere (mostly GitHub Pages) to keep
# this repo and domain squeaky clean:
[[redirects]]
from = "/y2k/*"
to = "https://jakejarvis.github.io/my-first-website/:splat"
status = 302
[[redirects]]
from = "/ios-trackers/*"
to = "https://jakejarvis.github.io/ios-trackers/:splat"
status = 302
[[redirects]]
from = "/hugo-node/*"
to = "https://github.com/jakejarvis/hugo-extended"
status = 302
[[redirects]]
from = "/awesome/*"
to = "https://synonymsforawesome.com/:splat"
status = 302
[[redirects]]
from = "/scrabble/*"
to = "https://scrabble.io/:splat"
status = 302
[[redirects]]
from = "/candies/*"
to = "https://jakejarvis.github.io/candies/:splat"
status = 302
[[redirects]]
from = "/comp20/*"
to = "https://jakejarvis.github.io/comp20/:splat"
status = 302
# H A C K E R M A N ( ͡° ͜ʖ ͡°)
[[redirects]]
from = "*/wp-admin/*"
to = "/403.html"
status = 403
[[redirects]]
from = "*/admin/*"
to = "/403.html"
status = 403
[[redirects]]
from = "*/wp-login.php"
to = "/403.html"
status = 403
[[redirects]]
from = "*/login.php"
to = "/403.html"
status = 403
[[redirects]]
from = "*/wlwmanifest.xml"
to = "/403.html"
status = 403