feat: update for netlify dev support
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
<div class="col-lg-8 order-first order-lg-last text-lg-end">
|
||||
<ul class="list-inline">
|
||||
{{ range .Site.Menus.footer -}}
|
||||
<li class="list-inline-item"><a href="{{ .URL | absURL }}">{{ .Name }}</a></li>
|
||||
<li class="list-inline-item"><a href="{{ .URL | relURL }}">{{ .Name }}</a></li>
|
||||
{{ end -}}
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -53,18 +53,18 @@
|
||||
|
||||
{{ if eq (hugo.Environment) "development" -}}
|
||||
{{ if .Site.Params.options.bootStrapJs -}}
|
||||
<script src="{{ $bs.Permalink }}" defer></script>
|
||||
<script src="{{ $bs.RelPermalink }}" defer></script>
|
||||
{{ end -}}
|
||||
{{ if .Site.Params.options.highLight -}}
|
||||
<script src="{{ $highlight.Permalink }}" defer></script>
|
||||
<script src="{{ $highlight.RelPermalink }}" defer></script>
|
||||
{{ end -}}
|
||||
{{ if .Site.Params.options.kaTex -}}
|
||||
<script src="{{ $katex.Permalink }}" defer></script>
|
||||
<script src="{{ $katexAutoRender.Permalink }}" onload="renderMathInElement(document.body);" defer></script>
|
||||
<script src="{{ $katex.RelPermalink }}" defer></script>
|
||||
<script src="{{ $katexAutoRender.RelPermalink }}" onload="renderMathInElement(document.body);" defer></script>
|
||||
{{ end -}}
|
||||
<script src="{{ $js.Permalink }}" defer></script>
|
||||
<script src="{{ $js.RelPermalink }}" defer></script>
|
||||
{{ if .Site.Params.options.flexSearch -}}
|
||||
<script src="{{ $index.Permalink }}" defer></script>
|
||||
<script src="{{ $index.RelPermalink }}" defer></script>
|
||||
{{ end -}}
|
||||
{{ else -}}
|
||||
{{ $js := $js | minify | fingerprint "sha512" -}}
|
||||
@ -74,17 +74,17 @@
|
||||
{{ $katex := $katex | minify | fingerprint "sha512" -}}
|
||||
{{ $katexAutoRender := $katexAutoRender | minify | fingerprint "sha512" -}}
|
||||
{{ if .Site.Params.options.bootStrapJs -}}
|
||||
<script src="{{ $bs.Permalink }}" integrity="{{ $bs.Data.Integrity }}" crossorigin="anonymous" defer></script>
|
||||
<script src="{{ $bs.RelPermalink }}" integrity="{{ $bs.Data.Integrity }}" crossorigin="anonymous" defer></script>
|
||||
{{ end -}}
|
||||
{{ if .Site.Params.options.highLight -}}
|
||||
<script src="{{ $highlight.Permalink }}" integrity="{{ $highlight.Data.Integrity }}" crossorigin="anonymous" defer></script>
|
||||
<script src="{{ $highlight.RelPermalink }}" integrity="{{ $highlight.Data.Integrity }}" crossorigin="anonymous" defer></script>
|
||||
{{ end -}}
|
||||
{{ if .Site.Params.options.kaTex -}}
|
||||
<script src="{{ $katex.Permalink }}" integrity="{{ $katex.Data.Integrity }}" crossorigin="anonymous" defer></script>
|
||||
<script src="{{ $katexAutoRender.Permalink }}" integrity="{{ $katexAutoRender.Data.Integrity }}" crossorigin="anonymous" defer></script>
|
||||
<script src="{{ $katex.RelPermalink }}" integrity="{{ $katex.Data.Integrity }}" crossorigin="anonymous" defer></script>
|
||||
<script src="{{ $katexAutoRender.RelPermalink }}" integrity="{{ $katexAutoRender.Data.Integrity }}" crossorigin="anonymous" defer></script>
|
||||
{{ end -}}
|
||||
<script src="{{ $js.Permalink }}" integrity="{{ $js.Data.Integrity }}" crossorigin="anonymous" defer></script>
|
||||
<script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}" crossorigin="anonymous" defer></script>
|
||||
{{ if .Site.Params.options.flexSearch -}}
|
||||
<script src="{{ $index.Permalink }}" integrity="{{ $index.Data.Integrity }}" crossorigin="anonymous" defer></script>
|
||||
<script src="{{ $index.RelPermalink }}" integrity="{{ $index.Data.Integrity }}" crossorigin="anonymous" defer></script>
|
||||
{{ end -}}
|
||||
{{ end -}}
|
@ -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 -}}
|
||||
|
@ -3,7 +3,7 @@
|
||||
<div class="container">
|
||||
<input class="menu-btn order-0" type="checkbox" id="menu-btn">
|
||||
<label class="menu-icon d-md-none" for="menu-btn"><span class="navicon"></span></label>
|
||||
<a class="navbar-brand order-1 order-md-0 me-auto" href="{{ .Site.BaseURL | absURL }}">{{ .Site.Params.Title }}</a>
|
||||
<a class="navbar-brand order-1 order-md-0 me-auto" href="{{ "/" | relURL }}">{{ .Site.Params.Title }}</a>
|
||||
{{ if .Site.Params.options.darkMode -}}
|
||||
<button id="mode" class="btn btn-link order-2 order-md-4" type="button" aria-label="Toggle mode">
|
||||
<span class="toggle-dark"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-moon"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg></span>
|
||||
@ -13,7 +13,7 @@
|
||||
<ul class="navbar-nav social-nav order-3 order-md-5">
|
||||
{{ range .Site.Menus.social -}}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ .URL | absURL }}">{{ .Pre | safeHTML }}<span class="ms-2 visually-hidden">{{ .Name | safeHTML }}</span></a>
|
||||
<a class="nav-link" href="{{ .URL | relURL }}">{{ .Pre | safeHTML }}<span class="ms-2 visually-hidden">{{ .Name | safeHTML }}</span></a>
|
||||
</li>
|
||||
{{ end -}}
|
||||
</ul>
|
||||
@ -27,7 +27,7 @@
|
||||
{{- $active = or $active (and (eq .Name "Guides") (eq $current.Section "guides")) -}}
|
||||
{{- $active = or $active (and (eq .Name "Blog") (eq $current.Section "blog" "authors")) -}}
|
||||
<li class="nav-item{{ if $active }} active{{ end }}">
|
||||
<a class="nav-link" href="{{ .URL | absURL }}">{{ .Name }}</a>
|
||||
<a class="nav-link" href="{{ .URL | relURL }}">{{ .Name }}</a>
|
||||
</li>
|
||||
{{ end -}}
|
||||
</ul>
|
||||
|
@ -1 +1 @@
|
||||
<p><small>Posted {{ .PublishDate.Format "January 2, 2006" }} by {{ if .Params.contributors -}}{{ range $index, $contributor := .Params.contributors }}{{ if gt $index 0 }} and {{ end }}<a class="stretched-link position-relative" href="{{ "/contributors/" | absURL }}{{ . | urlize }}/">{{ . }}</a>{{ end -}}{{ end -}} ‐ <strong>{{ .ReadingTime -}} min read</strong></small><p>
|
||||
<p><small>Posted {{ .PublishDate.Format "January 2, 2006" }} by {{ if .Params.contributors -}}{{ range $index, $contributor := .Params.contributors }}{{ if gt $index 0 }} and {{ end }}<a class="stretched-link position-relative" href="{{ "/contributors/" | relURL }}{{ . | urlize }}/">{{ . }}</a>{{ end -}}{{ end -}} ‐ <strong>{{ .ReadingTime -}} min read</strong></small><p>
|
@ -1,4 +1,4 @@
|
||||
{{ with .Parent -}}
|
||||
{{ partial "main/breadcrumb.html" . -}}
|
||||
<li class="breadcrumb-item"><a href="{{ .Permalink }}">{{ if .IsHome }}Home{{ else }}{{ .Title }}{{ end }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ .RelPermalink }}">{{ if .IsHome }}Home{{ else }}{{ .Title }}{{ end }}</a></li>
|
||||
{{ end -}}
|
@ -3,7 +3,7 @@
|
||||
<!-- https://www.feliciano.tech/blog/custom-sort-hugo-single-pages/ -->
|
||||
{{ $pages := where site.RegularPages "Section" .Section -}}
|
||||
{{ with $pages.Next . -}}
|
||||
<a href="{{ .Permalink }}">
|
||||
<a href="{{ .RelPermalink }}">
|
||||
<div class="card my-1">
|
||||
<div class="card-body py-2">
|
||||
← {{ .Title }}
|
||||
@ -12,7 +12,7 @@
|
||||
</a>
|
||||
{{ end -}}
|
||||
{{ with $pages.Prev . -}}
|
||||
<a class="ms-auto" href="{{ .Permalink }}">
|
||||
<a class="ms-auto" href="{{ .RelPermalink }}">
|
||||
<div class="card my-1">
|
||||
<div class="card-body py-2">
|
||||
{{ .Title }} →
|
||||
|
@ -6,7 +6,7 @@
|
||||
{{ range .Children -}}
|
||||
{{- $active := or ($currentPage.IsMenuCurrent "docs" .) ($currentPage.HasMenuCurrent "docs" .) -}}
|
||||
{{- $active = or $active (eq $currentPage.Section .Identifier) -}}
|
||||
<li><a class="docs-link{{ if $active }} active{{ end }}" href="{{ .URL | absURL }}">{{ .Name }}</a></li>
|
||||
<li><a class="docs-link{{ if $active }} active{{ end }}" href="{{ .URL | relURL }}">{{ .Name }}</a></li>
|
||||
{{ end -}}
|
||||
</ul>
|
||||
{{ end -}}
|
||||
|
Reference in New Issue
Block a user