Merge commit 'bfb1829a86a2bc1b595dad52a9d6dcfe80dd0679' as 'themes/codex'
This commit is contained in:
7
themes/codex/layouts/404.html
Normal file
7
themes/codex/layouts/404.html
Normal file
@@ -0,0 +1,7 @@
|
||||
{{ define "main" }}
|
||||
<article>
|
||||
<h1>
|
||||
This is not the page you were looking for
|
||||
</h1>
|
||||
</article>
|
||||
{{ end }}
|
||||
4
themes/codex/layouts/_default/_markup/render-link.html
Normal file
4
themes/codex/layouts/_default/_markup/render-link.html
Normal file
@@ -0,0 +1,4 @@
|
||||
<a href="{{ .Destination | safeURL }}" {{ with .Title}} title="{{ . }}" {{ end }}
|
||||
{{ if strings.HasPrefix .Destination "mailto" }} target="_blank" {{ end }}
|
||||
{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noreferrer noopener" {{ end }}
|
||||
>{{ .Text | safeHTML }}</a>
|
||||
65
themes/codex/layouts/_default/baseof.html
Normal file
65
themes/codex/layouts/_default/baseof.html
Normal file
@@ -0,0 +1,65 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.LanguageCode }}">
|
||||
|
||||
<head>
|
||||
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} | {{ .Site.Title }}{{ end }}</title>
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="language" content="en">
|
||||
<meta name="description" content="{{ if .IsHome}}{{ .Site.Params.Description }}{{ else }}{{.Page.Params.Description}}{{ end }}">
|
||||
<meta name="keywords" content="{{ delimit .Keywords " , " }}">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
|
||||
<!-- Twitter -->
|
||||
{{ if isset .Site.Params "twitter" }}
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:title" content="{{ .Title }}" />
|
||||
<meta name="twitter:description" content="{{ if .IsHome }}{{ htmlEscape .Site.Params.description }}{{ else }}{{ htmlEscape .Description }}{{ end }}"/>
|
||||
<meta name="twitter:site" content="{{ .Site.Params.twitterSite | default .Site.Params.twitter }}" />
|
||||
<meta name="twitter:creator" content="{{ .Site.Params.twitterCreator | default .Site.Params.twitter }}" />
|
||||
{{ end }}
|
||||
|
||||
{{ partial "favicon.html" }}
|
||||
|
||||
<!-- Styles -->
|
||||
{{ block "styles" . }} {{ end }} <!-- Get "style_opts" variable from "styles" block -->
|
||||
{{ $base_styles_opts := .Scratch.Get "style_opts" | default (dict "src" "scss/pages/about.scss" "dest" "css/about.css") }}
|
||||
{{ $custom_styles_opts := (dict "src" "scss/custom.scss" "dest" "css/custom.css") }}
|
||||
|
||||
{{ $current_page := . }}
|
||||
|
||||
{{ range (slice $base_styles_opts $custom_styles_opts) }}
|
||||
{{ $style := resources.Get .src | resources.ExecuteAsTemplate .dest $current_page | toCSS | minify | fingerprint }}
|
||||
<link type="text/css" rel="stylesheet" href="{{ $style.RelPermalink }}" integrity="{{ $style.Data.Integrity }}"/>
|
||||
{{ end }}
|
||||
|
||||
{{ range .AlternativeOutputFormats }}
|
||||
{{ printf `<link rel="%s" type="%s+%s" href="%s" title="%s" />` .Rel .MediaType.Type .MediaType.Suffix .Permalink $.Site.Title | safeHTML }}
|
||||
{{ end }}
|
||||
{{ block "links" . }} {{ end }}
|
||||
{{ partial "seo-schema.html" .}}
|
||||
|
||||
{{- if not .Site.IsServer -}}
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
{{- end -}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{{ partial "burger.html" .}}
|
||||
|
||||
{{ partial "nav.html" .}}
|
||||
|
||||
<main>
|
||||
{{ block "main" . }} {{ end }}
|
||||
</main>
|
||||
|
||||
{{ block "footer" . }} {{ end }}
|
||||
|
||||
{{ $script := resources.Get "js/index.js" | minify | fingerprint }}
|
||||
<script src="{{ $script.RelPermalink }}" integrity="{{ $script.Data.Integrity | safeHTMLAttr }}" crossorigin="anonymous"></script>
|
||||
{{ block "scripts" . }} {{ end }}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
27
themes/codex/layouts/_default/list.html
Normal file
27
themes/codex/layouts/_default/list.html
Normal file
@@ -0,0 +1,27 @@
|
||||
{{ define "styles" }}
|
||||
{{ $.Scratch.Set "style_opts" (dict "src" "scss/pages/posts.scss" "dest" "css/posts.css") }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
|
||||
{{ $dateFormat := .Site.Params.dateFormat | default "Jan 2 2006" }}
|
||||
|
||||
<div class="post-list__container">
|
||||
<ul class="post-list">
|
||||
{{ range .Pages }}
|
||||
<li class="post">
|
||||
<div class="post__header">
|
||||
<time class="post__date" datetime="{{ .Date }}"
|
||||
>{{ .Date.Format $dateFormat }}</time>
|
||||
<h2 class="post__title">
|
||||
<a href="{{.RelPermalink}}">{{ .Title }}</a>
|
||||
</h2>
|
||||
{{ partial "tags.html" .}}
|
||||
</div>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ partial "browse-by-tag.html" .}}
|
||||
</div>
|
||||
|
||||
{{ end }}
|
||||
51
themes/codex/layouts/_default/single.html
Normal file
51
themes/codex/layouts/_default/single.html
Normal file
@@ -0,0 +1,51 @@
|
||||
{{ define "styles" }}
|
||||
{{ $.Scratch.Set "style_opts" (dict "src" "scss/pages/post.scss" "dest" "css/post.css") }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
{{ $dateFormat := .Site.Params.dateFormat | default "Jan 2 2006" }}
|
||||
|
||||
<div class="flex-wrapper">
|
||||
<div class="post__container">
|
||||
<div class="post">
|
||||
<header class="post__header">
|
||||
<h1 id="post__title">{{.Title}}</h1>
|
||||
{{ if .Date }}<time datetime="{{ .Date }}" class="post__date">{{ .Date.Format $dateFormat }}</time> {{ end }}
|
||||
</header>
|
||||
<article class="post__content">
|
||||
{{ partial "anchored-headings.html" .Content }}
|
||||
{{ if or .Params.math .Site.Params.math }}
|
||||
{{ partial "math.html" . }}
|
||||
{{ end }}
|
||||
</article>
|
||||
{{ partial "tags.html" .}} {{ partial "post-pagination.html" .}}
|
||||
{{ template "_internal/disqus.html" . }}
|
||||
<footer class="post__footer">
|
||||
{{ partial "social-icons.html" .}}
|
||||
<p>{{ replace .Site.Copyright "{year}" now.Year }}</p>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
{{ if .Params.toc }}
|
||||
<div class="toc-container">
|
||||
{{ if .Site.Params.showPageTitleInTOC }} <div class="toc-post-title">{{ .Title }}</div> {{ end }}
|
||||
{{ .TableOfContents }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{ define "scripts" }}
|
||||
{{/* Hardcode a specific prismjs version to avoid a redirect on every page load. */}}
|
||||
<script src="https://unpkg.com/prismjs@1.20.0/components/prism-core.min.js"></script>
|
||||
|
||||
{{/* Automatically loads the needed languages to highlight the code blocks. */}}
|
||||
<script src="https://unpkg.com/prismjs@1.20.0/plugins/autoloader/prism-autoloader.min.js"
|
||||
data-autoloader-path="https://unpkg.com/prismjs@1.20.0/components/"></script>
|
||||
|
||||
{{ if .Params.toc }}
|
||||
<script src="/js/table-of-contents.js"></script>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
23
themes/codex/layouts/index.html
Normal file
23
themes/codex/layouts/index.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{{ define "styles" }}
|
||||
{{ $.Scratch.Set "style_opts" (dict "src" "scss/pages/about.scss" "dest" "css/about.css") }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
|
||||
<div class="splash-container">
|
||||
<div class="splash">
|
||||
|
||||
<h1>{{ .Params.heading }}<span class="fancy">.</span></h1>
|
||||
{{ if isset .Params "handle" }}
|
||||
<span class="handle">@{{ .Params.handle }}</span>
|
||||
{{ end }}
|
||||
<h2>
|
||||
{{ .Params.subheading }}
|
||||
</h2>
|
||||
<!-- Replace MEEEEE -->
|
||||
|
||||
{{ partial "social-icons.html" .}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ end }}
|
||||
2
themes/codex/layouts/partials/anchored-headings.html
Normal file
2
themes/codex/layouts/partials/anchored-headings.html
Normal file
@@ -0,0 +1,2 @@
|
||||
<!-- formats .Content headings by adding an anchor -->
|
||||
{{ . | replaceRE "(<h[2-3] id=\"([^\"]+)\".+)(</h[2-9]+>)" "${1}<a class=\"anchor\" href=\"#${2}\">#</a>${3}" | safeHTML }}
|
||||
7
themes/codex/layouts/partials/browse-by-tag.html
Normal file
7
themes/codex/layouts/partials/browse-by-tag.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<ul class="tags__list">
|
||||
{{ range $tag, $value := $.Site.Taxonomies.tags }}
|
||||
<li class="tag__item">
|
||||
<a class="tag__link" href="{{ "/tags/" | relLangURL}}{{ $tag | urlize }}/">{{ $tag | urlize }} ({{ len $value }})</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
7
themes/codex/layouts/partials/burger.html
Normal file
7
themes/codex/layouts/partials/burger.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<div class="burger__container">
|
||||
<div class="burger" aria-controls="navigation" aria-label="Menu">
|
||||
<div class="burger__meat burger__meat--1"></div>
|
||||
<div class="burger__meat burger__meat--2"></div>
|
||||
<div class="burger__meat burger__meat--3"></div>
|
||||
</div>
|
||||
</div>
|
||||
1
themes/codex/layouts/partials/favicon.html
Normal file
1
themes/codex/layouts/partials/favicon.html
Normal file
@@ -0,0 +1 @@
|
||||
<link rel="shortcut icon" type="image/png" href="/favicon.ico" />
|
||||
11
themes/codex/layouts/partials/math.html
Normal file
11
themes/codex/layouts/partials/math.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!-- layouts/partials/math.html -->
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_SVG"></script>
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
showMathMenu: false, //disables context menu
|
||||
tex2jax: {
|
||||
inlineMath: [ ['$','$'], ['\\(','\\)'] ]
|
||||
}
|
||||
});
|
||||
</script>
|
||||
11
themes/codex/layouts/partials/nav.html
Normal file
11
themes/codex/layouts/partials/nav.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<nav class="nav" id="navigation">
|
||||
<ul class="nav__list">
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.main }}
|
||||
<li>
|
||||
<a {{ if or ($currentPage.IsMenuCurrent "main" .) (eq $currentPage.Section .Identifier) }} class="active"
|
||||
{{end}} href="{{ .URL }}">{{ .Name }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</nav>
|
||||
7
themes/codex/layouts/partials/pagination.html
Normal file
7
themes/codex/layouts/partials/pagination.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<div class="paginator-container">
|
||||
{{ if .Paginator.HasPrev }}
|
||||
<a class="paginator paginator--left" href="{{ .Paginator.Prev.URL }}"></a>
|
||||
{{ end }} {{ if .Paginator.HasNext }}
|
||||
<a class="paginator paginator--right" href="{{ .Paginator.Next.URL }}"></a>
|
||||
{{ end }}
|
||||
</div>
|
||||
15
themes/codex/layouts/partials/post-pagination.html
Normal file
15
themes/codex/layouts/partials/post-pagination.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<div class="pagination">
|
||||
{{if .PrevInSection}}
|
||||
<a class="pagination__item" href="{{.PrevInSection.Permalink}}">
|
||||
<span class="pagination__label">Previous Post</span>
|
||||
<span class="pagination__title">{{.PrevInSection.Title}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
{{if .NextInSection}}
|
||||
<a class="pagination__item" href="{{.NextInSection.Permalink}}">
|
||||
<span class="pagination__label">Next Post</span>
|
||||
<span class="pagination__title" >{{.NextInSection.Title}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
42
themes/codex/layouts/partials/seo-schema.html
Normal file
42
themes/codex/layouts/partials/seo-schema.html
Normal file
@@ -0,0 +1,42 @@
|
||||
|
||||
<!-- JSON-LD -->
|
||||
<script type="application/ld+json">
|
||||
{{ if and (.IsPage) (eq .Section "blog") }}
|
||||
{
|
||||
"@context" : "http://schema.org",
|
||||
"@type" : "BlogPosting",
|
||||
"mainEntityOfPage": {
|
||||
"@type": "WebPage",
|
||||
"@id": "{{ .Site.BaseURL }}"
|
||||
},
|
||||
"articleSection" : "{{ .Section }}",
|
||||
"name" : "{{ .Title }}",
|
||||
"headline" : "{{ .Title }}",
|
||||
"description" : "{{ .Description }}",
|
||||
"inLanguage" : "en-US",
|
||||
"author" : "{{ .Site.Params.name }}",
|
||||
"creator" : "{{ .Site.Params.name }}",
|
||||
"publisher": "{{ .Site.Params.name }}",
|
||||
"accountablePerson" : "{{ .Site.Params.name }}",
|
||||
"copyrightHolder" : "{{ .Site.Params.name }}",
|
||||
"copyrightYear" : "{{ .Date.Format "2006" }}",
|
||||
"datePublished": "{{ .Date }}",
|
||||
"dateModified" : "{{ .Date }}",
|
||||
"url" : "{{ .Permalink }}",
|
||||
"wordCount" : "{{ .WordCount }}",
|
||||
"keywords" : [{{ if isset .Params "keywords" }}{{ range .Params.keywords }}"{{ . }}", {{ end }}{{ end }}"Blog"]
|
||||
}
|
||||
{{ else }}
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@type": "WebSite",
|
||||
"url": "{{ .Permalink }}",
|
||||
"name": "{{ .Title }}",
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": "{{ .Site.Params.name }}"
|
||||
},
|
||||
"description": "{{ if .IsHome }}{{ htmlEscape .Site.Params.description }}{{ else }}{{ htmlEscape .Description }}{{ end }}"
|
||||
}
|
||||
{{ end }}
|
||||
</script>
|
||||
15
themes/codex/layouts/partials/social-icons.html
Normal file
15
themes/codex/layouts/partials/social-icons.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{{ $currentPage := . }}
|
||||
{{ $icons := .Site.Params.iconOrder | default (slice "Twitter" "GitHub" "Email" "Facebook" "GitLab" "Instagram" "LinkedIn" "YouTube") }}
|
||||
|
||||
<div class="social-icons">
|
||||
{{ range $icons }}
|
||||
{{ $icon := anchorize . }}
|
||||
{{ if isset $currentPage.Site.Params $icon }}
|
||||
<a class="social-icons__link" rel="me" title="{{ . }}"
|
||||
href="{{ index $currentPage.Site.Params $icon }}"
|
||||
target="_blank" rel="noopener">
|
||||
<div class="social-icons__icon" style="background-image: url('{{print "svg/" $icon ".svg" | absURL}}')"></div>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
12
themes/codex/layouts/partials/tags.html
Normal file
12
themes/codex/layouts/partials/tags.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{ $taxo := "tags" }}
|
||||
{{ with .Param $taxo }}
|
||||
<ul class="tags__list">
|
||||
{{ range $index, $tag := . }}
|
||||
{{ with $.Site.GetPage (printf "/%s/%s" $taxo $tag) -}}
|
||||
<li class="tag__item">
|
||||
<a class="tag__link" href="{{ .Permalink }}">{{ $tag | urlize }}</a>
|
||||
</li>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</ul>
|
||||
{{ end }}
|
||||
26
themes/codex/layouts/taxonomy/tag.html
Normal file
26
themes/codex/layouts/taxonomy/tag.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{{ define "styles" }}
|
||||
{{ $.Scratch.Set "style_opts" (dict "src" "scss/pages/tags.scss" "dest" "css/tags.css") }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
{{ $dateFormat := .Site.Params.dateFormat | default "Jan 2 2006" }}
|
||||
|
||||
<div class="post-list__container">
|
||||
<div class="tag__header">
|
||||
<a href="/blog">All posts</a><span class="separator">/</span>
|
||||
<h1 class="tag__term">{{ .Title }}</h1>
|
||||
</div>
|
||||
<ul class="post-list">
|
||||
{{ range .Data.Pages }}
|
||||
<li class="post">
|
||||
<div class="post__header">
|
||||
<time class="post__date" datetime="{{ .Date }}">{{ .Date.Format $dateFormat }}</time>
|
||||
<h2 class="post__title">
|
||||
<a href="{{.RelPermalink}}">{{ .Title }}</a>
|
||||
</h2>
|
||||
</div>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user