mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-03 14:06:40 -04:00
fix page CSS parsing on amp pages
https://search.google.com/search-console/amp/drilldown?resource_id=https%3A%2F%2Fjarv.is%2F&item_key=GhkIIhADIhBzdHlsZSBhbXAtY3VzdG9tKKVO&hl=en&sharing_key=ozvLdt6NrwXwjyC3ZJCWPA
This commit is contained in:
@ -58,8 +58,8 @@ disableAliases = true
|
||||
mastodon = "mastodon.social/@jakejarvis"
|
||||
|
||||
[module]
|
||||
# we're grabbing Twemoji SVGs from a pseudo NPM package on GitHub:
|
||||
# https://github.com/jakejarvis/twemoji-svg
|
||||
# we're grabbing Twemoji SVGs from an NPM helper package:
|
||||
# https://www.npmjs.com/package/twemoji-emojis
|
||||
[[module.mounts]]
|
||||
source = "node_modules/twemoji-emojis/vendor/svg"
|
||||
target = "static/vendor/emoji/svg"
|
||||
|
@ -256,10 +256,10 @@
|
||||
div.highlight span.gs { font-weight: bold; }
|
||||
div.highlight span.lnt { color: #999999; user-select: none; }
|
||||
|
||||
{{/* Page-specific styles set via front matter */}}
|
||||
{{- with .Params.css }}
|
||||
/* Page-specific styles set via front matter */
|
||||
{{ with .Scratch.Get "pageCss" }}
|
||||
{{- replace . " !important" "" | safeCSS -}}
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
</style>
|
||||
|
||||
{{ partialCached "head/favicons" (dict "pngSizes" "192 48 32 16" "icoSizes" "16 32") }}
|
||||
|
@ -37,3 +37,11 @@
|
||||
{{- $.Scratch.Set "logoImage" . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Page-specific styles set via front matter, piped through PostCSS and inlined */}}
|
||||
{{- with .Params.css -}}
|
||||
{{/* NOTE: This file doesn't end up getting published (which is good) */}}
|
||||
{{- $target := path.Join $.File.Dir "css/inline.scss" -}}
|
||||
{{- $css := . | resources.FromString $target | resources.ExecuteAsTemplate $target . | resources.ToCSS (dict "targetPath" $target) | resources.PostCSS (dict "config" "postcss.config.js") -}}
|
||||
{{- $.Scratch.Set "pageCss" $css.Content -}}
|
||||
{{- end -}}
|
||||
|
@ -1,2 +1,2 @@
|
||||
<link rel="alternate" type="application/rss+xml" href="{{ "feed.xml" | absURL }}" title="{{ .Site.Title }} (RSS)">
|
||||
<link rel="alternate" type="application/atom+xml" href="{{ "feed.atom" | absURL }}" title="{{ .Site.Title }} (Atom)">
|
||||
<link rel="alternate" href="{{ "feed.xml" | absURL }}" type="application/rss+xml" title="{{ .Site.Title }} (RSS)">
|
||||
<link rel="alternate" href="{{ "feed.atom" | absURL }}" type="application/atom+xml" title="{{ .Site.Title }} (Atom)">
|
||||
|
@ -1,16 +1,11 @@
|
||||
{{ $style := resources.Get "sass/main.scss" | resources.ExecuteAsTemplate "sass/main.scss" . | resources.ToCSS (dict "targetPath" "css/main.css") | resources.PostCSS (dict "config" "postcss.config.js") }}
|
||||
<link rel="stylesheet" href="{{ $style.Permalink }}">
|
||||
|
||||
{{/* Page-specific styles set via front matter, piped through PostCSS and inlined */}}
|
||||
{{- with .Params.css -}}
|
||||
{{/* NOTE: This file doesn't end up getting published (which is good) */}}
|
||||
{{- $target := path.Join $.File.Dir "css/inline.css" -}}
|
||||
{{- $css := . | resources.FromString $target | resources.ExecuteAsTemplate $target . | resources.PostCSS (dict "config" "postcss.config.js") -}}
|
||||
|
||||
{{/* Already being minified to my taste by PostCSS above */}}
|
||||
{{/* Page-specific styles set via front matter, piped through PostCSS and inlined (see functions/init) */}}
|
||||
{{- with .Scratch.Get "pageCss" -}}
|
||||
{{ printf "<!-- htmlmin:ignore -->" | safeHTML -}}
|
||||
<style>
|
||||
{{ $css.Content | safeCSS }}
|
||||
{{ . | safeCSS }}
|
||||
</style>
|
||||
{{- printf "<!-- htmlmin:ignore -->" | safeHTML }}
|
||||
{{ end -}}
|
||||
|
@ -6,7 +6,7 @@
|
||||
NODE_VERSION = "14"
|
||||
YARN_VERSION = "1.22.10"
|
||||
YARN_FLAGS = "--no-ignore-optional --frozen-lockfile"
|
||||
PYTHON_VERSION="3.7"
|
||||
PYTHON_VERSION = "3.7"
|
||||
|
||||
# Ensure *only* Pretty URLs are enabled, even though this is already set up in
|
||||
# the Netlify dashboard.
|
||||
|
Reference in New Issue
Block a user