mirror of
https://github.com/13hannes11/hugo-coder-timeline.git
synced 2024-09-04 00:50:58 +02:00
Merge branch 'luizdepra-m'
This commit is contained in:
@@ -1,154 +1,71 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.Language.Lang }}">
|
||||
{{ partial "head.html" . }}
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="Content-Language" content="{{ .Site.Language.Lang }}">
|
||||
{{ if .Site.Params.csp }}
|
||||
{{ partial "csp.html" . }}
|
||||
{{ end }}
|
||||
{{ $csClass := "colorscheme-light" }}
|
||||
{{ if eq .Site.Params.colorScheme "dark" }}
|
||||
{{ $csClass = "colorscheme-dark" }}
|
||||
{{ else if eq .Site.Params.colorScheme "auto" }}
|
||||
{{ $csClass = "colorscheme-auto" }}
|
||||
{{ end }}
|
||||
|
||||
{{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
|
||||
<meta name="description" content="{{ .Description | default (.Summary | default .Site.Params.description ) }}">
|
||||
<meta name="keywords" content="{{ (delimit .Keywords ",") | default .Site.Params.keywords }}">
|
||||
<body class="preload-transitions {{ $csClass }}{{ if .Site.Params.rtl }} rtl{{ end }}">
|
||||
{{ partial "float" . }}
|
||||
<main class="wrapper">
|
||||
{{ partial "header.html" . }}
|
||||
|
||||
{{ template "_internal/twitter_cards.html" . }}
|
||||
{{ template "_internal/opengraph.html" . }}
|
||||
<div class="content">
|
||||
{{ block "content" . }}{{ end }}
|
||||
</div>
|
||||
|
||||
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
|
||||
{{ partial "footer.html" . }}
|
||||
</main>
|
||||
|
||||
{{ if .Permalink }}
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
{{ end }}
|
||||
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||
<link href="https://fonts.googleapis.com/css?family=Lato:400,700%7CMerriweather:300,700%7CSource+Code+Pro:400,700&display=swap" rel="stylesheet">
|
||||
<link rel="preload" href="/fonts/forkawesome-webfont.woff2?v=1.1.7" as="font" type="font/woff2" crossorigin>
|
||||
|
||||
{{ if .Site.IsServer }}
|
||||
{{ $cssOpts := (dict "targetPath" "css/coder.css" "enableSourceMap" true ) }}
|
||||
{{ $styles := resources.Get "scss/coder.scss" | resources.ExecuteAsTemplate "style.coder.css" . | toCSS $cssOpts }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
|
||||
{{ else }}
|
||||
{{ $cssOpts := (dict "targetPath" "css/coder.css" ) }}
|
||||
{{ $styles := resources.Get "scss/coder.scss" | resources.ExecuteAsTemplate "style.coder.css" . | toCSS $cssOpts | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.rtl }}
|
||||
{{ if .Site.IsServer }}
|
||||
{{ $cssOpts := (dict "targetPath" "css/coder-rtl.css" "enableSourceMap" true ) }}
|
||||
{{ $styles := resources.Get "scss/coder-rtl.scss" | resources.ExecuteAsTemplate "style.coder-rtl.css" . | toCSS $cssOpts }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
|
||||
{{ else }}
|
||||
{{ $cssOpts := (dict "targetPath" "css/coder-rtl.css" ) }}
|
||||
{{ $styles := resources.Get "scss/coder-rtl.scss" | resources.ExecuteAsTemplate "style.coder-rtl.css" . | toCSS $cssOpts | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if or (eq .Site.Params.colorScheme "auto") (eq .Site.Params.colorScheme "dark") }}
|
||||
{{ if .Site.IsServer }}
|
||||
{{ $cssOpts := (dict "targetPath" "css/coder-dark.css" "enableSourceMap" true ) }}
|
||||
{{ $styles := resources.Get "scss/coder-dark.scss" | resources.ExecuteAsTemplate "style.coder-dark.css" . | toCSS $cssOpts }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
|
||||
{{ else }}
|
||||
{{ $cssOpts := (dict "targetPath" "css/coder-dark.css" ) }}
|
||||
{{ $styles := resources.Get "scss/coder-dark.scss" | resources.ExecuteAsTemplate "style.coder-dark.css" . | toCSS $cssOpts | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ range .Site.Params.customCSS }}
|
||||
<link rel="stylesheet" href="{{ . | relURL }}" />
|
||||
{{ end }}
|
||||
|
||||
{{ range .Site.Params.customSCSS }}
|
||||
{{/* We don't change the targetPath to because it's transparent to users */}}
|
||||
{{ if $.Site.IsServer }}
|
||||
{{ $cssOpts := (dict "enableSourceMap" true ) }}
|
||||
{{ $styles := resources.Get . | toCSS $cssOpts }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
|
||||
{{ else }}
|
||||
{{ $styles := resources.Get . | toCSS | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<link rel="icon" type="image/png" href="{{ .Site.Params.favicon_32 | default "/images/favicon-32x32.png" | relURL }}" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="{{ .Site.Params.favicon_16 | default "/images/favicon-16x16.png" | relURL }}" sizes="16x16">
|
||||
|
||||
<link rel="apple-touch-icon" href="{{ .Site.Params.touchicon | default "/images/apple-touch-icon.png" | relURL }}">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ .Site.Params.touchicon | default "/images/apple-touch-icon.png" | relURL }}">
|
||||
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
|
||||
{{ end -}}
|
||||
|
||||
{{ if .Site.Params.enableTwemoji }}
|
||||
<script defer src="https://twemoji.maxcdn.com/v/13.0.1/twemoji.min.js"
|
||||
integrity="sha384-5f4X0lBluNY/Ib4VhGx0Pf6iDCF99VGXJIyYy7dDLY5QlEd7Ap0hICSSZA1XYbc4" crossorigin="anonymous"></script>
|
||||
{{ end }}
|
||||
|
||||
{{ hugo.Generator }}
|
||||
</head>
|
||||
|
||||
{{ $csClass := "colorscheme-light" }}
|
||||
{{ if eq .Site.Params.colorScheme "dark" }}
|
||||
{{ $csClass = "colorscheme-dark" }}
|
||||
{{ else if eq .Site.Params.colorScheme "auto" }}
|
||||
{{ $csClass = "colorscheme-auto" }}
|
||||
{{ if .Site.IsServer }}
|
||||
{{ $script := resources.Get "js/coder.js" }}
|
||||
<script src="{{ $script.RelPermalink }}"></script>
|
||||
{{ else }}
|
||||
{{ $script := resources.Get "js/coder.js" | minify | fingerprint }}
|
||||
<script src="{{ $script.RelPermalink }}" integrity="{{ $script.Data.Integrity }}"></script>
|
||||
{{ end }}
|
||||
<body class="{{ $csClass }}{{ if .Site.Params.rtl }} rtl{{ end }}"
|
||||
onload="{{ if .Site.Params.enableTwemoji }} twemoji.parse(document.body); {{ end }}"
|
||||
>
|
||||
{{ partial "float" . }}
|
||||
<main class="wrapper">
|
||||
{{ partial "header.html" . }}
|
||||
|
||||
<div class="content">
|
||||
{{ block "content" . }}{{ end }}
|
||||
</div>
|
||||
{{ range .Site.Params.customJS }}
|
||||
{{ if $.Site.IsServer }}
|
||||
{{ $script := resources.Get . }}
|
||||
<script src="{{ $script.RelPermalink }}"></script>
|
||||
{{ else }}
|
||||
{{ $script := resources.Get . | minify | fingerprint }}
|
||||
<script src="{{ $script.RelPermalink }}" integrity="{{ $script.Data.Integrity }}"></script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "footer.html" . }}
|
||||
</main>
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
|
||||
{{ if not .Site.Params.hideColorSchemeToggle }}
|
||||
{{ if .Site.IsServer }}
|
||||
{{ $script := resources.Get "js/dark-mode.js" }}
|
||||
<script src="{{ $script.RelPermalink }}"></script>
|
||||
{{ else }}
|
||||
{{ $script := resources.Get "js/dark-mode.js" | minify | fingerprint }}
|
||||
<script src="{{ $script.RelPermalink }}"></script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if and .Site.Params.fathomAnalytics .Site.Params.fathomAnalytics.siteID }}
|
||||
{{- partial "analytics/fathom" . -}}
|
||||
{{ end }}
|
||||
|
||||
{{ range .Site.Params.customJS }}
|
||||
<script src="{{ . | relURL }}"></script>
|
||||
{{ end }}
|
||||
{{ if and .Site.Params.plausibleAnalytics .Site.Params.plausibleAnalytics.domain }}
|
||||
{{- partial "analytics/plausible" . -}}
|
||||
{{ end }}
|
||||
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
{{ if and .Site.Params.goatCounter .Site.Params.goatCounter.code }}
|
||||
{{- partial "analytics/goatcounter" . -}}
|
||||
{{ end }}
|
||||
|
||||
{{ if and .Site.Params.fathomAnalytics .Site.Params.fathomAnalytics.siteID }}
|
||||
{{- partial "analytics/fathom" . -}}
|
||||
{{ end }}
|
||||
{{ if and .Site.Params.cloudflare .Site.Params.cloudflare.token }}
|
||||
{{- partial "analytics/cloudflare" . -}}
|
||||
{{ end }}
|
||||
|
||||
{{ if and .Site.Params.plausibleAnalytics .Site.Params.plausibleAnalytics.domain }}
|
||||
{{- partial "analytics/plausible" . -}}
|
||||
{{ end }}
|
||||
{{ if and .Site.Params.matomo .Site.Params.matomo.serverURL }}
|
||||
{{- partial "analytics/matomo" . -}}
|
||||
{{ end }}
|
||||
|
||||
{{ if and .Site.Params.goatCounter .Site.Params.goatCounter.code }}
|
||||
{{- partial "analytics/goatcounter" . -}}
|
||||
{{ end }}
|
||||
{{ if and .Site.Params.googleTagManager .Site.Params.googleTagManager.id }}
|
||||
{{- partial "analytics/googletagmanager" . -}}
|
||||
{{ end }}
|
||||
|
||||
{{ if and .Site.Params.cloudflare .Site.Params.cloudflare.token }}
|
||||
{{- partial "analytics/cloudflare" . -}}
|
||||
{{ end }}
|
||||
|
||||
{{ if and .Site.Params.matomo .Site.Params.matomo.serverURL }}
|
||||
{{- partial "analytics/matomo" . -}}
|
||||
{{ end }}
|
||||
</body>
|
||||
{{- partial "body/extensions" . -}}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
{{ define "title" }}
|
||||
{{- if eq .Kind "term" -}}
|
||||
{{- i18n .Data.Singular | title -}}
|
||||
{{- i18n .Data.Plural 1 | title -}}
|
||||
{{- print ": " -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- .Title }} · {{ .Site.Title -}}
|
||||
{{- i18n (lower .Title) | default .Title | title }} · {{ .Site.Title -}}
|
||||
{{ end }}
|
||||
{{ define "content" }}
|
||||
{{ partial "list.html" . }}
|
||||
|
||||
10
layouts/_default/terms.html
Normal file
10
layouts/_default/terms.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{{ define "title" }}
|
||||
{{- if eq .Kind "term" -}}
|
||||
{{- i18n .Data.Plural | title -}}
|
||||
{{- print ": " -}}
|
||||
{{- end -}}
|
||||
{{- i18n (lower .Title) | default .Title | title }} · {{ .Site.Title -}}
|
||||
{{ end }}
|
||||
{{ define "content" }}
|
||||
{{ partial "terms.html" . }}
|
||||
{{ end }}
|
||||
9
layouts/partials/analytics/googletagmanager.html
Normal file
9
layouts/partials/analytics/googletagmanager.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ $.Site.Params.googleTagManager.id }}"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', '{{ $.Site.Params.googleTagManager.id }}');
|
||||
</script>
|
||||
5
layouts/partials/body/extensions.html
Normal file
5
layouts/partials/body/extensions.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{/*
|
||||
This extension point occurs just before the end of each page's <body> tag.
|
||||
|
||||
You can add further theme extensions or customizations here if needed.
|
||||
*/}}
|
||||
@@ -1 +1 @@
|
||||
{{ printf `<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests; block-all-mixed-content; default-src 'self'; child-src %s; font-src %s; form-action %s; frame-src %s; img-src %s; object-src %s; style-src %s; script-src %s; prefetch-src %s;">` (delimit .Site.Params.csp.childsrc " ") (delimit .Site.Params.csp.fontsrc " ") (delimit .Site.Params.csp.formaction " ") (delimit .Site.Params.csp.framesrc " ") (delimit .Site.Params.csp.imgsrc " ") (delimit .Site.Params.csp.objectsrc " ") (delimit .Site.Params.csp.stylesrc " ") (delimit .Site.Params.csp.scriptsrc " ") (delimit .Site.Params.csp.prefetchsrc " ") | safeHTML }}
|
||||
{{ printf `<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests; block-all-mixed-content; default-src 'self'; child-src %s; font-src %s; form-action %s; frame-src %s; img-src %s; object-src %s; style-src %s; script-src %s; prefetch-src %s; connect-src %s;">` (delimit .Site.Params.csp.childsrc " ") (delimit .Site.Params.csp.fontsrc " ") (delimit .Site.Params.csp.formaction " ") (delimit .Site.Params.csp.framesrc " ") (delimit .Site.Params.csp.imgsrc " ") (delimit .Site.Params.csp.objectsrc " ") (delimit .Site.Params.csp.stylesrc " ") (delimit .Site.Params.csp.scriptsrc " ") (delimit .Site.Params.csp.prefetchsrc " ") (delimit .Site.Params.csp.connectsrc " ") | safeHTML }}
|
||||
|
||||
23
layouts/partials/head.html
Normal file
23
layouts/partials/head.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<head>
|
||||
{{ partial "head/meta-tags.html" . }}
|
||||
|
||||
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
|
||||
|
||||
{{ if .Permalink }}
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
{{ end }}
|
||||
|
||||
{{ partialCached "head/theme-styles.html" . }}
|
||||
|
||||
{{ partialCached "head/color-scheme.html" . }}
|
||||
|
||||
{{ partialCached "head/custom-styles.html" . }}
|
||||
|
||||
{{ partialCached "head/custom-icons.html" . }}
|
||||
|
||||
{{ partialCached "head/alternative-output-formats.html" . }}
|
||||
|
||||
{{ partialCached "head/hugo-generator.html" . }}
|
||||
|
||||
{{ partial "head/extensions.html" . }}
|
||||
</head>
|
||||
3
layouts/partials/head/alternative-output-formats.html
Normal file
3
layouts/partials/head/alternative-output-formats.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
|
||||
{{ end -}}
|
||||
11
layouts/partials/head/color-scheme.html
Normal file
11
layouts/partials/head/color-scheme.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{{ if or (eq .Site.Params.colorScheme "auto") (eq .Site.Params.colorScheme "dark") }}
|
||||
{{ if .Site.IsServer }}
|
||||
{{ $cssOpts := (dict "targetPath" "css/coder-dark.css" "enableSourceMap" true ) }}
|
||||
{{ $styles := resources.Get "scss/coder-dark.scss" | resources.ExecuteAsTemplate "style.coder-dark.css" . | toCSS $cssOpts }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
|
||||
{{ else }}
|
||||
{{ $cssOpts := (dict "targetPath" "css/coder-dark.css" ) }}
|
||||
{{ $styles := resources.Get "scss/coder-dark.scss" | resources.ExecuteAsTemplate "style.coder-dark.css" . | toCSS $cssOpts | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
8
layouts/partials/head/custom-icons.html
Normal file
8
layouts/partials/head/custom-icons.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<link rel="icon" type="image/png" href="{{ .Site.Params.favicon_32 | default "/images/favicon-32x32.png" | relURL }}" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="{{ .Site.Params.favicon_16 | default "/images/favicon-16x16.png" | relURL }}" sizes="16x16">
|
||||
|
||||
<link rel="apple-touch-icon" href="{{ .Site.Params.touchicon | default "/images/apple-touch-icon.png" | relURL }}">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ .Site.Params.touchicon | default "/images/apple-touch-icon.png" | relURL }}">
|
||||
|
||||
<link rel="manifest" href="{{ .Site.Params.manifest | default "/site.webmanifest" | relURL }}">
|
||||
<link rel="mask-icon" href="{{ .Site.Params.mask_icon | default "/images/safari-pinned-tab.svg" | relURL }}" color="{{ .Site.Params.mask_icon_color | default "#5bbad5" }}">
|
||||
21
layouts/partials/head/custom-styles.html
Normal file
21
layouts/partials/head/custom-styles.html
Normal file
@@ -0,0 +1,21 @@
|
||||
{{ range .Site.Params.customCSS }}
|
||||
{{ if $.Site.IsServer }}
|
||||
{{ $styles := resources.Get . }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
|
||||
{{ else }}
|
||||
{{ $styles := resources.Get . | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ range .Site.Params.customSCSS }}
|
||||
{{/* We don't change the targetPath to because it's transparent to users */}}
|
||||
{{ if $.Site.IsServer }}
|
||||
{{ $cssOpts := (dict "enableSourceMap" true ) }}
|
||||
{{ $styles := resources.Get . | toCSS $cssOpts }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
|
||||
{{ else }}
|
||||
{{ $styles := resources.Get . | toCSS | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
4
layouts/partials/head/extensions.html
Normal file
4
layouts/partials/head/extensions.html
Normal file
@@ -0,0 +1,4 @@
|
||||
{{/*
|
||||
You can add further theme extensions or customizations here if they should
|
||||
appear in <head>.
|
||||
*/}}
|
||||
1
layouts/partials/head/hugo-generator.html
Normal file
1
layouts/partials/head/hugo-generator.html
Normal file
@@ -0,0 +1 @@
|
||||
{{ hugo.Generator }}
|
||||
15
layouts/partials/head/meta-tags.html
Normal file
15
layouts/partials/head/meta-tags.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="color-scheme" content="light dark">
|
||||
|
||||
{{ if .Site.Params.csp }}
|
||||
{{ partial "csp.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ with .Site.Params.author }}
|
||||
<meta name="author" content="{{ . }}">{{ end }}
|
||||
<meta name="description" content="{{ .Description | default (.Summary | default .Site.Params.description ) }}">
|
||||
<meta name="keywords" content="{{ (delimit .Keywords " ,") | default .Site.Params.keywords }}">
|
||||
|
||||
{{ template "_internal/twitter_cards.html" . }}
|
||||
{{ template "_internal/opengraph.html" . }}
|
||||
23
layouts/partials/head/theme-styles.html
Normal file
23
layouts/partials/head/theme-styles.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<link rel="preload" href="/fonts/forkawesome-webfont.woff2?v=1.2.0" as="font" type="font/woff2" crossorigin>
|
||||
|
||||
{{ if .Site.IsServer }}
|
||||
{{ $cssOpts := (dict "targetPath" "css/coder.css" "enableSourceMap" true ) }}
|
||||
{{ $styles := resources.Get "scss/coder.scss" | resources.ExecuteAsTemplate "style.coder.css" . | toCSS $cssOpts }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
|
||||
{{ else }}
|
||||
{{ $cssOpts := (dict "targetPath" "css/coder.css" ) }}
|
||||
{{ $styles := resources.Get "scss/coder.scss" | resources.ExecuteAsTemplate "style.coder.css" . | toCSS $cssOpts | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.rtl }}
|
||||
{{ if .Site.IsServer }}
|
||||
{{ $cssOpts := (dict "targetPath" "css/coder-rtl.css" "enableSourceMap" true ) }}
|
||||
{{ $styles := resources.Get "scss/coder-rtl.scss" | resources.ExecuteAsTemplate "style.coder-rtl.css" . | toCSS $cssOpts }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
|
||||
{{ else }}
|
||||
{{ $cssOpts := (dict "targetPath" "css/coder-rtl.css" ) }}
|
||||
{{ $styles := resources.Get "scss/coder-rtl.scss" | resources.ExecuteAsTemplate "style.coder-rtl.css" . | toCSS $cssOpts | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
@@ -12,7 +12,7 @@
|
||||
{{ with .Site.Menus.main}}
|
||||
{{ range sort . }}
|
||||
<li class="navigation-item">
|
||||
<a class="navigation-link" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
|
||||
<a class="navigation-link" href="{{ index (apply (slice .URL) (.Params.urlFunc | default "relLangURL") ".") 0 }}">{{ .Name }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
@@ -28,7 +28,7 @@
|
||||
{{ $node.Scratch.Set "separator" false }}
|
||||
{{ end }}
|
||||
<li class="navigation-item">
|
||||
<a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
|
||||
<a href="{{ .Permalink }}">{{ .Language.LanguageName | emojify }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
@@ -1,31 +1,9 @@
|
||||
<section class="container centered">
|
||||
<div class="about">
|
||||
{{ if and (isset .Site.Params "avatarurl") (not (isset .Site.Params "gravatar")) }}
|
||||
{{ with .Site.Params.avatarURL }}
|
||||
<div class="avatar"><img src="{{ . | relURL }}" alt="avatar"></div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ with .Site.Params.gravatar }}
|
||||
<div class="avatar"><img src="https://www.gravatar.com/avatar/{{md5 .}}?s=240&d=mp" alt="gravatar"></div>
|
||||
{{ end }}
|
||||
<h1>{{ .Site.Params.author }}</h1>
|
||||
<h2>{{ .Site.Params.info }}</h2>
|
||||
{{ with .Site.Params.social }}
|
||||
<ul>
|
||||
{{ range sort . "weight" }}
|
||||
{{ if .icon }}
|
||||
<li>
|
||||
<a href="{{ .url | safeURL }}" aria-label="{{ .name }}" {{ if .rel }}rel="{{ .rel }}"{{ end }} {{ if .target }}target="{{ .target }}"{{ end }} {{ if .type }}type="{{ .type }}"{{ end }}>
|
||||
<i class="{{ .icon }}" aria-hidden="true"></i>
|
||||
</a>
|
||||
</li>
|
||||
{{ else }}
|
||||
<li>
|
||||
<a href="{{ .url | safeURL }}" aria-label="{{ .name }}" {{ if .rel }}rel="{{ .rel }}"{{ end }} {{ if .target }}target="{{ .target }}"{{ end }}>{{ .name }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{ partialCached "home/avatar.html" . }}
|
||||
|
||||
{{ partialCached "home/author.html" . }}
|
||||
|
||||
{{ partialCached "home/social.html" . }}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
6
layouts/partials/home/author.html
Normal file
6
layouts/partials/home/author.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>{{ .Site.Params.author }}</h1>
|
||||
{{ if reflect.IsSlice .Site.Params.info }}
|
||||
<h2>{{ range .Site.Params.info }}{{.}}<br>{{ end}}</h2>
|
||||
{{ else }}
|
||||
<h2>{{ .Site.Params.info }}</h2>
|
||||
{{ end }}
|
||||
8
layouts/partials/home/avatar.html
Normal file
8
layouts/partials/home/avatar.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{{ if and (isset .Site.Params "avatarurl") (not (isset .Site.Params "gravatar")) }}
|
||||
{{ with .Site.Params.avatarURL }}
|
||||
<div class="avatar"><img src="{{ . | relURL }}" alt="avatar"></div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ with .Site.Params.gravatar }}
|
||||
<div class="avatar"><img src="https://www.gravatar.com/avatar/{{md5 .}}?s=240&d=mp" alt="gravatar"></div>
|
||||
{{ end }}
|
||||
17
layouts/partials/home/social.html
Normal file
17
layouts/partials/home/social.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{{ with .Site.Params.social }}
|
||||
<ul>
|
||||
{{ range sort . "weight" }}
|
||||
{{ if .icon }}
|
||||
<li>
|
||||
<a href="{{ .url | safeURL }}" aria-label="{{ .name }}" {{ if .rel }}rel="{{ .rel }}"{{ end }} {{ if .target }}target="{{ .target }}"{{ end }} {{ if .type }}type="{{ .type }}"{{ end }}>
|
||||
<i class="{{ .icon }}" aria-hidden="true"></i>
|
||||
</a>
|
||||
</li>
|
||||
{{ else }}
|
||||
<li>
|
||||
<a href="{{ .url | safeURL }}" aria-label="{{ .name }}" {{ if .rel }}rel="{{ .rel }}"{{ end }} {{ if .target }}target="{{ .target }}"{{ end }}>{{ .name }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
@@ -2,18 +2,17 @@
|
||||
<h1 class="title">
|
||||
<a class="title-link" href="{{ .Permalink | safeURL }}">
|
||||
{{- if eq .Kind "term" -}}
|
||||
{{- i18n .Data.Singular | title -}}
|
||||
{{- i18n .Data.Plural 1 | title -}}
|
||||
{{- print ": " -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- .Title -}}
|
||||
{{- i18n (lower .Title) | default .Title | title -}}
|
||||
</a>
|
||||
</h1>
|
||||
{{ .Content }}
|
||||
<ul>
|
||||
{{ range .Paginator.Pages }}
|
||||
<li>
|
||||
<span class="date">{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</span>
|
||||
<span class="date">{{ .Date | time.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</span>
|
||||
<a class="title" href="{{ .Params.externalLink | default .RelPermalink }}">{{ .Title }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
@@ -1,30 +1,11 @@
|
||||
{{- if or (.Params.math) (.Site.Params.math) -}}
|
||||
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
||||
{{/* The file is already minified */}}
|
||||
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
||||
<script>
|
||||
MathJax = {
|
||||
tex: {
|
||||
inlineMath: [
|
||||
['$', '$'], ['\\(', '\\)']
|
||||
],
|
||||
processEscapes: true,
|
||||
processEnvironments: true
|
||||
},
|
||||
options: {
|
||||
skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre']
|
||||
}
|
||||
};
|
||||
</script>
|
||||
{{- end -}}
|
||||
{{- if or (.Params.katex) (.Site.Params.katex) -}}
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css"
|
||||
integrity="sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X" crossorigin="anonymous">
|
||||
{{- if or (.Params.math) (.Site.Params.math) (.Params.katex) (.Site.Params.katex) -}}
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/katex.min.css"
|
||||
integrity="sha384-R4558gYOUz8mP9YWpZJjofhk+zx0AS11p36HnD2ZKj/6JR5z27gSSULCNHIRReVs" crossorigin="anonymous">
|
||||
{{/* The loading of KaTeX is deferred to speed up page rendering */}}
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js"
|
||||
integrity="sha384-g7c+Jr9ZivxKLnZTDUhnkOnsh30B4H0rpLUpJ4jAIKs4fnJI+sEnkvrMWph2EDg4" crossorigin="anonymous"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js"
|
||||
integrity="sha384-mll67QQFJfxn0IYznZYonOWZ644AWYC+Pt2cHqMaRhXVrursRwvLnLaebdGIlYNa" crossorigin="anonymous"
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/katex.min.js"
|
||||
integrity="sha384-z1fJDqw8ZApjGO3/unPWUPsIymfsJmyrDVWC8Tv/a1HeOtGmkwNd/7xUS0Xcnvsx" crossorigin="anonymous"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/contrib/auto-render.min.js"
|
||||
integrity="sha384-+XBljXPPiv+OzfbB3cVmLHf4hdUFHlWNZN5spNQ7rmHTXpd7WvJum6fIACpNNfIR" crossorigin="anonymous"
|
||||
onload="renderMathInElement(document.body,
|
||||
{
|
||||
delimiters: [
|
||||
|
||||
@@ -1,12 +1,24 @@
|
||||
{{- if isset .Site.Params "utterances" -}}
|
||||
{{- if and (isset .Site.Params.utterances "repo") (not (eq .Site.Params.utterances.repo "" )) (eq (.Params.disable_comments | default false) false) -}}
|
||||
<script src="https://utteranc.es/client.js"
|
||||
repo= "{{ .Site.Params.utterances.repo }}"
|
||||
issue-term="{{ default "title" .Site.Params.utterances.issueTerm }}"
|
||||
{{ if isset .Site.Params.utterances "label" }}label="{{ .Site.Params.utterances.label }}"{{ end }}
|
||||
theme="{{ default "github-light" .Site.Params.utterances.theme }}"
|
||||
crossorigin="anonymous"
|
||||
async>
|
||||
</script>
|
||||
{{- if and (isset .Site.Params.utterances "repo") (not (eq .Site.Params.utterances.repo "" )) (eq (.Params.disableComments | default false) false) -}}
|
||||
<div class="comments">
|
||||
<script>
|
||||
|
||||
let getTheme = window.localStorage && window.localStorage.getItem("colorscheme");
|
||||
|
||||
getTheme = getTheme == null ? '{{$.Site.Params.utterances.theme}}' : getTheme;
|
||||
|
||||
let theme = getTheme === 'dark' ? 'github-dark' : 'github-light';
|
||||
let s = document.createElement('script');
|
||||
s.src = 'https://utteranc.es/client.js';
|
||||
s.setAttribute('repo', '{{ .Site.Params.utterances.repo }}');
|
||||
s.setAttribute('issue-term', '{{ default "title" .Site.Params.utterances.issueTerm }}');
|
||||
s.setAttribute('theme', theme);
|
||||
s.setAttribute('crossorigin', 'anonymous');
|
||||
s.setAttribute('async', '');
|
||||
document.querySelector('div.comments').innerHTML = '';
|
||||
document.querySelector('div.comments').appendChild(s);
|
||||
|
||||
</script>
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<div class="authors">
|
||||
<i class="fa fa-user" aria-hidden="true"></i>
|
||||
{{- range $index, $el := . -}}
|
||||
{{- if gt $index 0 }}
|
||||
<span class="separator">•</span>
|
||||
{{- end }}
|
||||
<a href="{{ ( printf "authors/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
|
||||
{{- end -}}
|
||||
</div>
|
||||
<i class="fa fa-user" aria-hidden="true"></i>
|
||||
{{- range $index, $el := . -}}
|
||||
{{- if gt $index 0 }}
|
||||
<span class="separator">•</span>
|
||||
{{- end }}
|
||||
<a href="{{ ( printf "authors/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
{{- if gt $index 0 }}
|
||||
<span class="separator">•</span>
|
||||
{{- end }}
|
||||
<a href="{{ ( printf "tags/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
|
||||
<span class="tag">
|
||||
<a href="{{ ( printf "tags/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
|
||||
</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
27
layouts/partials/terms.html
Normal file
27
layouts/partials/terms.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<section class="container taxonomy">
|
||||
<h1 class="title">
|
||||
<a class="title-link" href="{{ .Permalink | safeURL }}">
|
||||
{{- if eq .Kind "term" -}}
|
||||
{{- i18n .Data.Plural | title -}}
|
||||
{{- print ": " -}}
|
||||
{{- end -}}
|
||||
{{- i18n (lower .Title) | default .Title | title -}}
|
||||
</a>
|
||||
</h1>
|
||||
{{ .Content }}
|
||||
<ul>
|
||||
{{ $type := .Type }}
|
||||
{{ range $key, $value := .Data.Terms.Alphabetical }}
|
||||
{{ $name := .Name }}
|
||||
{{ $count := .Count }}
|
||||
{{ with $.Site.GetPage (printf "/%s/%s" $type $name) }}
|
||||
<li>
|
||||
<span class="taxonomy-element">
|
||||
<a href="{{ .Permalink }}">{{ .Name }}</a>
|
||||
<sup>{{ $count }}</sup>
|
||||
</span>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</section>
|
||||
@@ -1,4 +1,4 @@
|
||||
<li>
|
||||
<span class="date">{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</span>
|
||||
<span class="date">{{ .Date | time.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</span>
|
||||
<a class="title" href="{{ .Params.externalLink | default .RelPermalink }}">{{ .Title }}</a>
|
||||
</li>
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
<div class="date">
|
||||
<span class="posted-on">
|
||||
<i class="fa fa-calendar" aria-hidden="true"></i>
|
||||
<time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'>
|
||||
{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}
|
||||
<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
|
||||
{{ .Date | time.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}
|
||||
</time>
|
||||
</span>
|
||||
<span class="reading-time">
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
<div>
|
||||
{{ if .Params.featuredImage }}
|
||||
<img src='{{ .Params.featuredImage }}' alt="Featured image"/>
|
||||
<img src="{{ .Params.featuredImage | relURL }}" alt="Featured image"/>
|
||||
{{ end }}
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
||||
12
layouts/shortcodes/notice.html
Normal file
12
layouts/shortcodes/notice.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{- $type := .Get 0 -}}
|
||||
{{- $title := .Get 1 | default $type -}}
|
||||
{{- $inner := .Inner | .Page.RenderString | chomp -}}
|
||||
{{- $icon := dict "note" "fa-sticky-note" "tip" "fa-lightbulb-o" "example" "fa-file-text" "question" "fa-question" "info" "fa-exclamation-circle" "warning" "fa-exclamation-triangle" "error" "fa-times-circle" -}}
|
||||
<div class="notice {{ $type }}">
|
||||
<div class="notice-title">
|
||||
<i class="fa {{ index $icon $type }}" aria-hidden="true"></i>{{ i18n $title | default $title | humanize }}
|
||||
</div>
|
||||
<div class="notice-content">
|
||||
{{- $inner -}}
|
||||
</div>
|
||||
</div>
|
||||
17
layouts/shortcodes/tab.html
Normal file
17
layouts/shortcodes/tab.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{{ $group := .Page.Scratch.Get "tabGroupIndex" | default 0 }}
|
||||
{{ $index := .Page.Scratch.Get "tabElementIndex" | default 0 }}
|
||||
{{ $name := .Get "name" | default "Name Me!" }}
|
||||
|
||||
<style>
|
||||
.tabs input#tab-{{ $group }}-{{ $index }}:checked ~ .tab-content-{{ $group }}-{{ $index }} {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
||||
<input type="radio" class="tab-input" name="tab-select-{{ $group }}" id="tab-{{ $group }}-{{ $index }}" {{ if eq $index 0 }}checked{{ end }}/>
|
||||
<label for="tab-{{ $group }}-{{ $index }}" class="tab-label">{{ $name }}</label>
|
||||
<div class="tab-content tab-content-{{ $group }}-{{ $index }}">
|
||||
{{ .Inner | markdownify }}
|
||||
</div>
|
||||
|
||||
{{ .Page.Scratch.Set "tabElementIndex" (add 1 $index) }}
|
||||
10
layouts/shortcodes/tabgroup.html
Normal file
10
layouts/shortcodes/tabgroup.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{{ $align := .Get "align" | default "left" }}
|
||||
{{ $style := .Get "style" | default "markdown" }}
|
||||
{{ $group := .Page.Scratch.Get "tabGroupIndex" | default 0 }}
|
||||
{{ $index := .Page.Scratch.Set "tabElementIndex" 0 }}
|
||||
|
||||
<div class="tabs {{ if eq $style "code" }}tabs-code {{ end }}tabs-{{ $align }}">
|
||||
{{ .Inner }}
|
||||
</div>
|
||||
|
||||
{{ .Page.Scratch.Set "tabGroupIndex" (add 1 $group) }}
|
||||
Reference in New Issue
Block a user