feat: update for netlify dev support
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
<meta name="theme-color" content="{{ $.Site.Params.themeColor }}">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ "apple-touch-icon.png" | absURL }}">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{{ "favicon-32x32.png" | absURL }}">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ "favicon-16x16.png" | absURL }}">
|
||||
<link rel="manifest" href="{{ "site.webmanifest" | absURL }}">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ "apple-touch-icon.png" | relURL }}">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{{ "favicon-32x32.png" | relURL }}">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ "favicon-16x16.png" | relURL }}">
|
||||
<link rel="manifest" href="{{ "site.webmanifest" | relURL }}">
|
@ -3,14 +3,14 @@
|
||||
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
|
||||
{{ if $.Scratch.Get "paginator" -}}
|
||||
{{ $paginator := .Paginate (where .Site.RegularPages.ByDate.Reverse "Section" "blog" ) -}}
|
||||
<meta property="og:url" content="{{ .Paginator.URL | absURL }}">
|
||||
<meta property="og:url" content="{{ .Paginator.URL | relURL }}">
|
||||
{{ else -}}
|
||||
<meta property="og:url" content="{{ .Permalink }}">
|
||||
<meta property="og:url" content="{{ .RelPermalink }}">
|
||||
{{ end -}}
|
||||
|
||||
{{ with $.Params.images -}}
|
||||
{{ range first 6 . -}}
|
||||
<meta property="og:image" content="{{ $.Permalink }}{{ . }}">
|
||||
<meta property="og:image" content="{{ $.RelPermalink }}{{ . }}">
|
||||
{{ end -}}
|
||||
{{ else -}}
|
||||
{{ $images := $.Resources.ByType "image" -}}
|
||||
@ -19,10 +19,10 @@
|
||||
{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}
|
||||
{{ end -}}
|
||||
{{ with $featured -}}
|
||||
<meta property="og:image" content="{{ $featured.Permalink }}"/>
|
||||
<meta property="og:image" content="{{ $featured.RelPermalink }}"/>
|
||||
{{ else -}}
|
||||
{{ with $.Site.Params.images -}}
|
||||
<meta property="og:image" content="{{ index . 0 | absURL }}"/>
|
||||
<meta property="og:image" content="{{ index . 0 | relURL }}"/>
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
@ -54,18 +54,18 @@
|
||||
{{ end -}}
|
||||
{{ with .Params.videos -}}
|
||||
{{ range . -}}
|
||||
<meta property="og:video" content="{{ . | absURL }}">
|
||||
<meta property="og:video" content="{{ . | relURL }}">
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ $permalink := .Permalink -}}
|
||||
{{ $RelPermalink := .RelPermalink -}}
|
||||
{{ $siteSeries := .Site.Taxonomies.series -}}
|
||||
{{ with .Params.series -}}
|
||||
{{ range $name := . -}}
|
||||
{{ $series := index $siteSeries $name -}}
|
||||
{{ range $page := first 6 $series.Pages -}}
|
||||
{{ if ne $page.Permalink $permalink -}}
|
||||
<meta property="og:see_also" content="{{ $page.Permalink }}">
|
||||
{{ if ne $page.RelPermalink $RelPermalink -}}
|
||||
<meta property="og:see_also" content="{{ $page.RelPermalink }}">
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
@ -1,6 +1,6 @@
|
||||
<link rel="preload" as="font" href="{{ "fonts/vendor/jost/jost-v4-latin-regular.woff2" | absURL }}" type="font/woff2" crossorigin>
|
||||
<link rel="preload" as="font" href="{{ "fonts/vendor/jost/jost-v4-latin-700.woff2" | absURL }}" type="font/woff2" crossorigin>
|
||||
<link rel="preload" as="font" href="{{ "fonts/vendor/jost/jost-v4-latin-regular.woff2" | relURL }}" type="font/woff2" crossorigin>
|
||||
<link rel="preload" as="font" href="{{ "fonts/vendor/jost/jost-v4-latin-700.woff2" | relURL }}" type="font/woff2" crossorigin>
|
||||
{{ if .Site.Params.options.kaTex -}}
|
||||
<link rel="preload" as="font" href="{{ "fonts/KaTeX_Main-Regular.woff2" | absURL }}" type="font/woff2" crossorigin>
|
||||
<link rel="preload" as="font" href="{{ "fonts/KaTeX_Math-Italic.woff2" | absURL }}" type="font/woff2" crossorigin>
|
||||
<link rel="preload" as="font" href="{{ "fonts/KaTeX_Main-Regular.woff2" | relURL }}" type="font/woff2" crossorigin>
|
||||
<link rel="preload" as="font" href="{{ "fonts/KaTeX_Math-Italic.woff2" | relURL }}" type="font/woff2" crossorigin>
|
||||
{{ end -}}
|
@ -23,15 +23,15 @@
|
||||
{{ end -}}
|
||||
|
||||
{{ if $.Scratch.Get "paginator" }}
|
||||
<link rel="canonical" href="{{ .Paginator.URL | absURL }}">
|
||||
<link rel="canonical" href="{{ .Paginator.URL | relURL }}">
|
||||
{{ if .Paginator.HasPrev -}}
|
||||
<link rel="prev" href="{{ .Paginator.Prev.URL | absURL }}">
|
||||
<link rel="prev" href="{{ .Paginator.Prev.URL | relURL }}">
|
||||
{{ end -}}
|
||||
{{ if .Paginator.HasNext -}}
|
||||
<link rel="next" href="{{ .Paginator.Next.URL | absURL }}">
|
||||
<link rel="next" href="{{ .Paginator.Next.URL | relURL }}">
|
||||
{{ end -}}
|
||||
{{ else -}}
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
<link rel="canonical" href="{{ .RelPermalink }}">
|
||||
{{ end -}}
|
||||
|
||||
{{ partial "head/twitter_cards.html" . }}
|
||||
@ -44,7 +44,7 @@
|
||||
<meta property="og:locale" content="{{ .Site.Params.ogLocale }}">
|
||||
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
|
||||
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .RelPermalink | safeURL }}">
|
||||
{{ end -}}
|
||||
|
||||
{{ partial "head/structured-data.html" . }}
|
||||
|
@ -4,9 +4,9 @@
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Organization",
|
||||
"url": "{{ "/" | absURL }}",
|
||||
"url": "{{ "/" | relURL }}",
|
||||
"name": "{{ .Site.Params.title }}",
|
||||
"logo": "{{ "/" | absURL }}{{ .Site.Params.schemaLogo }}",
|
||||
"logo": "{{ "/" | relURL }}{{ .Site.Params.schemaLogo }}",
|
||||
"sameAs": [
|
||||
"{{ .Site.Params.schemaTwitter | safeURL }}",
|
||||
"{{ .Site.Params.schemaLinkedIn | safeURL }}",
|
||||
@ -20,7 +20,7 @@
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Person",
|
||||
"url": "{{ "/" | absURL }}",
|
||||
"url": "{{ "/" | relURL }}",
|
||||
"name": "{{ .Site.Params.title }}",
|
||||
"sameAs": [
|
||||
"{{ .Site.Params.schemaTwitter | safeURL }}",
|
||||
@ -35,10 +35,10 @@
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "WebSite",
|
||||
"url": "{{ "/" | absURL }}",
|
||||
"url": "{{ "/" | relURL }}",
|
||||
"potentialAction": {
|
||||
"@type": "SearchAction",
|
||||
"target": "{{ "/" | absURL }}?q={search_term_string}",
|
||||
"target": "{{ "/" | relURL }}?q={search_term_string}",
|
||||
"query-input": "required name=search_term_string"
|
||||
}
|
||||
}
|
||||
@ -53,10 +53,10 @@
|
||||
"@type": "Article",
|
||||
"mainEntityOfPage": {
|
||||
"@type": "WebPage",
|
||||
"@id": "{{ .Permalink }}"
|
||||
"@id": "{{ .RelPermalink }}"
|
||||
},
|
||||
"headline": "{{ .Title }}",
|
||||
"image": [{{ range $i, $e := .Params.images }}{{ if $i }}, {{ end }}{{ printf "%s%s" $.Permalink $e }}{{ end }}],
|
||||
"image": [{{ range $i, $e := .Params.images }}{{ if $i }}, {{ end }}{{ printf "%s%s" $.RelPermalink $e }}{{ end }}],
|
||||
"datePublished": "{{ .PublishDate.Format "2006-01-02T15:04:05CET" }}",
|
||||
"dateModified": "{{ .Lastmod.Format "2006-01-02T15:04:05CET" }}",
|
||||
"author": {
|
||||
@ -69,7 +69,7 @@
|
||||
{{ if eq .Site.Params.schemaType "Organization" -}}
|
||||
"logo": {
|
||||
"@type": "ImageObject",
|
||||
"url": "{{ "/" | absURL }}{{ .Site.Params.schemaLogo }}"
|
||||
"url": "{{ "/" | relURL }}{{ .Site.Params.schemaLogo }}"
|
||||
}
|
||||
{{ end -}}
|
||||
},
|
||||
@ -83,7 +83,7 @@
|
||||
{{ $dot.Scratch.Set "path" "" -}}
|
||||
{{ $dot.Scratch.Set "breadcrumb" slice -}}
|
||||
|
||||
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" -}}
|
||||
{{ $url := replace .RelPermalink ( printf "%s" .Site.BaseURL) "" -}}
|
||||
{{ $.Scratch.Add "path" .Site.BaseURL -}}
|
||||
|
||||
{{ $.Scratch.Add "breadcrumb" (slice (dict "url" .Site.BaseURL "name" "home" "position" 1 )) -}}
|
||||
|
@ -1,11 +1,11 @@
|
||||
{{ if eq (hugo.Environment) "development" -}}
|
||||
{{ $options := (dict "targetPath" "main.css" "enableSourceMap" true "includePaths" (slice "node_modules")) -}}
|
||||
{{ $css := resources.Get "scss/app.scss" | toCSS $options -}}
|
||||
<link rel="stylesheet" href="{{ $css.Permalink }}">
|
||||
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
|
||||
{{ else -}}
|
||||
{{ $options := (dict "targetPath" "main.css" "outputStyle" "compressed" "includePaths" (slice "node_modules")) -}}
|
||||
{{ $css := resources.Get "scss/app.scss" | toCSS $options | postCSS (dict "config" "config/postcss.config.js") -}}
|
||||
{{ $secureCSS := $css | resources.Fingerprint "sha512" -}}
|
||||
<link rel="stylesheet" href="{{ $secureCSS.Permalink }}" integrity="{{ $secureCSS.Data.Integrity }}" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="{{ $secureCSS.RelPermalink }}" integrity="{{ $secureCSS.Data.Integrity }}" crossorigin="anonymous">
|
||||
{{ end -}}
|
||||
<noscript><style>img.lazyload { display: none; }</style></noscript>
|
@ -1,6 +1,6 @@
|
||||
{{ with $.Params.images -}}
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:image" content="{{ $.Permalink }}{{ index . 0 }}">
|
||||
<meta name="twitter:image" content="{{ $.RelPermalink }}{{ index . 0 }}">
|
||||
{{ else -}}
|
||||
{{ $images := $.Resources.ByType "image" -}}
|
||||
{{ $featured := $images.GetMatch "*feature*" -}}
|
||||
@ -9,11 +9,11 @@
|
||||
{{ end -}}
|
||||
{{ with $featured -}}
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:image" content="{{ $featured.Permalink }}">
|
||||
<meta name="twitter:image" content="{{ $featured.RelPermalink }}">
|
||||
{{ else -}}
|
||||
{{ with $.Site.Params.images -}}
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:image" content="{{ index . 0 | absURL }}">
|
||||
<meta name="twitter:image" content="{{ index . 0 | relURL }}">
|
||||
{{ else -}}
|
||||
<meta name="twitter:card" content="summary">
|
||||
{{ end -}}
|
||||
|
Reference in New Issue
Block a user