Initial commit
This commit is contained in:
commit
1f637ed41e
33 changed files with 832 additions and 0 deletions
9
themes/er/layouts/404.html
Normal file
9
themes/er/layouts/404.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
{{ define "main" }}
|
||||
<main class="center mv4 content-width ph3">
|
||||
<div class="f2 fw6 heading-color heading-font">404</div>
|
||||
<p class="lh-copy post-content f4">
|
||||
Sorry, but nothing exists here. <br>
|
||||
Find something <a href='{{ "" | relURL }}'>interesting to read.</a>
|
||||
</p>
|
||||
</main>
|
||||
{{ end }}
|
10
themes/er/layouts/_default/baseof.html
Normal file
10
themes/er/layouts/_default/baseof.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>{{ partial "header.html" . }}</head>
|
||||
<body class="global-font">
|
||||
{{ partial "nav.html" . }}
|
||||
{{ block "main" . }}{{ end }}
|
||||
{{ partial "footer.html" . }}
|
||||
{{ partial "scripts.html" . }}
|
||||
</body>
|
||||
</html>
|
14
themes/er/layouts/_default/list.html
Normal file
14
themes/er/layouts/_default/list.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
{{ define "main" }}
|
||||
<main class="center mv4 content-width ph3">
|
||||
<h1 class="f2 fw6 heading-font">{{ .Title }}</h1>
|
||||
{{ .Content }}
|
||||
<ul class="list-pages">
|
||||
{{ range .Data.Pages }}
|
||||
<li class="lh-copy"><a href="{{ .Permalink | relURL }}" class="link f5">{{ .Title }}</a> - <time>{{ .Date.Format "02 Jan 2006" }}</time></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</main>
|
||||
<div class="pagination tc db fixed-l bottom-2-l right-2-l mb3 mb0-l">
|
||||
{{ partial "back-to-top.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
26
themes/er/layouts/_default/single.html
Normal file
26
themes/er/layouts/_default/single.html
Normal file
|
@ -0,0 +1,26 @@
|
|||
{{ define "main" }}
|
||||
<main class="center mv4 content-width ph3">
|
||||
<div class="f3 fw6 heading-color heading-font post-title">{{ .Title }}</div>
|
||||
<p class="silver f6 mt1 mb4 post-meta">
|
||||
{{ if not .Date.IsZero }}<time>{{ .Date.Format "02 Jan 2006" }}</time> {{ end }}
|
||||
{{ if or .Params.tags .Params.categories .Params.series }} | {{ end }}
|
||||
{{ if isset .Params "categories" }}
|
||||
categories: [ {{ range .Params.categories }}<a href='{{ "/categories/" | relLangURL }}{{ . | urlize }}' class="link silver">{{ . }}</a> {{ end }} ]
|
||||
{{ end }}
|
||||
{{ if isset .Params "tags" }}
|
||||
tags: [ {{ range .Params.tags }}<a href='{{ "/tags/" | relLangURL }}{{ . | urlize }}' class="link silver">{{ . }}</a> {{ end }} ]
|
||||
{{ end }}
|
||||
</p>
|
||||
<div class="lh-copy post-content">{{ .Content }}</div>
|
||||
</main>
|
||||
{{ partial "table-of-contents" . }}
|
||||
|
||||
|
||||
<div class="pagination tc tr-l db fixed-l bottom-2-l right-2-l mb3 mb0-l">
|
||||
{{ partial "back-to-top.html" . }}<br>
|
||||
<p class="mb0 mt2">
|
||||
{{ with .PrevInSection }}{{ if . }}<a href="{{ .Permalink }}">prev post</a>{{ end }}{{ end }}
|
||||
{{ with .NextInSection }}{{ if . }}<a href="{{ .Permalink }}">next post</a>{{ end }}{{ end }}
|
||||
</p>
|
||||
</div>
|
||||
{{ end }}
|
14
themes/er/layouts/_default/tag.html
Normal file
14
themes/er/layouts/_default/tag.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
{{ define "main" }}
|
||||
<main class="center mv4 content-width ph3">
|
||||
<h1 class="f2 fw6 heading-font"><span class="secondary-color">#</span> {{ .Data.Term }}</h1>
|
||||
{{ .Content }}
|
||||
<ul class="list-pages">
|
||||
{{ range .Data.Pages }}
|
||||
<li class="lh-copy"><a href="{{ .Permalink | relURL }}" class="link f5">{{ .Title }}</a> - <time>{{ .Date.Format "02 Jan 2006" }}</time></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</main>
|
||||
<div class="pagination tc db fixed-l bottom-2-l right-2-l mb3 mb0-l">
|
||||
{{ partial "back-to-top.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
15
themes/er/layouts/_default/terms.html
Normal file
15
themes/er/layouts/_default/terms.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
{{ define "main" }}
|
||||
<main class="center mv4 content-width ph3">
|
||||
{{ $type := .Type }}
|
||||
<h1 class="f2 fw6 heading-font">{{ .Title }}</h1>
|
||||
{{ .Content }}
|
||||
<ul class="list-pages list pl0">
|
||||
{{ range $key, $value := .Data.Terms }}
|
||||
<li class="lh-copy di bg-light-gray ph1"><a href="{{ $key | urlize }}" class="link f5">{{ $key }} ({{ len $value }})</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</main>
|
||||
<div class="pagination tc db fixed-l bottom-2-l right-2-l mb3 mb0-l">
|
||||
{{ partial "back-to-top.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
27
themes/er/layouts/index.atom.xml
Normal file
27
themes/er/layouts/index.atom.xml
Normal file
|
@ -0,0 +1,27 @@
|
|||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
{{ if .IsHome }}
|
||||
<title>{{ .Title }}</title>
|
||||
{{ else }}
|
||||
<title>{{ .Title }} - {{ .Site.Title }}</title>
|
||||
{{ end }}
|
||||
<link href="{{ .Permalink }}index.xml" rel="self"/>
|
||||
<link href="{{ .Permalink }}"/>{{ if not .Date.IsZero }}
|
||||
<updated>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>{{ end }}
|
||||
<id>{{ .Permalink }}</id>{{ with .Site.Author.name }}
|
||||
<author>
|
||||
<name>{{.}}</name>{{ with $.Site.Author.email }}
|
||||
<email>{{.}}</email>{{end}}
|
||||
</author>{{end}}
|
||||
<generator>Hugo -- gohugo.io</generator>{{ range first 15 (where .Data.Pages "Type" "in" .Site.Params.mainSections) }}
|
||||
<entry>
|
||||
{{ `<title type="html"><![CDATA[` | safeHTML }}{{ .Title }}]]></title>
|
||||
<link href="{{ .Permalink }}"/>
|
||||
<id>{{ .Permalink }}</id>{{ with .Site.Params.Author }}
|
||||
<author>
|
||||
<name>{{.}}</name>
|
||||
</author>{{end}}
|
||||
<published>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</published>
|
||||
<updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
|
||||
{{ `<content type="html"><![CDATA[` | safeHTML }}{{ .Content }}]]></content>
|
||||
</entry>{{ end }}
|
||||
</feed>
|
24
themes/er/layouts/index.html
Normal file
24
themes/er/layouts/index.html
Normal file
|
@ -0,0 +1,24 @@
|
|||
{{ define "main" }}
|
||||
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }}
|
||||
<main class="center mv4 content-width ph3">
|
||||
<ul class="list pa0">
|
||||
{{ range $paginator.Pages }}
|
||||
<li class="mb2">
|
||||
<a class="f4 heading-color heading-font fw6 no-underline" href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
<p class="f5 mt1 silver">
|
||||
<time>{{ .Date.Format "02 Jan 2006" }}</time>
|
||||
{{ if or .Params.tags .Params.categories }} | {{ end }}
|
||||
{{ if isset .Params "categories" }}
|
||||
categories: [ {{ range .Params.categories }}<a href='{{ "/categories/" | relLangURL }}{{ . | urlize }}' class="link silver">{{ . }}</a> {{ end }} ]
|
||||
{{ end }}
|
||||
{{ if isset .Params "tags" }}
|
||||
tags: [ {{ range .Params.tags }}<a href='{{ "/tags/" | relLangURL }}{{ . | urlize }}' class="link silver">{{ . }}</a> {{ end }} ]
|
||||
{{ end }}
|
||||
</p>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</main>
|
||||
{{ partial "tag_cloud.html" . }}
|
||||
{{ partial "pagination.html" . }}
|
||||
{{ end }}
|
3
themes/er/layouts/partials/back-to-top.html
Normal file
3
themes/er/layouts/partials/back-to-top.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
{{ if .Site.Params.showScrollToTop | default true }}
|
||||
<a id="scroll-to-top" class="f6 o-0 link br2 ph2 pv1 mb1 bg-main-color pointer" onclick="topFunction()" style="color: #fff; visibility: hidden; display: none; transition: opacity .5s, visibility .5s;" title="back to top">back to top</a>
|
||||
{{ end }}
|
9
themes/er/layouts/partials/css/variables.css
Normal file
9
themes/er/layouts/partials/css/variables.css
Normal file
|
@ -0,0 +1,9 @@
|
|||
/*https://coolors.co/afd5aa-f0f2ef-a69f98-3d3d3d-8c6057*/
|
||||
:root {
|
||||
--main-color: #8C6056;
|
||||
--secondary-color: #AFD5AA;
|
||||
--logo-text-color: #fff;
|
||||
--body-text-color: #3d3d3d;
|
||||
--heading-text-color: #383838;
|
||||
--background-color: #fff;
|
||||
}
|
5
themes/er/layouts/partials/footer.html
Normal file
5
themes/er/layouts/partials/footer.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
<footer class="content-width mt0 mt5-l mb4 f6 center ph3 gray tc tl-l">
|
||||
<hr class="dn db-l ml0-l gray w3"><br>
|
||||
Powered by <a href="https://gohugo.io/" target="_blank" class="link gray dim">Hugo</a>, based on the <a href="https://github.com/lingxz/er" target="_blank" class="link gray dim">Er</a> theme. <br>
|
||||
{{ with .Site.Copyright }}{{ . }}{{end}}
|
||||
</footer>
|
22
themes/er/layouts/partials/header.html
Normal file
22
themes/er/layouts/partials/header.html
Normal file
|
@ -0,0 +1,22 @@
|
|||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta content='text/html; charset=utf-8' http-equiv='content-type' />
|
||||
{{ partial "open_graph.html" . }}
|
||||
{{ hugo.Generator }}
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600" rel="stylesheet">
|
||||
<style type="text/css">{{ partial "css/variables.css" . | safeCSS }}</style>
|
||||
<link href='{{ "css/tachyons.min.css" | relURL }}' rel="stylesheet">
|
||||
<link href='{{ "css/styles.css" | relURL }}' rel="stylesheet">
|
||||
|
||||
<!-- Icon -->
|
||||
<link rel="icon"
|
||||
{{ if .Site.Params.favicon }}
|
||||
href="{{ .Site.Params.favicon | relURL }}"
|
||||
{{ else }}
|
||||
href='{{ "/favicon.ico" | relURL }}'
|
||||
{{ end }}
|
||||
type="image/x-icon"/>
|
||||
|
||||
<link href='{{ "/feed.xml" | relURL }}' rel="alternate" type="application/atom+xml" title="{{ .Site.Title }}" />
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
12
themes/er/layouts/partials/nav.html
Normal file
12
themes/er/layouts/partials/nav.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<nav class="{{ with .Site.Menus.main }}{{ if lt (len .) 3 }} flex {{ else }} flex-ns{{ end }}{{ end }} justify-between border-box pa3 pl3-l pr2-l mt1 mt0-ns" id="navbar">
|
||||
<div class="flex">
|
||||
<a class="f4 fw6 ttu no-underline dim bg-main-color pv1 ph2 br2" id="site-title" href='{{ "" | relURL }}' title="Home">{{ .Site.Title }}</a>
|
||||
</div>
|
||||
{{ with .Site.Menus.main }}
|
||||
<div class="{{ if lt (len . ) 3 }} flex-grow {{ else }} flex-ns mt2 mt0-ns{{ end }} pv1">
|
||||
{{ range . }}
|
||||
<a class="link dim dark-gray f6 dib mr2 mr3-l ttu tracked" href='{{.URL}}' title="{{ .Name }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</nav>
|
48
themes/er/layouts/partials/open_graph.html
Normal file
48
themes/er/layouts/partials/open_graph.html
Normal file
|
@ -0,0 +1,48 @@
|
|||
{{ if .IsHome }}
|
||||
<title>{{ .Title }}</title>
|
||||
<meta content='{{ .Title }}' property='title' />
|
||||
<meta content='{{ .Title }}' property='og:title' />
|
||||
{{ else }}
|
||||
<title>{{ .Title }} - {{ .Site.Title }}</title>
|
||||
<meta content='{{ .Title }} - {{ .Site.Title }}' property='title' />
|
||||
<meta content='{{ .Title }} - {{ .Site.Title }}' property='og:title' />
|
||||
{{ end }}
|
||||
|
||||
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
|
||||
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
|
||||
<meta property="og:url" content="{{ .Permalink }}" />
|
||||
{{ with .Params.images }}{{ range first 6 . }}
|
||||
<meta property="og:image" content="{{ . | absURL }}" />
|
||||
{{ end }}{{ end }}
|
||||
{{ if .IsPage }}
|
||||
{{ if not .PublishDate.IsZero }}<meta property="article:published_time" content="{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"/>
|
||||
{{ else if not .Date.IsZero }}<meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"/>{{ end }}
|
||||
{{ if not .Lastmod.IsZero }}<meta property="article:modified_time" content="{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"/>{{ end }}
|
||||
{{ else }}
|
||||
{{ if not .Date.IsZero }}<meta property="og:updated_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"/>{{ end }}
|
||||
{{ end }}{{ with .Params.audio }}
|
||||
<meta property="og:audio" content="{{ . }}" />{{ end }}{{ with .Params.locale }}
|
||||
<meta property="og:locale" content="{{ . }}" />{{ end }}{{ with .Site.Params.title }}
|
||||
<meta property="og:site_name" content="{{ . }}" />{{ end }}{{ with .Params.videos }}
|
||||
{{ range .Params.videos }}
|
||||
<meta property="og:video" content="{{ . | absURL }}" />
|
||||
{{ end }}{{ end }}
|
||||
<!-- If it is part of a series, link to related articles -->
|
||||
{{ $permalink := .Permalink }}
|
||||
{{ $siteSeries := .Site.Taxonomies.series }}{{ with .Params.series }}
|
||||
{{ range $name := . }}
|
||||
{{ $series := index $siteSeries $name }}
|
||||
{{ range $page := first 6 $series.Pages }}
|
||||
{{ if ne $page.Permalink $permalink }}<meta property="og:see_also" content="{{ $page.Permalink }}" />{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}{{ end }}
|
||||
{{ if .IsPage }}
|
||||
{{ range .Site.Authors }}{{ with .Social.facebook }}
|
||||
<meta property="article:author" content="https://www.facebook.com/{{ . }}" />{{ end }}{{ with .Site.Social.facebook }}
|
||||
<meta property="article:publisher" content="https://www.facebook.com/{{ . }}" />{{ end }}
|
||||
<meta property="article:section" content="{{ .Section }}" />
|
||||
{{ with .Params.tags }}{{ range first 6 . }}
|
||||
<meta property="article:tag" content="{{ . }}" />{{ end }}{{ end }}
|
||||
{{ end }}{{ end }}
|
||||
<!-- Facebook Page Admin ID for Domain Insights -->
|
||||
{{ with .Site.Social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }}
|
9
themes/er/layouts/partials/pagination.html
Normal file
9
themes/er/layouts/partials/pagination.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
{{ if gt .Paginator.TotalPages 1 }}
|
||||
<div class="pagination tc db fixed-l bottom-2-l right-2-l mb3 mb0-l">
|
||||
{{ partial "back-to-top.html" . }}<br>
|
||||
<p class="mb0 mt2">Page {{ .Paginator.PageNumber }} of {{ .Paginator.TotalPages }} <br>
|
||||
{{ if .Paginator.HasNext }}<a href="{{ .Paginator.Next.URL | relURL }}">Older Posts</a>{{ end }}
|
||||
{{ if .Paginator.HasPrev }}<a href="{{ .Paginator.Prev.URL | relURL }}">Newer Posts</a>{{ end }}
|
||||
</p>
|
||||
</div>
|
||||
{{ end }}
|
101
themes/er/layouts/partials/scripts.html
Normal file
101
themes/er/layouts/partials/scripts.html
Normal file
|
@ -0,0 +1,101 @@
|
|||
{{ if .Site.Params.showtoc | default true }}
|
||||
{{ $headers := findRE "<h[1-6].*?>(.|\n])+?</h[1-6]>" .Content }}
|
||||
{{ $has_headers := ge (len $headers) 1 }}
|
||||
{{ if and $has_headers (ne .Params.toc false) }}
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.4.2/tocbot.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.4.2/tocbot.css">
|
||||
<style>.is-active-link::before { background-color: var(--secondary-color); }</style>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if or (.Site.Params.showTagCloud | default true) (.Site.Params.showtoc | default true) (.Site.Params.showScrollToTop | default true) }}
|
||||
<script type="text/javascript">
|
||||
var prevScrollpos = window.pageYOffset;
|
||||
window.onscroll = function() {
|
||||
var currentScrollPos = window.pageYOffset;
|
||||
|
||||
{{ if .Site.Params.showTagCloud | default true }}
|
||||
if (document.getElementById("tag-cloud") !== null) {
|
||||
if (prevScrollpos > currentScrollPos) { // scroll up
|
||||
document.getElementById("tag-cloud").style.visibility = "visible";
|
||||
document.getElementById("tag-cloud").style.opacity = "1";
|
||||
} else {
|
||||
document.getElementById("tag-cloud").style.visibility = "hidden";
|
||||
document.getElementById("tag-cloud").style.opacity = "0";
|
||||
}
|
||||
}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.showScrollToTop | default true }}
|
||||
if (document.body.scrollTop > 1000 || document.documentElement.scrollTop > 1000) {
|
||||
document.getElementById("scroll-to-top").style.display = "inline";
|
||||
document.getElementById("scroll-to-top").style.visibility = "visible";
|
||||
document.getElementById("scroll-to-top").style.opacity = "1";
|
||||
} else {
|
||||
document.getElementById("scroll-to-top").style.visibility = "hidden";
|
||||
document.getElementById("scroll-to-top").style.opacity = "0";
|
||||
}
|
||||
{{ end }}
|
||||
prevScrollpos = currentScrollPos;
|
||||
}
|
||||
{{ if .Site.Params.showScrollToTop | default true }}
|
||||
// When the user clicks on the button, scroll to the top of the document
|
||||
function topFunction() {
|
||||
document.body.scrollTop = 0; // For Safari
|
||||
document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
|
||||
}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.showtoc | default true }}
|
||||
{{ $headers := findRE "<h[1-6].*?>(.|\n])+?</h[1-6]>" .Content }}
|
||||
{{ $has_headers := ge (len $headers) 1 }}
|
||||
{{ if and $has_headers (ne .Params.toc false) }}
|
||||
if (document.getElementById("contents-list") !== null && document.getElementsByClassName("post-content").length !== 0) {
|
||||
tocbot.init({
|
||||
// Where to render the table of contents.
|
||||
tocSelector: '#contents-list',
|
||||
// Where to grab the headings to build the table of contents.
|
||||
contentSelector: '.post-content',
|
||||
// Which headings to grab inside of the contentSelector element.
|
||||
headingSelector: 'h1, h2, h3',
|
||||
});
|
||||
}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</script>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.math }}
|
||||
<!-- Load KaTeX -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/contrib/auto-render.min.js" integrity="sha384-dq1/gEHSxPZQ7DdrM82ID4YVol9BYyU7GbWlIwnwyPzotpoc57wDw/guX8EaYGPx" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.css">
|
||||
<script>
|
||||
renderMathInElement(document.body,
|
||||
{
|
||||
delimiters: [
|
||||
{left: "$$", right: "$$", display: true},
|
||||
{left: "$", right: "$", display: false},
|
||||
]
|
||||
}
|
||||
);
|
||||
|
||||
var inlineMathArray = document.querySelectorAll("script[type='math/tex']");
|
||||
for (var i = 0; i < inlineMathArray.length; i++) {
|
||||
var inlineMath = inlineMathArray[i];
|
||||
var tex = inlineMath.innerText || inlineMath.textContent;
|
||||
var replaced = document.createElement("span");
|
||||
replaced.innerHTML = katex.renderToString(tex, {displayMode: false});
|
||||
inlineMath.parentNode.replaceChild(replaced, inlineMath);
|
||||
}
|
||||
|
||||
var displayMathArray = document.querySelectorAll("script[type='math/tex; mode=display']");
|
||||
for (var i = 0; i < displayMathArray.length; i++) {
|
||||
var displayMath = displayMathArray[i];
|
||||
var tex = displayMath.innerHTML;
|
||||
var replaced = document.createElement("span");
|
||||
replaced.innerHTML = katex.renderToString(tex.replace(/%.*/g, ''), {displayMode: true});
|
||||
displayMath.parentNode.replaceChild(replaced, displayMath);
|
||||
}
|
||||
</script>
|
||||
{{end}}
|
9
themes/er/layouts/partials/table-of-contents.html
Normal file
9
themes/er/layouts/partials/table-of-contents.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
<!-- ignore empty links with + -->
|
||||
{{ $headers := findRE "<h[1-6].*?>(.|\n])+?</h[1-6]>" .Content }}
|
||||
<!-- at least one header to link to -->
|
||||
{{ $has_headers := ge (len $headers) 1 }}
|
||||
<!-- a post can explicitly disable Table of Contents with toc: false -->
|
||||
{{ $show_toc := and (ne .Params.toc false) (ne .Site.Params.showtoc false) }}
|
||||
{{ if and $has_headers $show_toc }}
|
||||
<div class="tl fixed list-pages lh-copy" id="contents-list"></div>
|
||||
{{ end }}
|
9
themes/er/layouts/partials/tag_cloud.html
Normal file
9
themes/er/layouts/partials/tag_cloud.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
{{ $maxtags := .Site.Params.maxTags | default 50 }}
|
||||
{{ if .Site.Params.showTagCloud | default true }}
|
||||
<div class="dn tr fixed right-2" id="tag-cloud">
|
||||
tags <br>
|
||||
{{ range first $maxtags .Site.Taxonomies.tags.ByCount }}
|
||||
<a class="silver no-underline" href="{{ "/tags/" | relLangURL }}{{ .Name | urlize }}">{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
Loading…
Add table
Add a link
Reference in a new issue