Initial Commit

This commit is contained in:
2022-11-03 21:23:41 -07:00
parent 9c8fbce0c1
commit b14b66bc69
184 changed files with 11297 additions and 1 deletions

View File

@ -0,0 +1,3 @@
{{ define "content" }}
{{ partial "404.html" . }}
{{ end }}

View File

@ -0,0 +1,7 @@
<h{{ .Level }} id="{{ .Anchor | safeURL }}">
{{ .Text | safeHTML }}
<a class="heading-link" href="#{{ .Anchor | safeURL }}">
<i class="fa fa-link" aria-hidden="true" title="{{ i18n "link_to_heading" | default "Link to heading" }}"></i>
<span class="sr-only">{{ i18n "link_to_heading" | default "Link to heading" }}</span>
</a>
</h{{ .Level }}>

View File

@ -0,0 +1,85 @@
<!DOCTYPE html>
<html lang="{{ .Site.Language.Lang }}">
<head>
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
{{ partial "head.html" . }}
</head>
{{ $csClass := "colorscheme-light" }}
{{ if eq .Site.Params.colorScheme "dark" }}
{{ $csClass = "colorscheme-dark" }}
{{ else if eq .Site.Params.colorScheme "auto" }}
{{ $csClass = "colorscheme-auto" }}
{{ end }}
<body class="preload-transitions {{ $csClass }}{{ if .Site.Params.rtl }} rtl{{ end }}">
{{ partial "float" . }}
<main class="wrapper">
{{ partial "header.html" . }}
<div class="content">
{{ block "content" . }}{{ end }}
</div>
{{ partial "footer.html" . }}
</main>
{{ if .HasShortcode "mermaid" }}
<script src="https://cdn.jsdelivr.net/npm/mermaid@9.1.5/dist/mermaid.min.js" integrity="sha256-RqbL4xBKYq/iP+616ZrXdmaNyCuRX1mW7wjsHPfa8uY=" crossorigin="anonymous"></script>
<script>
mermaid.initialize({ startOnLoad: true });
</script>
{{ end }}
{{ 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 }}
{{ 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 }}
{{ template "_internal/google_analytics.html" . }}
{{ if and .Site.Params.fathomAnalytics .Site.Params.fathomAnalytics.siteID }}
{{- partial "analytics/fathom" . -}}
{{ end }}
{{ if and .Site.Params.plausibleAnalytics .Site.Params.plausibleAnalytics.domain }}
{{- partial "analytics/plausible" . -}}
{{ end }}
{{ if and .Site.Params.goatCounter .Site.Params.goatCounter.code }}
{{- partial "analytics/goatcounter" . -}}
{{ 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 }}
{{ if and .Site.Params.googleTagManager .Site.Params.googleTagManager.id }}
{{- partial "analytics/googletagmanager" . -}}
{{ end }}
{{ if and .Site.Params.applicationInsights .Site.Params.applicationInsights.connectionString }}
{{- partial "analytics/applicationinsights" . -}}
{{ end }}
{{- partial "body/extensions" . -}}
</body>
</html>

View File

@ -0,0 +1,10 @@
{{ define "title" }}
{{- if eq .Kind "term" -}}
{{- i18n .Data.Plural 1 | title -}}
{{- print ": " -}}
{{- end -}}
{{- i18n (lower .Title) | default .Title | title }} · {{ .Site.Title -}}
{{ end }}
{{ define "content" }}
{{ partial "list.html" . }}
{{ end }}

View File

@ -0,0 +1,7 @@
{{ define "title" }}
{{ .Title }} · {{ .Site.Title }}
{{ end }}
{{ define "content" }}
{{ partial "page.html" . }}
{{ partial "posts/math.html" . }}
{{ end }}

View 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 }}

View File

@ -0,0 +1,3 @@
{{ define "content" }}
{{ partial "home.html" . }}
{{ end }}

View File

@ -0,0 +1,7 @@
<section class="container centered">
<div class="error">
<h1>404</h1>
<h2>{{ i18n "page_not_found" }}</h2>
<p>{{ i18n "page_does_not_exist" }}<br />{{ i18n "head_back" .Site.BaseURL | safeHTML }}</p>
</div>
</section>

View File

@ -0,0 +1,13 @@
<script type="text/javascript">
!function(T,l,y){var S=T.location,k="script",D="connectionString",C="ingestionendpoint",I="disableExceptionTracking",E="ai.device.",b="toLowerCase",w="crossOrigin",N="POST",e="appInsightsSDK",t=y.name||"appInsights";(y.name||T[e])&&(T[e]=t);var n=T[t]||function(d){var g=!1,f=!1,m={initialize:!0,queue:[],sv:"5",version:2,config:d};function v(e,t){var n={},a="Browser";return n[E+"id"]=a[b](),n[E+"type"]=a,n["ai.operation.name"]=S&&S.pathname||"_unknown_",n["ai.internal.sdkVersion"]="javascript:snippet_"+(m.sv||m.version),{time:function(){var e=new Date;function t(e){var t=""+e;return 1===t.length&&(t="0"+t),t}return e.getUTCFullYear()+"-"+t(1+e.getUTCMonth())+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}(),name:"Microsoft.ApplicationInsights."+e.replace(/-/g,"")+"."+t,sampleRate:100,tags:n,data:{baseData:{ver:2}}}}var h=d.url||y.src;if(h){function a(e){var t,n,a,i,r,o,s,c,u,p,l;g=!0,m.queue=[],f||(f=!0,t=h,s=function(){var e={},t=d.connectionString;if(t)for(var n=t.split(";"),a=0;a<n.length;a++){var i=n[a].split("=");2===i.length&&(e[i[0][b]()]=i[1])}if(!e[C]){var r=e.endpointsuffix,o=r?e.location:null;e[C]="https://"+(o?o+".":"")+"dc."+(r||"services.visualstudio.com")}return e}(),c=s[D]||d[D]||"",u=s[C],p=u?u+"/v2/track":d.endpointUrl,(l=[]).push((n="SDK LOAD Failure: Failed to load Application Insights SDK script (See stack for details)",a=t,i=p,(o=(r=v(c,"Exception")).data).baseType="ExceptionData",o.baseData.exceptions=[{typeName:"SDKLoadFailed",message:n.replace(/\./g,"-"),hasFullStack:!1,stack:n+"\nSnippet failed to load ["+a+"] -- Telemetry is disabled\nHelp Link: https://go.microsoft.com/fwlink/?linkid=2128109\nHost: "+(S&&S.pathname||"_unknown_")+"\nEndpoint: "+i,parsedStack:[]}],r)),l.push(function(e,t,n,a){var i=v(c,"Message"),r=i.data;r.baseType="MessageData";var o=r.baseData;return o.message='AI (Internal): 99 message:"'+("SDK LOAD Failure: Failed to load Application Insights SDK script (See stack for details) ("+n+")").replace(/\"/g,"")+'"',o.properties={endpoint:a},i}(0,0,t,p)),function(e,t){if(JSON){var n=T.fetch;if(n&&!y.useXhr)n(t,{method:N,body:JSON.stringify(e),mode:"cors"});else if(XMLHttpRequest){var a=new XMLHttpRequest;a.open(N,t),a.setRequestHeader("Content-type","application/json"),a.send(JSON.stringify(e))}}}(l,p))}function i(e,t){f||setTimeout(function(){!t&&m.core||a()},500)}var e=function(){var n=l.createElement(k);n.src=h;var e=y[w];return!e&&""!==e||"undefined"==n[w]||(n[w]=e),n.onload=i,n.onerror=a,n.onreadystatechange=function(e,t){"loaded"!==n.readyState&&"complete"!==n.readyState||i(0,t)},n}();y.ld<0?l.getElementsByTagName("head")[0].appendChild(e):setTimeout(function(){l.getElementsByTagName(k)[0].parentNode.appendChild(e)},y.ld||0)}try{m.cookie=l.cookie}catch(p){}function t(e){for(;e.length;)!function(t){m[t]=function(){var e=arguments;g||m.queue.push(function(){m[t].apply(m,e)})}}(e.pop())}var n="track",r="TrackPage",o="TrackEvent";t([n+"Event",n+"PageView",n+"Exception",n+"Trace",n+"DependencyData",n+"Metric",n+"PageViewPerformance","start"+r,"stop"+r,"start"+o,"stop"+o,"addTelemetryInitializer","setAuthenticatedUserContext","clearAuthenticatedUserContext","flush"]),m.SeverityLevel={Verbose:0,Information:1,Warning:2,Error:3,Critical:4};var s=(d.extensionConfig||{}).ApplicationInsightsAnalytics||{};if(!0!==d[I]&&!0!==s[I]){var c="onerror";t(["_"+c]);var u=T[c];T[c]=function(e,t,n,a,i){var r=u&&u(e,t,n,a,i);return!0!==r&&m["_"+c]({message:e,url:t,lineNumber:n,columnNumber:a,error:i}),r},d.autoExceptionInstrumented=!0}return m}(y.cfg);function a(){y.onInit&&y.onInit(n)}(T[t]=n).queue&&0===n.queue.length?(n.queue.push(a),n.trackPageView({})):a()}(window,document,{
src: "https://js.monitor.azure.com/scripts/b/ai.2.min.js", // The SDK URL Source
// name: "appInsights", // Global SDK Instance name defaults to "appInsights" when not supplied
// ld: 0, // Defines the load delay (in ms) before attempting to load the sdk. -1 = block page load and add to head. (default) = 0ms load after timeout,
// useXhr: 1, // Use XHR instead of fetch to report failures (if available),
crossOrigin: "anonymous", // When supplied this will add the provided value as the cross origin attribute on the script tag
// onInit: null, // Once the application insights instance has loaded and initialized this callback function will be called with 1 argument -- the sdk instance (DO NOT ADD anything to the sdk.queue -- As they won't get called)
cfg: { // Application Insights Configuration
connectionString: "{{ $.Site.Params.applicationInsights.connectionString }}"
/* ...Other Configuration Options... */
}});
</script>

View File

@ -0,0 +1,4 @@
<!-- Cloudflare Web Analytics -->
<script defer src='https://static.cloudflareinsights.com/beacon.min.js'
data-cf-beacon='{"token": "{{ $.Site.Params.cloudflare.token }}"}'></script>
<!-- End Cloudflare Web Analytics -->

View File

@ -0,0 +1,13 @@
<script>
(function(f, a, t, h, o, m){
a[h]=a[h]||function(){
(a[h].q=a[h].q||[]).push(arguments)
};
o=f.createElement('script'),
m=f.getElementsByTagName('script')[0];
o.async=1; o.src=t; o.id='fathom-script';
m.parentNode.insertBefore(o,m)
})(document, window, '//{{ .Site.Params.fathomAnalytics.serverURL | default "cdn.usefathom.com" }}/tracker.js', 'fathom');
fathom('set', 'siteId', '{{ .Site.Params.fathomAnalytics.siteID }}');
fathom('trackPageview');
</script>

View File

@ -0,0 +1,2 @@
<script data-goatcounter="https://{{ $.Site.Params.goatCounter.code }}.goatcounter.com/count"
async src="//gc.zgo.at/count.js"></script>

View 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>

View File

@ -0,0 +1,13 @@
<script type="application/javascript">
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://{{ $.Site.Params.matomo.serverURL }}/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '{{ $.Site.Params.matomo.siteID | default "1" }}']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>

View File

@ -0,0 +1 @@
<script async defer data-domain="{{ .Site.Params.plausibleAnalytics.domain }}" src="https://{{ .Site.Params.plausibleAnalytics.serverURL | default "plausible.io" }}/js/plausible.js"></script>

View 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.
*/}}

View File

@ -0,0 +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; 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 }}

View File

@ -0,0 +1,7 @@
{{ if not .Site.Params.hideColorSchemeToggle }}
<div class="float-container">
<a id="dark-mode-toggle" class="colorscheme-toggle">
<i class="fa fa-adjust fa-fw" aria-hidden="true"></i>
</a>
</div>
{{ end }}

View File

@ -0,0 +1,18 @@
<footer class="footer">
<section class="container">
{{ if (and .Site.Params.since (lt .Site.Params.since now.Year)) }}
{{ .Site.Params.since }} -
{{ end }}
©{{now.Year }}
{{ with .Site.Params.copyright }} {{ . }} {{ end }}
·
{{ if (and .Site.Params.license) }}
{{ i18n "licensed_under" }} {{ .Site.Params.license | safeHTML }}
·
{{ end }}
{{ i18n "powered_by" }} <a href="https://gohugo.io/">Hugo</a> & <a href="https://github.com/luizdepra/hugo-coder/">Coder</a>.
{{ if (and .Site.Params.commit .GitInfo) }}
[<a href="{{ .Site.Params.commit }}/{{ .GitInfo.Hash }}">{{ .GitInfo.AbbreviatedHash }}</a>]
{{ end }}
</section>
</footer>

View File

@ -0,0 +1,24 @@
{{ if .Permalink }}
<link rel="canonical" href="{{ .Permalink }}">
{{ end }}
{{ partialCached "head/custom-icons.html" . }}
{{ partial "head/meta-tags.html" . }}
{{ partialCached "head/theme-styles.html" . }}
{{ partialCached "head/color-scheme.html" . }}
{{ partialCached "head/custom-styles.html" . }}
{{ partial "head/alternative-output-formats.html" . }}
{{ partialCached "head/hugo-generator.html" . }}
{{ partial "head/extensions.html" . }}
{{ range .Site.Params.snow}}
<script src="{{ . | absURL }}"></script>
{{- end }}

View 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 -}}

View 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 }}

View File

@ -0,0 +1,7 @@
<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="mask-icon" href="{{ .Site.Params.mask_icon | default "/images/safari-pinned-tab.svg" | relURL }}" color="{{ .Site.Params.mask_icon_color | default "#383C4A" }}">

View 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 }}

View File

@ -0,0 +1,4 @@
{{/*
You can add further theme extensions or customizations here if they should
appear in <head>.
*/}}

View File

@ -0,0 +1 @@
{{ hugo.Generator }}

View File

@ -0,0 +1,19 @@
<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 }}">
<meta property="og:image" content="{{ .Site.Params.ogimage }}">
<meta name="twitter:image" content="{{ .Site.Params.ogimage }}">
<element hidden>
<a rel="me" href="{{ .Site.Params.mastodon }}">Mastodon</a>
</element>
{{ template "_internal/twitter_cards.html" . }}
{{ template "_internal/opengraph.html" . }}

View File

@ -0,0 +1,23 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fork-awesome@1.2.0/css/fork-awesome.min.css" integrity="sha256-XoaMnoYC5TH6/+ihMEnospgm0J1PM/nioxbOUdnM8HY=" crossorigin="anonymous">
{{ 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 }}

View File

@ -0,0 +1,39 @@
<nav class="navigation">
<section class="title-container">
<a class="navigation-title" href="{{ .Site.BaseURL | relLangURL }}">
{{ .Site.Title }}
</a>
{{ if or .Site.Menus.main .Site.IsMultiLingual }}
<input type="checkbox" id="menu-toggle" />
<label class="menu-button float-right" for="menu-toggle">
<i class="fa fa-bars fa-fw" aria-hidden="true"></i>
</label>
<ul class="navigation-list">
{{ with .Site.Menus.main}}
{{ range sort . }}
<li class="navigation-item">
<a class="navigation-link" href="{{ index (apply (slice .URL) (.Params.urlFunc | default "relLangURL") ".") 0 }}">{{ .Name }}</a>
</li>
{{ end }}
{{ end }}
{{ if .Site.IsMultiLingual }}
{{ $node := . }}
{{ .Scratch.Set "separator" true }}
{{ range (default .Site.Home.AllTranslations .Translations) }}
{{ if ne $.Site.Language .Language }}
{{ if $node.Scratch.Get "separator" }}
<li class="navigation-item menu-separator">
<span>|</span>
</li>
{{ $node.Scratch.Set "separator" false }}
{{ end }}
<li class="navigation-item">
<a href="{{ .Permalink }}">{{ .Language.LanguageName | emojify }}</a>
</li>
{{ end }}
{{ end }}
{{ end }}
</ul>
{{ end }}
</section>
</nav>

View File

@ -0,0 +1,11 @@
<section class="container centered">
<div class="about">
{{ partialCached "home/avatar.html" . }}
{{ partialCached "home/author.html" . }}
{{ partialCached "home/social.html" . }}
</div>
{{ partialCached "home/extensions.html" . }}
</section>

View File

@ -0,0 +1,6 @@
<h1>{{ .Site.Params.author }}</h1>
{{ if reflect.IsSlice .Site.Params.info }}
<h2>{{ range .Site.Params.info }}{{ . | markdownify }}<br>{{ end}}</h2>
{{ else }}
<h2>{{ .Site.Params.info | markdownify }} </h2>
{{ end }}

View 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 }}

View File

@ -0,0 +1,4 @@
{{/*
You can add further theme extensions or customizations here if they should
appear in after the "about" section.
*/}}

View 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 }}

View File

@ -0,0 +1,17 @@
<section class="container list">
<h1 class="title">
<a class="title-link" href="{{ .Permalink | safeURL }}">
{{- if eq .Kind "term" -}}
{{- i18n .Data.Plural 1 | title -}}
{{- print ": " -}}
{{- end -}}
{{- i18n (lower .Title) | default .Title | title -}}
</a>
</h1>
{{ .Content }}
<ul>
{{ range .Paginator.Pages }}
{{ end }}
</ul>
{{ partial "pagination.html" . }}
</section>

View File

@ -0,0 +1,13 @@
<section class="container page">
<article>
<header>
<h1 class="title">
<a class="title-link" href="{{ .Permalink | safeURL }}">
{{ .Title }}
</a>
</h1>
</header>
{{ .Content }}
</article>
</section>

View File

@ -0,0 +1,48 @@
{{ $paginator := .Paginator }}
{{ $adjacent_links := 2 }}
{{ $max_links := (add (mul $adjacent_links 2) 1) }}
{{ $lower_limit := (add $adjacent_links 1) }}
{{ $upper_limit := (sub $paginator.TotalPages $adjacent_links) }}
{{ if gt $paginator.TotalPages 1 }}
<ul class="pagination">
{{ if $paginator.HasPrev }}
{{ if ne $paginator.PageNumber 1 }}
<li><a href="{{ $paginator.First.URL }}">&laquo;</a></li>
{{ end }}
<li class="hidden"><a href="{{ $paginator.Prev.URL }}">&lsaquo;</a></li>
{{ end }}
{{ range $paginator.Pagers }}
{{ $.Scratch.Set "page_number_flag" false }}
{{ if gt $paginator.TotalPages $max_links }}
{{ if le $paginator.PageNumber $lower_limit }}
{{ if le .PageNumber $max_links }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
{{ else if ge $paginator.PageNumber $upper_limit }}
{{ if gt .PageNumber (sub $paginator.TotalPages $max_links) }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
{{ else }}
{{ if and ( ge .PageNumber (sub $paginator.PageNumber $adjacent_links) ) ( le .PageNumber (add $paginator.PageNumber $adjacent_links) ) }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
{{ end }}
{{ else }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
{{ if eq ($.Scratch.Get "page_number_flag") true }}
{{ if eq . $paginator }}
<li>{{ .PageNumber }}</li>
{{ else }}
<li><a href="{{ .URL }}">{{ .PageNumber }}</a></li>
{{ end }}
{{ end }}
{{ end }}
{{ if $paginator.HasNext }}
<li class="hidden"><a href="{{ $paginator.Next.URL }}">&rsaquo;</a></li>
{{ if ne $paginator.PageNumber $paginator.TotalPages }}
<li><a href="{{ $paginator.Last.URL }}">&raquo;</a></li>
{{ end }}
{{ end }}
</ul>
{{ end }}

View File

@ -0,0 +1,4 @@
{{- if and (isset .Site.Params "commentourl") (not (eq .Site.Params.commentoURL "" )) (eq (.Params.disableComments | default false) false) -}}
<div id="commento"></div>
<script src="{{ .Site.Params.commentoURL }}/js/commento.js"></script>
{{- end -}}

View File

@ -0,0 +1,3 @@
{{- if and (not (eq (.Site.DisqusShortname | default "") "")) (eq (.Params.disableComments | default false) false) -}}
{{ template "_internal/disqus.html" . }}
{{- end -}}

View File

@ -0,0 +1,19 @@
{{- 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.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: [
{left: '$$', right: '$$', display:true},
{left: '$', right: '$', display:false},
{left: '\\(', right: '\\)', display: false},
{left: '\\[', right: '\\]', display: true}
]
}
);"></script>
{{- end -}}

View File

@ -0,0 +1,30 @@
{{ $currentPageUrl := .RelPermalink }}
{{ if .Params.series }}
<section class="see-also">
{{ range .Params.series }}
{{ $name := . | urlize }}
{{ $series := index $.Site.Taxonomies.series $name }}
{{ if gt (len $series.Pages) 1 }}
<h3 id="{{ i18n "see_also" | default "See also in" | anchorize }}-{{ anchorize . | safeURL }}">
{{ i18n "see_also" | default "See also in" }} {{ . }}
<a class="heading-link" href="#{{ i18n "see_also" | default "See also in" | anchorize }}-{{ anchorize . | safeURL }}">
<i class="fa fa-link" aria-hidden="true" title="{{ i18n "link_to_heading" | default "Link to heading" }}"></i>
<span class="sr-only">{{ i18n "link_to_heading" | default "Link to heading" }}</span>
</a>
</h3>
<nav>
<ul>
{{ $maxItems := $.Site.Params.maxSeeAlsoItems | default 5 }}
{{ range first (add $maxItems 1) $series.Pages }}
{{ if ne .RelPermalink $currentPageUrl }}
<li>
<a href="{{ .Params.externalLink | default .RelPermalink }}">{{ .Title }}</a>
</li>
{{ end }}
{{ end }}
</ul>
</nav>
{{ end }}
{{ end }}
</section>
{{ end }}

View File

@ -0,0 +1,24 @@
{{- if isset .Site.Params "utterances" -}}
{{- 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 -}}

View File

@ -0,0 +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>

View File

@ -0,0 +1,9 @@
<div class="categories">
<i class="fa fa-folder" aria-hidden="true"></i>
{{- range $index, $el := . -}}
{{- if gt $index 0 }}
<span class="separator"></span>
{{- end }}
<a href="{{ ( printf "categories/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
{{- end -}}
</div>

View File

@ -0,0 +1,11 @@
<div class="tags">
<i class="fa fa-tag" aria-hidden="true"></i>
{{- range $index, $el := . -}}
{{- if gt $index 0 }}
<span class="separator"></span>
{{- end }}
<span class="tag">
<a href="{{ ( printf "tags/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
</span>
{{- end -}}
</div>

View 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>

View File

@ -0,0 +1,4 @@
<li>
<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>

View File

@ -0,0 +1,20 @@
{{ define "title" }}
{{ title (i18n (lower .Title)) | default .Title }} · {{ .Site.Title }}
{{ end }}
{{ define "content" }}
<section class="container list">
<h1 class="title">
<a class="title-link" href="{{ .Permalink | safeURL }}">
{{ title (i18n (lower .Title)) | default .Title }}
</a>
</h1>
{{ .Content }}
<ul>
{{- range .Paginator.Pages -}}
{{- .Render "li" -}}
{{- end -}}
</ul>
{{ partial "pagination.html" . }}
</section>
{{ end }}

View File

@ -0,0 +1,52 @@
{{ define "title" }}
{{ .Title }} · {{ .Site.Title }}
{{ end }}
{{ define "content" }}
<section class="container post">
<article>
<header>
<div class="post-title">
<h1 class="title">
<a class="title-link" href="{{ .Permalink | safeURL }}">
{{ .Title }}
</a>
</h1>
</div>
<div class="post-meta">
<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 | time.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}
</time>
</span>
<span class="reading-time">
<i class="fa fa-clock-o" aria-hidden="true"></i>
{{ i18n "reading_time" .ReadingTime }}
</span>
</div>
{{ with .Page.Params.Authors }}{{ partial "taxonomy/authors.html" . }}{{ end }}
{{ with .Page.Params.Categories }}{{ partial "taxonomy/categories.html" . }}{{ end }}
{{ with .Page.Params.Tags }}{{ partial "taxonomy/tags.html" . }}{{ end }}
</div>
</header>
<div>
{{ if .Params.featuredImage }}
<img src="{{ .Params.featuredImage | relURL }}" alt="Featured image"/>
{{ end }}
{{ .Content }}
</div>
<footer>
{{ partial "posts/series.html" . }}
{{ partial "posts/disqus.html" . }}
{{ partial "posts/commento.html" . }}
{{ partial "posts/utterances.html" . }}
</footer>
</article>
{{ partial "posts/math.html" . }}
</section>
{{ end }}

View File

@ -0,0 +1,3 @@
<div class="mermaid">
{{- .Inner | safeHTML }}
</div>

View 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>

View 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) }}

View 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) }}