mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-06-30 02:05:57 -04:00
shift asset processing to webpack (#424)
also migrated SASS to latest syntax (via dart-sass) and vastly simplified light/dark theme logic
This commit is contained in:
@@ -4,8 +4,7 @@
|
||||
{{ partialCached "head/mobile" . -}}
|
||||
{{ partialCached "head/preload" . -}}
|
||||
{{ partial "head/styles" . -}}
|
||||
{{ partialCached "head/favicons" (dict "pngSizes" "192 48 32 16" "icoSizes" "16 32") -}}
|
||||
{{ partialCached "head/favicons" (dict "pngSizes" "192 48 32 16" "icoSizes" "16 32" "manifest" .Site.Data.manifest) -}}
|
||||
{{ partialCached "head/feeds" . -}}
|
||||
{{ partial "head/canonical" . -}}
|
||||
{{ partialCached "head/webmention" . -}}
|
||||
{{ partial "head/schema" . -}}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
<link rel="canonical" href="{{ print .Site.Params.baseURL .Permalink }}">
|
||||
|
||||
{{ if .Site.Params.social.webmentionIO }}
|
||||
<link rel="webmention" href="{{ print $.Site.Params.baseURL "/api/mention/" }}">
|
||||
<link rel="pingback" href="{{ print $.Site.Params.baseURL "/api/ping/" }}">
|
||||
{{ end }}
|
||||
|
||||
<link rel="author" href="{{ "humans.txt" | absURL }}">
|
||||
<link rel="pgpkey" href="{{ "pubkey.asc" | absURL }}" type="application/pgp-keys">
|
||||
<link rel="license" href="{{ "license/" | absURL }}">
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
{{- range (split .pngSizes " ") }}
|
||||
{{- $faviconPng := resources.Get (printf "img/favicon-%v.png" .) }}
|
||||
<!-- <link rel="icon" href="{{ $faviconPng.Permalink }}" sizes="{{ . }}x{{ . }}"> -->
|
||||
{{- end -}}
|
||||
|
||||
{{- $s := slice -}}
|
||||
{{- range (split .icoSizes " ") }}{{ $s = $s | append (printf "%vx%v" . .) }}{{ end -}}
|
||||
{{- $faviconIco := resources.Get "img/favicon.ico" }}
|
||||
<link rel="icon" href="{{ $faviconIco.Permalink }}"> <!-- sizes="{{ delimit $s " " }}" -->
|
||||
{{- $faviconIco := index .manifest "images/favicon.ico" }}
|
||||
<link rel="icon" href="{{ $faviconIco.src | absURL }}"> <!-- sizes="{{ delimit $s " " }}" -->
|
||||
|
||||
{{- $faviconSvg := resources.Get "img/favicon.svg" }}
|
||||
<link rel="icon" href="{{ $faviconSvg.Permalink }}" type="image/svg+xml">
|
||||
{{- $faviconSvg := index .manifest "images/favicon.svg" }}
|
||||
<link rel="icon" href="{{ $faviconSvg.src | absURL }}" type="image/svg+xml">
|
||||
|
||||
{{- $appleIcon := resources.Get "img/apple-touch-icon.png" }}
|
||||
<link rel="apple-touch-icon" href="{{ $appleIcon.Permalink }}" sizes="{{ $appleIcon.Width }}x{{ $appleIcon.Height }}">
|
||||
{{- $appleIcon := index .manifest "images/apple-touch-icon.png" }}
|
||||
<link rel="apple-touch-icon" href="{{ $appleIcon.src | absURL }}" sizes="180x180">
|
||||
|
||||
<link rel="manifest" href="{{ "site.webmanifest" | absURL }}">
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<meta property="og:site_name" content="{{ .Site.Title }}">
|
||||
<meta property="og:type" content="{{ if and .IsPage (eq .Type .Site.Params.mainSection) }}article{{ else }}website{{ end }}">
|
||||
<meta property="og:locale" content="en_US">
|
||||
<meta property="og:url" content="{{ .Permalink }}">
|
||||
<meta property="og:url" content="{{ print .Site.Params.baseURL .Permalink }}">
|
||||
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }}">
|
||||
|
||||
{{- with .Scratch.Get "pageImage" }}
|
||||
<meta property="og:image" content="{{ .Permalink }}">
|
||||
<meta property="og:image" content="{{ print $.Site.Params.baseURL .Permalink }}">
|
||||
<meta property="og:image:type" content="{{ .MediaType }}">
|
||||
<meta property="og:image:width" content="{{ .Width }}">
|
||||
<meta property="og:image:height" content="{{ .Height }}">
|
||||
@@ -31,7 +31,7 @@
|
||||
{{ with .Site.Params.social.facebookAppID }}<meta property="fb:app_id" content="{{ . }}">{{ end }}
|
||||
|
||||
<meta name="twitter:card" content="{{ if .IsPage }}summary_large_image{{ else }}summary{{ end }}">
|
||||
<meta name="twitter:domain" content="{{ (urls.Parse .Site.BaseURL).Host }}">
|
||||
<meta name="twitter:domain" content="{{ (urls.Parse .Site.Params.baseURL).Host }}">
|
||||
{{- with .Site.Author.social.twitter }}
|
||||
<meta name="twitter:site" content="{{ print "@" . }}">
|
||||
<meta name="twitter:creator" content="{{ print "@" . }}">
|
||||
|
||||
@@ -1,4 +1 @@
|
||||
<link rel="preload" href="{{ "vendor/fonts/inter-subset.var.woff2" | absURL }}" as="font" type="font/woff2" crossorigin>
|
||||
<link rel="preload" href="{{ "vendor/fonts/roboto-mono-subset.var.woff2" | absURL }}" as="font" type="font/woff2" crossorigin>
|
||||
|
||||
{{ template "__preload_js" . }}
|
||||
{{ template "__head_preload" . }}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@type": "BlogPosting",
|
||||
"url": {{ with .OutputFormats.Get "html" }}{{ .Permalink }}{{ end }},
|
||||
"mainEntityOfPage": {{ with .OutputFormats.Get "html" }}{{ .Permalink }}{{ end }},
|
||||
"url": {{ with .OutputFormats.Get "html" }}{{ print $.Site.Params.baseURL .Permalink }}{{ end }},
|
||||
"mainEntityOfPage": {{ with .OutputFormats.Get "html" }}{{ print $.Site.Params.baseURL .Permalink }}{{ end }},
|
||||
"name": {{ .Scratch.Get "plainTitle" }},
|
||||
"headline": {{ .Scratch.Get "plainTitle" }},
|
||||
"datePublished": {{ .PublishDate.Format "2006-01-02T15:04:05-07:00" }},
|
||||
@@ -12,22 +12,22 @@
|
||||
"description": {{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }},
|
||||
"wordCount": "{{ .WordCount }}",
|
||||
"author": {
|
||||
"@id": {{ print (absURL "/") "#author" }}
|
||||
"@id": {{ print .Site.Params.baseURL $.Site.BaseURL "#author" }}
|
||||
},
|
||||
"publisher": {
|
||||
"@type": "Organization",
|
||||
"name": {{ .Site.Title }},
|
||||
"url": {{ .Site.BaseURL }}{{ with .Scratch.Get "logoImage" }},
|
||||
"url": {{ .Site.Params.baseURL }}{{ with .Scratch.Get "logoImage" }},
|
||||
"logo": {
|
||||
"@type": "ImageObject",
|
||||
"url": {{ .Permalink }},
|
||||
"url": {{ print $.Site.Params.baseURL .Permalink }},
|
||||
"width": "{{ .Width }}",
|
||||
"height": "{{ .Height }}"
|
||||
}{{ end }}
|
||||
}{{ with .Scratch.Get "pageImage" }},
|
||||
"image": {
|
||||
"@type": "ImageObject",
|
||||
"url": {{ .Permalink }},
|
||||
"url": {{ print $.Site.Params.baseURL .Permalink }},
|
||||
"width": "{{ .Width }}",
|
||||
"height": "{{ .Height }}"
|
||||
}{{ end }}
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@type": "Person",
|
||||
"@id": {{ print (absURL "/") "#author" }},
|
||||
"@id": {{ print $.Site.Params.baseURL $.Site.BaseURL "#author" }},
|
||||
"name": {{ .name }},
|
||||
"url": {{ $.Site.BaseURL }},
|
||||
"url": {{ print $.Site.Params.baseURL $.Site.BaseURL }},
|
||||
"description": {{ $.Site.Params.description }},{{ with $.Scratch.Get "authorImage" }}
|
||||
"image": {
|
||||
"@type": "ImageObject",
|
||||
"url": {{ .Permalink }},
|
||||
"url": {{ print $.Site.Params.baseURL .Permalink }},
|
||||
"width": "{{ .Width }}",
|
||||
"height": "{{ .Height }}"
|
||||
},{{ end }}
|
||||
"sameAs": [
|
||||
{{ $.Site.BaseURL }},{{ with .social }}
|
||||
{{ print $.Site.Params.baseURL $.Site.BaseURL }},{{ with .social }}
|
||||
{{ with .github }}{{ print "https://github.com/" . }},{{ end }}
|
||||
{{ with .keybase }}{{ print "https://keybase.io/" . }},{{ end }}
|
||||
{{ with .twitter }}{{ print "https://twitter.com/" . }},{{ end }}
|
||||
|
||||
@@ -1,11 +1 @@
|
||||
{{ $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 (see functions/init) */}}
|
||||
{{- with .Scratch.Get "pageCss" -}}
|
||||
{{ printf "<!-- htmlmin:ignore -->" | safeHTML -}}
|
||||
<style>
|
||||
{{ . | safeCSS }}
|
||||
</style>
|
||||
{{- printf "<!-- htmlmin:ignore -->" | safeHTML }}
|
||||
{{ end -}}
|
||||
{{ template "__head_css" . }}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
{{ if .Site.Params.social.webmentionIO }}
|
||||
<link rel="webmention" href="{{ "api/mention/" | absURL }}">
|
||||
<link rel="pingback" href="{{ "api/ping/" | absURL }}">
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user