1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-05-18 15:04:27 -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:
2021-06-19 17:19:01 -04:00
committed by GitHub
parent 622432c3e4
commit 363b4edf1c
105 changed files with 4061 additions and 955 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<!doctype html>
{{ printf "<!-- htmlmin:ignore -->" | safeHTML -}}
{{ printf "<!--\n ,,, ,,,\n ;\" ^; ;\" \",\n ; s$$$$$s ;\n , ss$$$$$$$ss ,\"\n ;$$$$$$$$$$$$$$$$\n $$$$$$$$$$$$$$$$$$ Hello, human. :)\n $$$$$\"\"\"$$$\"\"\"$$$$$$\n $$$$$ p\"$$$\"q $$$$$ %s\n $$$$ .$$$$$. $$$$\n $$$$$$$$$$$$$$$$$\n \"$$$$\"*\"$$$$\"\n \"$$.$$\"\n-->" ("humans.txt" | absURL) | safeHTML }}
{{ printf "<!--\n ,,, ,,,\n ;\" ^; ;\" \",\n ; s$$$$$s ;\n , ss$$$$$$$ss ,\"\n ;$$$$$$$$$$$$$$$$\n $$$$$$$$$$$$$$$$$$ Hello, human. :)\n $$$$$\"\"\"$$$\"\"\"$$$$$$\n $$$$$ p\"$$$\"q $$$$$ %s\n $$$$ .$$$$$. $$$$\n $$$$$$$$$$$$$$$$$\n \"$$$$\"*\"$$$$\"\n \"$$.$$\"\n-->" (print .Site.Params.baseURL "/humans.txt") | safeHTML }}
{{- printf "<!-- htmlmin:ignore -->" | safeHTML }}
<html lang="{{ .Site.LanguageCode | default "en" }}">
<head>
+7 -7
View File
@@ -2,24 +2,24 @@
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\"?>" | safeHTML }}
<feed xmlns="http://www.w3.org/2005/Atom">
<title>{{ .Site.Title }}</title>
<id>{{ .Permalink }}</id>
<id>{{ print .Site.Params.baseUrl .Permalink }}</id>
<author>
<name>{{ .Site.Title }}</name>
<uri>{{ .Permalink }}</uri>
<uri>{{ print .Site.Params.baseUrl .Permalink }}</uri>
</author>
<generator>Hugo -- gohugo.io</generator>
{{- with .Site.Copyright }}
<rights>{{ . }}</rights>
{{- end }}
{{- with .Scratch.Get "authorImage" }}
<logo>{{ .Permalink }}</logo>
<logo>{{ print $.Site.Params.baseUrl .Permalink }}</logo>
{{- end }}
<updated>{{ .Site.LastChange.Format "2006-01-02T15:04:05Z" | safeHTML }}</updated>
{{- with .OutputFormats.Get "ATOM" }}
{{ printf `<link rel="self" type="%s" href="%s" />` .MediaType.Type .Permalink | safeHTML }}
{{ printf `<link rel="self" type="%s" href="%s" />` .MediaType.Type (print $.Site.Params.baseUrl .Permalink) | safeHTML }}
{{- end }}
{{- range .AlternativeOutputFormats }}
{{ printf `<link rel="alternate" type="%s" href="%s" />` .MediaType.Type .Permalink | safeHTML }}
{{ printf `<link rel="alternate" type="%s" href="%s" />` .MediaType.Type (print $.Site.Params.baseUrl .Permalink) | safeHTML }}
{{- end }}
{{- range (where .Site.RegularPages "Section" .Site.Params.mainSection) }}
<entry>
@@ -27,10 +27,10 @@
{{- with .Site.Author.name }}
<author>
<name>{{ . }}</name>
<uri>{{ $.Permalink }}</uri>
<uri>{{ print $.Site.Params.baseUrl $.Permalink }}</uri>
</author>
{{- end }}
<id>{{ .Permalink }}</id>
<id>{{ print $.Site.Params.baseUrl .Permalink }}</id>
<published>{{ .Date.UTC.Format "2006-01-02T15:04:05Z" | safeHTML }}</published>
<updated>{{ .Date.UTC.Format "2006-01-02T15:04:05Z" | safeHTML }}</updated>
<content type="html">
+14 -14
View File
@@ -1,33 +1,33 @@
{
"name": "{{ .Site.Title }}",
"short_name": "{{ (urls.Parse .Site.BaseURL).Host }}",
"short_name": "{{ (urls.Parse .Site.Params.baseURL).Host }}",
"icons": [
{
"src": "{{ (resources.Get "img/android-chrome-512x512.png").Permalink | safeJS }}",
{{ with index .Site.Data.manifest "images/android-chrome-512x512.png" }}{
"src": "{{ .src | absURL | safeJS }}",
"sizes": "512x512",
"type": "image/png",
"purpose": "any"
},
{
"src": "{{ (resources.Get "img/android-chrome-192x192.png").Permalink | safeJS }}",
},{{ end }}
{{ with index .Site.Data.manifest "images/android-chrome-192x192.png" }}{
"src": "{{ .src | absURL | safeJS }}",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
},
{
"src": "{{ (resources.Get "img/maskable-512x512.png").Permalink | safeJS }}",
},{{ end }}
{{ with index .Site.Data.manifest "images/maskable-512x512.png" }}{
"src": "{{ .src | absURL | safeJS }}",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "{{ (resources.Get "img/maskable-192x192.png").Permalink | safeJS }}",
},{{ end }}
{{ with index .Site.Data.manifest "images/maskable-192x192.png" }}{
"src": "{{ .src | absURL | safeJS }}",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
}
}{{ end }}
],
"start_url": "{{ .Site.BaseURL | safeJS }}",
"start_url": "/",
"display": "browser",
"background_color": "#ffffff",
"theme_color": "#0e6dc2"
+50 -17
View File
@@ -1,10 +1,54 @@
{{- partial "scripts/_bundle" . -}}
{{/* Pull in assets processed by Webpack */}}
{{- define "__head_css" -}}
{{ with .Site.Data.manifest }}
{{ with index . "main.css" }}
<link rel="stylesheet" href="{{ .src | absURL }}">
{{ 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.PostCSS (dict "config" "postcss.config.js") -}}
<style>
{{ $css.Content | safeCSS }}
</style>
{{- end -}}
{{- end -}}
{{- define "__head_preload" -}}
{{ with .Site.Data.manifest }}
{{ with index . "fonts/inter-subset.var.woff2" }}
<link rel="preload" href="{{ .src | absURL }}" as="font" type="font/woff2" crossorigin>
{{ end }}
{{ with index . "fonts/roboto-mono-subset.var.woff2" }}
<link rel="preload" href="{{ .src | absURL }}" as="font" type="font/woff2" crossorigin>
{{ end }}
{{ with index . "main.js" }}
<link rel="preload" href="{{ .src | absURL }}" as="script">
{{ end }}
{{ end }}
{{- end -}}
{{- define "__body_js" -}}
<!-- inline the dark mode script to avoid a blinding flash of white background on loads -->
<script>(function(d){var u=d.document,f=u.body.classList,e=localStorage,c="dark_mode_pref",t=e.getItem(c),a="dark",n="light",r="{{ .Site.Params.Theme.defaultTheme | safeJS }}",o=u.querySelector(".dark-mode-toggle"),i=r===a,b=function(d){f.remove(a,n);f.add(d);i=d===a};t===a&&b(a);t===n&&b(n);if(!t){var s=function(d){return"(prefers-color-scheme: "+d+")"};d.matchMedia(s(a)).matches?b(a):d.matchMedia(s(n)).matches?b(n):b(r);d.matchMedia(s(a)).addListener((function(d){d.matches&&b(a)}));d.matchMedia(s(n)).addListener((function(d){d.matches&&b(n)}))}if(o){o.style.display="block";o.addEventListener("click",(function(){if(i){b(n);e.setItem(c,n)}else{b(a);e.setItem(c,a)}}),!0)}})(window)</script>
{{ with .Site.Data.manifest }}
{{ with index . "main.js" }}
<script async defer src="{{ .src | absURL }}" ></script>
{{ end }}
{{ end }}
{{- end -}}
{{/* Strip any markdown styling from page title for use in meta tags */}}
{{- with .Title -}}
{{- $.Scratch.Set "plainTitle" (. | markdownify | htmlUnescape | plainify) -}}
{{- end -}}
{{/* If this is a page/post, link View Source to specific file on GitHub; otherwise, just link to repo homepage */}}
{{- with .Site.Params.social.githubRepo }}
{{- $githubURL := print "https://github.com/" . }}
@@ -15,12 +59,11 @@
{{- end }}
{{- end }}
{{/* Chooses and initializes various images for use by JSON schema & open graph tags */}}
{{/* Author image (default) */}}
{{- with .Site.Author.image -}}
{{- with resources.Get . -}}
{{- $.Scratch.Set "authorImage" . -}}
{{- end -}}
{{- with index .Site.Data.manifest .Site.Author.image -}}
{{- $.Scratch.Set "authorImage" (dict "Permalink" (absURL .src) "Width" 1200 "Height" 1200 "MediaType" "image/jpeg") -}}
{{- end -}}
{{/* Page image (via frontmatter) */}}
{{- with .Params.image -}}
@@ -34,16 +77,6 @@
{{- end -}}
{{- end -}}
{{/* Site logo */}}
{{- with .Site.Params.image -}}
{{- with resources.Get . -}}
{{- $.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 -}}
{{- with index .Site.Data.manifest .Site.Params.image -}}
{{- $.Scratch.Set "logoImage" (dict "Permalink" (absURL .src) "Width" 2048 "Height" 2048 "MediaType" "image/png") -}}
{{- end -}}
+1 -2
View File
@@ -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" . -}}
+6 -2
View File
@@ -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 }}">
+6 -11
View File
@@ -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 }}">
+3 -3
View File
@@ -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
View File
@@ -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" . }}
+6 -6
View File
@@ -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 }}
+4 -4
View File
@@ -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
View File
@@ -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" . }}
-4
View File
@@ -1,4 +0,0 @@
{{ if .Site.Params.social.webmentionIO }}
<link rel="webmention" href="{{ "api/mention/" | absURL }}">
<link rel="pingback" href="{{ "api/ping/" | absURL }}">
{{ end }}
+3 -3
View File
@@ -1,9 +1,9 @@
<header>
<nav>
<a class="no-underline" href="{{ .Site.BaseURL }}" id="logo" rel="me author" aria-label="{{ .Site.Title }}">
{{ $meImg := resources.Get .Site.Author.image }}
{{ $meImgSm := $meImg.Resize "160x160 q90 jpg" }}
<img id="selfie" src="{{ $meImgSm.Permalink }}" width="54" height="54" alt="Photo of Jake Jarvis">
{{ with index .Site.Data.manifest "images/tiny-selfie.jpg" }}
<img id="selfie" src="{{ .src | absURL }}" width="54" height="54" alt="Photo of Jake Jarvis">
{{ end }}
<span id="name">{{ .Site.Title }}</span>
</a>
-13
View File
@@ -1,13 +0,0 @@
{{ $js := resources.Get "js/index.js" | js.Build (dict "targetPath" "/js/app.js") | resources.Babel (dict "config" "babel.config.json" "noComments" true) }}
{{- .Scratch.Set "bundlePermalink" $js.Permalink -}}
{{- define "__preload_js" -}}
<link rel="preload" href="{{ $.Scratch.Get "bundlePermalink" }}" as="script">
{{- end -}}
{{- define "__body_js" -}}
<!-- inline the dark mode script to avoid a blinding flash of white background on loads -->
<script>(function(d){var u=d.document,f=u.body.classList,e=localStorage,c="dark_mode_pref",t=e.getItem(c),a="dark",n="light",r="{{ .Site.Params.Theme.defaultTheme | safeJS }}",o=u.querySelector(".dark-mode-toggle"),i=r===a,b=function(d){f.remove(a,n);f.add(d);i=d===a};t===a&&b(a);t===n&&b(n);if(!t){var s=function(d){return"(prefers-color-scheme: "+d+")"};d.matchMedia(s(a)).matches?b(a):d.matchMedia(s(n)).matches?b(n):b(r);d.matchMedia(s(a)).addListener((function(d){d.matches&&b(a)}));d.matchMedia(s(n)).addListener((function(d){d.matches&&b(n)}))}if(o){o.style.display="block";o.addEventListener("click",(function(){if(i){b(n);e.setItem(c,n)}else{b(a);e.setItem(c,a)}}),!0)}})(window)</script>
<script async defer src="{{ $.Scratch.Get "bundlePermalink" }}"></script>
{{- end -}}
+1 -1
View File
@@ -3,7 +3,7 @@ User-Agent: *
Disallow: /403.html
Disallow: /404.html
Disallow: /api/
Sitemap: {{ "sitemap.xml" | absURL }}
Sitemap: {{ print .Site.Params.baseUrl "/sitemap.xml" }}
{{- else }}
Disallow: /
{{- end }}
+6 -6
View File
@@ -2,7 +2,7 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ .Site.Title }}</title>
<link>{{ .Permalink }}</link>
<link>{{ print .Site.Params.baseUrl .Permalink }}</link>
<description>{{ with .Site.Params.description }}{{ . }}{{ else }}{{ .Title }}{{ end }}</description>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{ . }}</language>{{ end }}{{ with .Site.Author.email }}
@@ -11,19 +11,19 @@
<copyright>{{ . }}</copyright>{{ end }}
<lastBuildDate>{{ .Site.LastChange.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ with .Scratch.Get "authorImage" }}
<image>
<url>{{ .Permalink }}</url>
<url>{{ print $.Site.Params.baseUrl .Permalink }}</url>
<title>{{ $.Site.Title }}</title>
<link>{{ $.Permalink }}</link>
<link>{{ print $.Site.Params.baseUrl $.Permalink }}</link>
</image>{{ end }}{{ with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML -}}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" (print $.Site.Params.baseUrl .Permalink) .MediaType | safeHTML -}}
{{ end }}
{{- range (where .Site.RegularPages "Section" .Site.Params.mainSection) }}
<item>
<title>{{ .Title | markdownify | htmlUnescape | plainify }}</title>
<link>{{ .Permalink }}</link>
<link>{{ print $.Site.Params.baseUrl .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{ . }}{{ with $.Site.Author.name }} ({{ . }}){{ end }}</author>{{ end }}
<guid>{{ .Permalink }}</guid>
<guid>{{ print $.Site.Params.baseUrl .Permalink }}</guid>
<description>
{{ .Content | html }}
</description>
+1 -1
View File
@@ -2,7 +2,7 @@
<p align="center">
{{ with .Get "link" }}<a href="{{ . }}">{{ end }}
<img src="{{ $optimized.Permalink }}" width="{{ $optimized.Width }}" height="{{ $optimized.Height }}"
<img src="{{ print .Site.Params.baseUrl $optimized.Permalink }}" width="{{ $optimized.Width }}" height="{{ $optimized.Height }}"
{{- with .Get "alt" }} alt="{{ . | safeHTML }}"{{ end }}
{{- with .Inner }} alt="{{ . | $.Page.RenderString | plainify | safeHTML }}"{{ end }}>
{{ if .Get "link" }}</a>{{ end }}
+1 -1
View File
@@ -1 +1 @@
<p>Your browser does not support HTML5 video. {{ with .Page.Resources.GetMatch (.Get "mp4") }}<a href="{{ .Permalink }}">Click to open the .mp4 video directly.</a>{{ end }}</p>
<p>Your browser does not support HTML5 video. {{ with .Page.Resources.GetMatch (.Get "mp4") }}<a href="{{ print $.Site.Params.baseUrl .Permalink }}">Click to open the .mp4 video directly.</a>{{ end }}</p>
+1 -1
View File
@@ -2,7 +2,7 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{{- range .Data.Pages }}
<url>
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
<loc>{{ print $.Site.Params.baseURL .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}