mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-19 15:25:31 -04:00
make absURLs more resilient (trailing slashes/not)
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -2,6 +2,8 @@ public/
|
|||||||
builds/
|
builds/
|
||||||
resources/
|
resources/
|
||||||
|
|
||||||
|
.env
|
||||||
|
|
||||||
node_modules/
|
node_modules/
|
||||||
package-lock.json
|
package-lock.json
|
||||||
yarn-debug.log
|
yarn-debug.log
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
{{ 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-->" ("humans.txt" | absURL) | safeHTML }}
|
||||||
<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en{{ end }}">
|
<html lang="{{ .Site.LanguageCode | default "en" }}">
|
||||||
<head>
|
<head>
|
||||||
{{ partial "head/head" . }}
|
{{ partial "head/head" . }}
|
||||||
</head>
|
</head>
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
{{ if .HasShortcode "vimeo" }}<script async custom-element="amp-gist" src="https://cdn.ampproject.org/v0/amp-vimeo-0.1.js"></script>{{ end }}
|
{{ if .HasShortcode "vimeo" }}<script async custom-element="amp-gist" src="https://cdn.ampproject.org/v0/amp-vimeo-0.1.js"></script>{{ end }}
|
||||||
<title>{{ .Title }} – {{ .Site.Title }}</title>
|
<title>{{ .Title }} – {{ .Site.Title }}</title>
|
||||||
{{ with .OutputFormats.Get "html" }}<link rel="canonical" href="{{ .Permalink }}">{{ end }}
|
{{ with .OutputFormats.Get "html" }}<link rel="canonical" href="{{ .Permalink }}">{{ end }}
|
||||||
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
|
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1">
|
||||||
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }}">
|
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }}">
|
||||||
<meta name="author" content="{{ .Site.Author.name }}">
|
<meta name="author" content="{{ .Site.Author.name }}">
|
||||||
{{ partial "head/open-graph" . }}
|
{{ partial "head/open-graph" . }}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{{/* Default image */}}
|
{{/* Default image */}}
|
||||||
{{- $defaultImagePath := (path.Join "content" $.Site.Params.defaultimage) }}
|
{{- $defaultImagePath := (path.Join "content" $.Site.Params.defaultimage) }}
|
||||||
{{ $.Scratch.Set "defaultImage_url" (replace $defaultImagePath "content/" $.Site.BaseURL) }}
|
{{ $.Scratch.Set "defaultImage_url" (replace $defaultImagePath "content/" "") }}
|
||||||
{{ with (imageConfig $defaultImagePath) }}
|
{{ with (imageConfig $defaultImagePath) }}
|
||||||
{{- $.Scratch.Set "defaultImage_width" .Width }}
|
{{- $.Scratch.Set "defaultImage_width" .Width }}
|
||||||
{{- $.Scratch.Set "defaultImage_height" .Height }}
|
{{- $.Scratch.Set "defaultImage_height" .Height }}
|
||||||
@@ -10,13 +10,13 @@
|
|||||||
{{- with .Params.image }}
|
{{- with .Params.image }}
|
||||||
{{- $imagePath := (path.Join "content" $.File.Dir "images/" .) }}
|
{{- $imagePath := (path.Join "content" $.File.Dir "images/" .) }}
|
||||||
|
|
||||||
{{- $.Scratch.Set "socialImage_url" (replace $imagePath "content/" $.Site.BaseURL) }}
|
{{- $.Scratch.Set "socialImage_url" (replace $imagePath "content/" "") }}
|
||||||
{{- with (imageConfig $imagePath) }}
|
{{- with (imageConfig $imagePath) }}
|
||||||
{{- $.Scratch.Set "socialImage_width" .Width }}
|
{{- $.Scratch.Set "socialImage_width" .Width }}
|
||||||
{{- $.Scratch.Set "socialImage_height" .Height }}
|
{{- $.Scratch.Set "socialImage_height" .Height }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{- $.Scratch.Set "socialImage_url" (replace $defaultImagePath "content/" $.Site.BaseURL) }}
|
{{- $.Scratch.Set "socialImage_url" (replace $defaultImagePath "content/" "") }}
|
||||||
{{- with (imageConfig $defaultImagePath) }}
|
{{- with (imageConfig $defaultImagePath) }}
|
||||||
{{- $.Scratch.Set "socialImage_width" .Width }}
|
{{- $.Scratch.Set "socialImage_width" .Width }}
|
||||||
{{- $.Scratch.Set "socialImage_height" .Height }}
|
{{- $.Scratch.Set "socialImage_height" .Height }}
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
{{/* Site logo */}}
|
{{/* Site logo */}}
|
||||||
{{- $logoImagePath := (path.Join "content" "logo.png") }}
|
{{- $logoImagePath := (path.Join "content" "logo.png") }}
|
||||||
{{ $.Scratch.Set "logoImage_url" (replace $logoImagePath "content/" $.Site.BaseURL) }}
|
{{ $.Scratch.Set "logoImage_url" (replace $logoImagePath "content/" "") }}
|
||||||
{{ with (imageConfig $logoImagePath) }}
|
{{ with (imageConfig $logoImagePath) }}
|
||||||
{{- $.Scratch.Set "logoImage_width" .Width }}
|
{{- $.Scratch.Set "logoImage_width" .Width }}
|
||||||
{{- $.Scratch.Set "logoImage_height" .Height }}
|
{{- $.Scratch.Set "logoImage_height" .Height }}
|
@@ -1,5 +1,5 @@
|
|||||||
{{ partial "head/meta" . -}}
|
{{ partial "head/meta" . -}}
|
||||||
{{ partial "head/social-images" . -}}
|
{{ partial "functions/social-images" . -}}
|
||||||
{{ partial "head/open-graph" . -}}
|
{{ partial "head/open-graph" . -}}
|
||||||
{{ partialCached "head/mobile" . -}}
|
{{ partialCached "head/mobile" . -}}
|
||||||
{{ partialCached "head/preload" . -}}
|
{{ partialCached "head/preload" . -}}
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
<meta property="og:url" content="{{ .Permalink }}">
|
<meta property="og:url" content="{{ .Permalink }}">
|
||||||
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }}">
|
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }}">
|
||||||
|
|
||||||
<meta property="og:image" content="{{ .Scratch.Get "socialImage_url" }}">
|
<meta property="og:image" content="{{ .Scratch.Get "socialImage_url" | absURL }}">
|
||||||
<meta property="og:image:width" content="{{ .Scratch.Get "socialImage_width" }}">
|
<meta property="og:image:width" content="{{ .Scratch.Get "socialImage_width" }}">
|
||||||
<meta property="og:image:height" content="{{ .Scratch.Get "socialImage_height" }}">
|
<meta property="og:image:height" content="{{ .Scratch.Get "socialImage_height" }}">
|
||||||
<meta property="og:image:alt" content="{{ .Title }}">
|
<meta property="og:image:alt" content="{{ .Title }}">
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
"description": {{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }},
|
"description": {{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }},
|
||||||
"wordCount": "{{ .WordCount }}",
|
"wordCount": "{{ .WordCount }}",
|
||||||
"author": {
|
"author": {
|
||||||
"@id": {{ printf "%s%s" .Site.BaseURL "#author" }}
|
"@id": {{ path.Join $.Site.BaseURL "#author" }}
|
||||||
},
|
},
|
||||||
"publisher": {
|
"publisher": {
|
||||||
"@type": "Organization",
|
"@type": "Organization",
|
||||||
@@ -20,14 +20,14 @@
|
|||||||
"url": {{ .Site.BaseURL }},
|
"url": {{ .Site.BaseURL }},
|
||||||
"logo": {
|
"logo": {
|
||||||
"@type": "ImageObject",
|
"@type": "ImageObject",
|
||||||
"url": {{ .Scratch.Get "logoImage_url" }},
|
"url": {{ .Scratch.Get "logoImage_url" | absURL }},
|
||||||
"width": "{{ .Scratch.Get "logoImage_width" }}",
|
"width": "{{ .Scratch.Get "logoImage_width" }}",
|
||||||
"height": "{{ .Scratch.Get "logoImage_height" }}"
|
"height": "{{ .Scratch.Get "logoImage_height" }}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"image": {
|
"image": {
|
||||||
"@type": "ImageObject",
|
"@type": "ImageObject",
|
||||||
"url": {{ .Scratch.Get "socialImage_url" }},
|
"url": {{ .Scratch.Get "socialImage_url" | absURL }},
|
||||||
"width": "{{ .Scratch.Get "socialImage_width" }}",
|
"width": "{{ .Scratch.Get "socialImage_width" }}",
|
||||||
"height": "{{ .Scratch.Get "socialImage_height" }}"
|
"height": "{{ .Scratch.Get "socialImage_height" }}"
|
||||||
}
|
}
|
||||||
|
@@ -3,14 +3,14 @@
|
|||||||
{
|
{
|
||||||
"@context": "http://schema.org",
|
"@context": "http://schema.org",
|
||||||
"@type": "Person",
|
"@type": "Person",
|
||||||
"@id": {{ printf "%s%s" $.Site.BaseURL "#author" }},
|
"@id": {{ path.Join $.Site.BaseURL "#author" }},
|
||||||
"name": {{ $.Site.Author.name }},
|
"name": {{ $.Site.Author.name }},
|
||||||
"url": {{ $.Site.BaseURL }},
|
"url": {{ $.Site.BaseURL }},
|
||||||
"description": {{ $.Site.Params.description }},
|
"description": {{ $.Site.Params.description }},
|
||||||
{{ with .jobtitle }}"jobTitle": {{ . }},{{ end }}
|
{{ with .jobtitle }}"jobTitle": {{ . }},{{ end }}
|
||||||
"image": {
|
"image": {
|
||||||
"@type": "ImageObject",
|
"@type": "ImageObject",
|
||||||
"url": {{ $.Scratch.Get "defaultImage_url" }},
|
"url": {{ $.Scratch.Get "defaultImage_url" | absURL }},
|
||||||
"width": "{{ $.Scratch.Get "defaultImage_width" }}",
|
"width": "{{ $.Scratch.Get "defaultImage_width" }}",
|
||||||
"height": "{{ $.Scratch.Get "defaultImage_height" }}"
|
"height": "{{ $.Scratch.Get "defaultImage_height" }}"
|
||||||
},
|
},
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
"cross-env": "^7.0.0",
|
"cross-env": "^7.0.0",
|
||||||
"get-folder-size": "^2.0.1",
|
"get-folder-size": "^2.0.1",
|
||||||
"html-minifier": "^4.0.0",
|
"html-minifier": "^4.0.0",
|
||||||
"hugo-extended": "git+https://github.com/jakejarvis/hugo-extended.git#master",
|
"hugo-extended": "git+https://github.com/jakejarvis/hugo-extended.git",
|
||||||
"imagemin-cli": "^5.1.0",
|
"imagemin-cli": "^5.1.0",
|
||||||
"imagemin-gifsicle": "^7.0.0",
|
"imagemin-gifsicle": "^7.0.0",
|
||||||
"imagemin-jpegoptim": "^6.0.0",
|
"imagemin-jpegoptim": "^6.0.0",
|
||||||
|
@@ -2310,7 +2310,7 @@ https-proxy-agent@^4.0.0:
|
|||||||
agent-base "5"
|
agent-base "5"
|
||||||
debug "4"
|
debug "4"
|
||||||
|
|
||||||
"hugo-extended@git+https://github.com/jakejarvis/hugo-extended.git#master":
|
"hugo-extended@git+https://github.com/jakejarvis/hugo-extended.git":
|
||||||
version "0.63.2"
|
version "0.63.2"
|
||||||
resolved "git+https://github.com/jakejarvis/hugo-extended.git#f6b20c2deeabdc9d45f49ee9cfa3f8d7c704737a"
|
resolved "git+https://github.com/jakejarvis/hugo-extended.git#f6b20c2deeabdc9d45f49ee9cfa3f8d7c704737a"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
Reference in New Issue
Block a user