Squashed 'themes/codex/' content from commit da2d16a

git-subtree-dir: themes/codex
git-subtree-split: da2d16a4f95fc37e71548dfc139d51e22ebb09bd
This commit is contained in:
2020-12-11 02:43:08 +05:30
commit bfb1829a86
77 changed files with 3137 additions and 0 deletions

7
layouts/404.html Normal file
View File

@@ -0,0 +1,7 @@
{{ define "main" }}
<article>
<h1>
This is not the page you were looking for
</h1>
</article>
{{ end }}

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

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

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

View 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
layouts/index.html Normal file
View 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 }}

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

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

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

View File

@@ -0,0 +1 @@
<link rel="shortcut icon" type="image/png" href="/favicon.ico" />

View 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
layouts/partials/nav.html Normal file
View 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>

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

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

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

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

View 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
layouts/taxonomy/tag.html Normal file
View 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 }}