added cactus theme files
This commit is contained in:
20
hugo-content/themes/cactus/layouts/_default/baseof.html
Normal file
20
hugo-content/themes/cactus/layouts/_default/baseof.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.LanguageCode }}">
|
||||
{{ partial "head.html" . }}
|
||||
<body class="max-width mx-auto px3 ltr">
|
||||
<div class="content index py4">
|
||||
|
||||
{{ partial "header.html" . }}
|
||||
|
||||
{{ block "main" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "footer.html" . }}
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<link rel="stylesheet" href={{ "lib/font-awesome/css/all.min.css" | relURL }}>
|
||||
<script src={{ "lib/jquery/jquery.min.js" | relURL }}></script>
|
||||
<script src={{ "js/main.js" | relURL }}></script>
|
||||
</html>
|
||||
30
hugo-content/themes/cactus/layouts/_default/list.html
Normal file
30
hugo-content/themes/cactus/layouts/_default/list.html
Normal file
@@ -0,0 +1,30 @@
|
||||
{{ define "main"}}
|
||||
<div id="archive">
|
||||
<ul class="post-list">
|
||||
|
||||
{{ $pages := .Paginator.Pages }}
|
||||
{{ if .Site.Params.showAllPostsArchive }}
|
||||
{{ $pages = .Pages }}
|
||||
{{ end }}
|
||||
|
||||
{{ range (sort $pages "Date" "desc") }}
|
||||
{{ $pageYear := (.Date.Format "2006") }}
|
||||
{{ if (ne $pageYear ($.Scratch.Get "year")) }}
|
||||
{{ $.Scratch.Set "year" $pageYear }}
|
||||
<h2>{{ $pageYear }}</h2>
|
||||
{{ end }}
|
||||
<li class="post-item">
|
||||
<div class="meta">
|
||||
<time datetime="{{ time .Date }}" itemprop="datePublished">{{ .Date.Format (.Site.Params.dateFormat | default "2006-01-02") }}</time>
|
||||
</div>
|
||||
<span>
|
||||
<a class="" href="{{ .Permalink }}">{{ if .Title }} {{ .Title }} {{ else }} Untitled {{ end }}</a>
|
||||
</span>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ if eq .Site.Params.showAllPostsArchive false }}
|
||||
{{ partial "pagination.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
12
hugo-content/themes/cactus/layouts/_default/single.html
Normal file
12
hugo-content/themes/cactus/layouts/_default/single.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{ define "main" }}
|
||||
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
|
||||
<!-- TODO: gallery -->
|
||||
<div class="content" itemprop="articleBody">
|
||||
{{ if (eq .Type "search") }}
|
||||
<!-- TODO: search https://gohugo.io/tools/search/ -->
|
||||
{{ else }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</article>
|
||||
{{ end }}
|
||||
41
hugo-content/themes/cactus/layouts/_default/terms.html
Normal file
41
hugo-content/themes/cactus/layouts/_default/terms.html
Normal file
@@ -0,0 +1,41 @@
|
||||
{{ define "main" }}
|
||||
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
|
||||
<div class="content" itemprop="articleBody">
|
||||
{{ if (eq .Type "tags")}}
|
||||
<div id="tag-cloud">
|
||||
{{ if (eq (len .Data.Terms) 0) }}
|
||||
<div class="tag-cloud-title">
|
||||
No tags
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="tag-cloud-tags">
|
||||
{{ $AllRegularPagesCount := len .Site.RegularPages }}
|
||||
{{ range $elem := .Data.Terms.Alphabetical }}
|
||||
<a style="font-size: {{ (add 0.8 (mul 15 (div (float $elem.Count) $AllRegularPagesCount))) }}rem;" href="{{ $elem.Page.Permalink }}">
|
||||
{{- .Page.Title -}}
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ else if (eq .Type "categories")}}
|
||||
<div id="categories">
|
||||
{{ if (eq (len .Data.Terms) 0) }}
|
||||
<div class="category-list-title">
|
||||
No categories
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="category-list">
|
||||
<ul class="category-list">
|
||||
{{ range .Data.Terms.Alphabetical }}
|
||||
<li class="category-list-item">
|
||||
<a class="category-list-link" href="{{ .Page.Permalink }}">{{ .Page.Title }}</a>
|
||||
<span class="category-list-count">{{ .Count }}</span>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</article>
|
||||
{{ end }}
|
||||
111
hugo-content/themes/cactus/layouts/index.html
Normal file
111
hugo-content/themes/cactus/layouts/index.html
Normal file
@@ -0,0 +1,111 @@
|
||||
{{ define "main" }}
|
||||
<section id="about">
|
||||
{{ if isset .Site.Params "description" }}
|
||||
{{ .Site.Params.description | $.Page.RenderString }}
|
||||
{{ end }}
|
||||
{{ if isset .Site.Params "social" }}
|
||||
<p>Find me on
|
||||
{{ $length := (len .Site.Params.social) }}
|
||||
{{ range $index, $elem := .Site.Params.social}}
|
||||
{{ if eq $elem.name "email" }}
|
||||
<a class="icon" target="_blank" rel="noopener" href="mailto:{{ $elem.link }}" aria-label="Email">
|
||||
<i class="fas fa-envelope" aria-hidden="true"></i>
|
||||
</a>
|
||||
{{ else if eq $elem.name "rss" }}
|
||||
<a class="icon" target="_blank" rel="noopener" href="{{ $elem.link }}" aria-label="RSS">
|
||||
<i class="fas fa-rss" aria-hidden="true"></i>
|
||||
</a>
|
||||
{{ else if eq $elem.name "scholar" }}
|
||||
<a class="icon" target="_blank" rel="noopener" href="{{ $elem.link }}" aria-label="Google Scholar">
|
||||
<i class="fas fa-graduation-cap" aria-hidden="true"></i>
|
||||
</a>
|
||||
{{ else }}
|
||||
<a class="icon" target="_blank" rel="noopener" href="{{ $elem.link }}" aria-label="{{ $elem.name }}">
|
||||
<i class="fab fa-{{ lower $elem.name }}" aria-hidden="true"></i>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ if (lt (add $index 2) $length) }}
|
||||
{{- print " , " -}}
|
||||
{{ else if (lt (add $index 1) $length) }}
|
||||
{{- print " and " -}}
|
||||
{{ else }}
|
||||
{{- print "." -}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</p>
|
||||
{{ end }}
|
||||
{{ partial "optional-about.html" . }}
|
||||
</section>
|
||||
|
||||
<section id="writing">
|
||||
<span class="h1"><a href="{{ .Site.Params.mainSection | absURL }}">{{ .Site.Params.mainSectionTitle | default "Writings" }}</a></span>
|
||||
{{ if (and (and (isset .Site.Params "tagsoverview") (eq .Site.Params.tagsOverview true)) (gt (len .Site.Taxonomies.tags) 0)) }}
|
||||
<span class="h2">Topics</span>
|
||||
<span class="widget tagcloud">
|
||||
{{ $AllRegularPagesCount := len .Site.RegularPages }}
|
||||
{{ range $elem := .Site.Taxonomies.tags.Alphabetical }}
|
||||
<a style="font-size: {{ (add 0.5 (mul 5 (div (float $elem.Count) $AllRegularPagesCount))) }}rem;" href="{{ $elem.Page.Permalink }}">
|
||||
{{- .Page.Title -}}
|
||||
</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
<span class="h2">Most recent</span>
|
||||
{{ end }}
|
||||
|
||||
{{ $showAllPostsOnHomePage := false }}
|
||||
{{ if (isset .Site.Params "showallpostsonhomepage") }}
|
||||
{{ $showAllPostsOnHomePage = .Site.Params.ShowAllPostsOnHomePage }}
|
||||
{{ end }}
|
||||
{{ $dataFormat := .Site.Params.dateFormat | default "2006-01-02" }}
|
||||
{{ $mainPosts := (sort ( where site.RegularPages "Type" "in" site.Params.mainSections ) "Date" "desc") }}
|
||||
{{ if $showAllPostsOnHomePage }}
|
||||
<ul class="post-list">
|
||||
{{ range (.Paginate $mainPosts).Pages }}
|
||||
<li class="post-item">
|
||||
<div class="meta"><time datetime="{{ time .Date }}" itemprop="datePublished">{{ .Date.Format $dataFormat }}</time></div>
|
||||
<span><a href="{{ .Permalink }}">{{ if .Title }} {{- .Title -}} {{ else }} {{- print "Untitled" -}}{{ end }}</a></span>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
|
||||
{{ else }}
|
||||
<ul class="post-list">
|
||||
{{ .Scratch.Set "count" 5 }}
|
||||
{{ if isset .Site.Params "postsonhomepage" }}
|
||||
{{ .Scratch.Set "count" .Site.Params.postsOnHomePage }}
|
||||
{{ end }}
|
||||
{{ range (first (.Scratch.Get "count") $mainPosts) }}
|
||||
<li class="post-item">
|
||||
<div class="meta"><time datetime="{{ time .Date }}" itemprop="datePublished">{{ .Date.Format $dataFormat }}</time></div>
|
||||
<span><a href="{{ .Permalink }}">{{ if .Title }} {{- .Title -}} {{ else }} {{- print "Untitled" -}}{{ end }}</a></span>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
</section>
|
||||
|
||||
{{ $showProjectsList := false }}
|
||||
{{ if (isset .Site.Params "showprojectslist") }}
|
||||
{{ $showProjectsList = .Site.Params.showProjectsList }}
|
||||
{{ else if .Site.Data.projects }}
|
||||
{{ $showProjectsList = true }}
|
||||
{{ end }}
|
||||
{{ if $showProjectsList }}
|
||||
{{ $projectsUrl := "#" }}
|
||||
{{ if isset .Site.Params "projectsurl" }}
|
||||
{{ $projectsUrl = .Site.Params.projectsUrl }}
|
||||
{{ end }}
|
||||
<section id="projects">
|
||||
<span class="h1"><a href="{{ $projectsUrl }}">Projects</a></span>
|
||||
<ul class="project-list">
|
||||
{{ range .Site.Data.projects.list }}
|
||||
<li class="project-item">
|
||||
<a href="{{ .url }}">{{ .name }}</a>: {{ .desc | markdownify }}
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</section>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
22
hugo-content/themes/cactus/layouts/partials/comments.html
Normal file
22
hugo-content/themes/cactus/layouts/partials/comments.html
Normal file
@@ -0,0 +1,22 @@
|
||||
{{ if (not (isset .Site.Params "comments")) }}
|
||||
{{ .Scratch.Set "enable_comments" false }}
|
||||
{{ else if (isset .Params "comments") }}
|
||||
{{ .Scratch.Set "enable_comments" .Params.comments }}
|
||||
{{ else if (isset .Site.Params.Comments "enabled") }}
|
||||
{{ .Scratch.Set "enable_comments" .Site.Params.Comments.Enabled }}
|
||||
{{ else }}
|
||||
{{ .Scratch.Set "enable_comments" true }}
|
||||
{{ end }}
|
||||
|
||||
{{ $enable_comments := .Scratch.Get "enable_comments" }}
|
||||
{{ if $enable_comments }}
|
||||
<div class="blog-post-comments">
|
||||
{{ if (or (not (isset .Site.Params.Comments "engine")) (eq .Site.Params.Comments.Engine "disqus")) }}
|
||||
{{ partial "comments/disqus.html" . }}
|
||||
{{ else if eq .Site.Params.Comments.Engine "utterances" }}
|
||||
{{ partial "comments/utterances.html" . }}
|
||||
{{ else if eq .Site.Params.Comments.Engine "cactus_comments" }}
|
||||
{{ partial "comments/cactus_comments.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,11 @@
|
||||
<div id="cactus-comments-thread">
|
||||
<script>
|
||||
initComments({
|
||||
node: document.getElementById("cactus-comments-thread"),
|
||||
defaultHomeserverUrl: '{{ default "https://matrix.cactus.chat:8448" .Site.Params.Comments.Cactuscomments.ServerUrl }}',
|
||||
serverName: '{{ default "cactus.chat" .Site.Params.Comments.Cactuscomments.ServerName }}',
|
||||
siteName: "{{ .Site.Params.Comments.Cactuscomments.SiteName }}",
|
||||
commentSectionId: "{{ .RelPermalink }}"
|
||||
})
|
||||
</script>
|
||||
</div>
|
||||
@@ -0,0 +1,17 @@
|
||||
<div id="disqus_thread">
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
// Don't ever inject Disqus on localhost--it creates unwanted
|
||||
// discussions from 'localhost:1313' on your Disqus account...
|
||||
// if (window.location.hostname == "localhost")
|
||||
// return;
|
||||
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
var disqus_shortname = '{{ if .Site.DisqusShortname }}{{ .Site.DisqusShortname }}{{ else }}{{ .Site.Title }}{{ end }}';
|
||||
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||
<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
||||
</div>
|
||||
@@ -0,0 +1,10 @@
|
||||
<div id="disquss_thread">
|
||||
<script src="https://utteranc.es/client.js"
|
||||
repo="{{ .Site.Params.Comments.Utterances.Repo }}"
|
||||
issue-term="pathname"
|
||||
label="{{ .Site.Params.Comments.Utterances.Label }}"
|
||||
theme="{{ .Site.Params.Comments.Utterances.Theme }}"
|
||||
crossorigin="anonymous"
|
||||
async>
|
||||
</script>
|
||||
</div>
|
||||
2
hugo-content/themes/cactus/layouts/partials/favicon.html
Normal file
2
hugo-content/themes/cactus/layouts/partials/favicon.html
Normal file
@@ -0,0 +1,2 @@
|
||||
<!-- TODO -->
|
||||
<link rel="icon" type="image/png" href="{{ "images/favicon.ico" | absURL }}" />
|
||||
14
hugo-content/themes/cactus/layouts/partials/footer.html
Normal file
14
hugo-content/themes/cactus/layouts/partials/footer.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<footer id="footer">
|
||||
<div class="footer-left">
|
||||
Copyright © {{ now.Format "2006" }} {{ if .Site.Copyright }} {{ print .Site.Copyright | markdownify }} {{ else }} {{ print .Site.Title }} {{ end }}
|
||||
</div>
|
||||
<div class="footer-right">
|
||||
<nav>
|
||||
<ul>
|
||||
{{ range .Site.Menus.main }}
|
||||
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</footer>
|
||||
50
hugo-content/themes/cactus/layouts/partials/head.html
Normal file
50
hugo-content/themes/cactus/layouts/partials/head.html
Normal file
@@ -0,0 +1,50 @@
|
||||
<head>
|
||||
<link rel="preload" href="{{ "lib/font-awesome/webfonts/fa-brands-400.woff2" | relURL }}" as="font" type="font/woff2" crossorigin="anonymous">
|
||||
<link rel="preload" href="{{ "lib/font-awesome/webfonts/fa-regular-400.woff2" | relURL }}" as="font" type="font/woff2" crossorigin="anonymous">
|
||||
<link rel="preload" href="{{ "lib/font-awesome/webfonts/fa-solid-900.woff2" | relURL }}" as="font" type="font/woff2" crossorigin="anonymous">
|
||||
<link rel="preload" href="{{ "lib/JetBrainsMono/web/woff2/JetBrainsMono-Regular.woff2" | relURL }}" as="font" type="font/woff2" crossorigin="anonymous">
|
||||
<script type="text/javascript" src="https://latest.cactus.chat/cactus.js"></script>
|
||||
<link rel="stylesheet" href="https://latest.cactus.chat/style.css" type="text/css">
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>{{ if .IsPage }} {{ .Title }} | {{ end }}{{ .Site.Title }}</title>
|
||||
<link rel = 'canonical' href = '{{ .Permalink }}'>
|
||||
{{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }}
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="robots" content="all,follow">
|
||||
<meta name="googlebot" content="index,follow,snippet,archive">
|
||||
{{ template "_internal/opengraph.html" . }}
|
||||
{{ template "_internal/twitter_cards.html" . }}
|
||||
{{ .Scratch.Set "colortheme" "white"}}
|
||||
{{ if .Site.Params.Colortheme }}
|
||||
{{ .Scratch.Set "colortheme" .Site.Params.Colortheme }}
|
||||
{{ end }}
|
||||
{{ $colortheme := .Scratch.Get "colortheme" }}
|
||||
|
||||
{{- $options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" "true") -}}
|
||||
{{- $styles := resources.Get "scss/style.scss" | resources.ExecuteAsTemplate "scss/style.scss" . | resources.ToCSS $options | resources.Fingerprint "sha512" }}
|
||||
<link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}">
|
||||
|
||||
<!-- Custom CSS -->
|
||||
{{ range .Site.Params.css }} <link rel="stylesheet" href="{{ . | absURL }}"> {{ end }}
|
||||
{{ `
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
` | safeHTML }}
|
||||
|
||||
{{ partial "favicon.html" . }}
|
||||
{{ if .Site.Params.rss }}
|
||||
{{ with .OutputFormats.Get "RSS" }}
|
||||
{{ printf `<link href="%s" rel="%s" type="%s" title="%s" />` .Permalink .Rel .MediaType.Type $.Site.Title | safeHTML }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if .Site.GoogleAnalytics }}
|
||||
{{ if .Site.Params.googleAnalyticsAsync }}
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
{{ else }}
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</head>
|
||||
25
hugo-content/themes/cactus/layouts/partials/header.html
Normal file
25
hugo-content/themes/cactus/layouts/partials/header.html
Normal file
@@ -0,0 +1,25 @@
|
||||
<header id="header">
|
||||
<a href="{{ .Site.BaseURL }}">
|
||||
{{ if (isset .Site.Params "gravatar") }}
|
||||
<div id="logo" style="background-image: url(https://www.gravatar.com/avatar/{{ md5 .Site.Params.gravatar }}?s=100&d=identicon)"></div>
|
||||
{{ else if (isset .Site.Params "logo") }}
|
||||
<div id="logo" style="background-image: url({{ .Site.Params.logo | absURL }})"></div>
|
||||
{{ else }}
|
||||
<div id="logo" style="background-image: url({{ "images/logo.png" | absURL }})"></div>
|
||||
{{ end}}
|
||||
<div id="title">
|
||||
<h1>{{ .Site.Title }}</h1>
|
||||
</div>
|
||||
</a>
|
||||
<div id="nav">
|
||||
<ul>
|
||||
<li class="icon">
|
||||
<a href="#" aria-label="Menu"><i class="fas fa-bars fa-2x" aria-hidden="true"></i></a>
|
||||
</li>
|
||||
{{ range .Site.Menus.main }}
|
||||
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
57
hugo-content/themes/cactus/layouts/partials/page_nav.html
Normal file
57
hugo-content/themes/cactus/layouts/partials/page_nav.html
Normal file
@@ -0,0 +1,57 @@
|
||||
<div id="header-post">
|
||||
<a id="menu-icon" href="#"><i class="fas fa-bars fa-lg"></i></a>
|
||||
<a id="menu-icon-tablet" href="#"><i class="fas fa-bars fa-lg"></i></a>
|
||||
<a id="top-icon-tablet" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');" style="display:none;" aria-label="Top of Page"><i class="fas fa-chevron-up fa-lg"></i></a>
|
||||
<span id="menu">
|
||||
<span id="nav">
|
||||
<ul>
|
||||
{{ range .Site.Menus.main }}
|
||||
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</span>
|
||||
<br/>
|
||||
<span id="actions">
|
||||
<ul>
|
||||
{{ if .Prev }}
|
||||
<li>
|
||||
<a class="icon" href=" {{ .Prev.Permalink }}" aria-label="Previous">
|
||||
<i class="fas fa-chevron-left" aria-hidden="true" onmouseover="$('#i-prev').toggle();" onmouseout="$('#i-prev').toggle();"></i>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ if .Next }}
|
||||
<li>
|
||||
<a class="icon" href="{{ .Next.Permalink }}" aria-label="Next">
|
||||
<i class="fas fa-chevron-right" aria-hidden="true" onmouseover="$('#i-next').toggle();" onmouseout="$('#i-next').toggle();"></i>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
<li>
|
||||
<a class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');" aria-label="Top of Page">
|
||||
<i class="fas fa-chevron-up" aria-hidden="true" onmouseover="$('#i-top').toggle();" onmouseout="$('#i-top').toggle();"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="icon" href="#" aria-label="Share">
|
||||
<i class="fas fa-share-alt" aria-hidden="true" onmouseover="$('#i-share').toggle();" onmouseout="$('#i-share').toggle();" onclick="$('#share').toggle();return false;"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<span id="i-prev" class="info" style="display:none;">Previous post</span>
|
||||
<span id="i-next" class="info" style="display:none;">Next post</span>
|
||||
<span id="i-top" class="info" style="display:none;">Back to top</span>
|
||||
<span id="i-share" class="info" style="display:none;">Share post</span>
|
||||
</span>
|
||||
<br/>
|
||||
<div id="share" style="display: none">
|
||||
{{ .Scratch.Set "icon_class_name" ""}}
|
||||
{{ partial "share.html" . }}
|
||||
</div>
|
||||
{{ if not .Site.Params.tocInline }}
|
||||
<div id="toc">
|
||||
{{ .TableOfContents }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</span>
|
||||
</div>
|
||||
@@ -0,0 +1,38 @@
|
||||
<div id="footer-post-container">
|
||||
<div id="footer-post">
|
||||
|
||||
<div id="nav-footer" style="display: none">
|
||||
<ul>
|
||||
{{ range .Site.Menus.main }}
|
||||
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{{ if not .Site.Params.tocInline }}
|
||||
<div id="toc-footer" style="display: none">
|
||||
{{ .TableOfContents }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<div id="share-footer" style="display: none">
|
||||
{{ .Scratch.Set "icon_class_name" "fa-lg" }}
|
||||
{{ partial "share.html" . }}
|
||||
</div>
|
||||
|
||||
<div id="actions-footer">
|
||||
<!-- TODO: rewrite the toggle function. hide the others when one menu is displayed -->
|
||||
<a id="menu-toggle" class="icon" href="#" onclick="$('#nav-footer').toggle();return false;" aria-label="Menu">
|
||||
<i class="fas fa-bars fa-lg" aria-hidden="true"></i> Menu</a>
|
||||
{{ if not .Site.Params.tocInline }}
|
||||
<a id="toc-toggle" class="icon" href="#" onclick="$('#toc-footer').toggle();return false;" aria-label="TOC">
|
||||
<i class="fas fa-list fa-lg" aria-hidden="true"></i> TOC</a>
|
||||
{{ end }}
|
||||
<a id="share-toggle" class="icon" href="#" onclick="$('#share-footer').toggle();return false;" aria-label="Share">
|
||||
<i class="fas fa-share-alt fa-lg" aria-hidden="true"></i> share</a>
|
||||
<a id="top" style="display:none" class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');" aria-label="Top of Page">
|
||||
<i class="fas fa-chevron-up fa-lg" aria-hidden="true"></i> Top</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
13
hugo-content/themes/cactus/layouts/partials/pagination.html
Normal file
13
hugo-content/themes/cactus/layouts/partials/pagination.html
Normal file
@@ -0,0 +1,13 @@
|
||||
{{ $pag := $.Paginator }}
|
||||
{{ if gt $pag.TotalPages 1 }}
|
||||
<div class="pagination">
|
||||
{{ if $pag.HasPrev }}
|
||||
<a href="{{ $pag.Prev.URL }}"><i class="fas fa-angle-left"></i></a>
|
||||
{{ end }}
|
||||
<span class="page-number">Page {{ $pag.PageNumber }} of {{ $pag.TotalPages }}</span>
|
||||
{{ if $pag.HasNext }}
|
||||
<a href="{{ $pag.Next.URL }}"><i class="fas fa-angle-right"></i>
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
54
hugo-content/themes/cactus/layouts/partials/share.html
Normal file
54
hugo-content/themes/cactus/layouts/partials/share.html
Normal file
@@ -0,0 +1,54 @@
|
||||
<ul>
|
||||
{{ $icon_class_name := .Scratch.Get "icon_class_name"}}
|
||||
{{ if .Description }}
|
||||
{{ .Scratch.Set "description" .Description }}
|
||||
{{ else }}
|
||||
{{ .Scratch.Set "description" .Summary }}
|
||||
{{ end }}
|
||||
{{ $description := .Scratch.Get "description" }}
|
||||
<li>
|
||||
<a class="icon" href="http://www.facebook.com/sharer.php?u={{ .Permalink }}" aria-label="Facebook">
|
||||
<i class="fab fa-facebook {{ $icon_class_name }}" aria-hidden="true"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="icon" href="https://twitter.com/share?url={{ .Permalink }}&text={{ .Title }}" aria-label="Twitter">
|
||||
<i class="fab fa-twitter {{ $icon_class_name }}" aria-hidden="true"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="icon" href="http://www.linkedin.com/shareArticle?url={{ .Permalink }}&title={{ .Title }}" aria-label="Linkedin">
|
||||
<i class="fab fa-linkedin {{ $icon_class_name }}" aria-hidden="true"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="icon" href="https://pinterest.com/pin/create/bookmarklet/?url={{ .Permalink }}&is_video=false&description={{ .Title }}" aria-label="Pinterest">
|
||||
<i class="fab fa-pinterest {{ $icon_class_name }}" aria-hidden="true"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="icon" href="mailto:?subject={{ .Title }}&body=Check out this article: {{ .Permalink }}" aria-label="Email">
|
||||
<i class="fas fa-envelope {{ $icon_class_name }}" aria-hidden="true"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="icon" href="https://getpocket.com/save?url={{ .Permalink }}&title={{ .Title }}" aria-label="Pocket">
|
||||
<i class="fab fa-get-pocket {{ $icon_class_name }}" aria-hidden="true"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="icon" href="http://reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}" aria-label="reddit">
|
||||
<i class="fab fa-reddit {{ $icon_class_name }}" aria-hidden="true"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="icon" href="http://www.tumblr.com/share/link?url={{ .Permalink }}&name={{ .Title }}&description={{ $description }}" aria-label="Tumblr">
|
||||
<i class="fab fa-tumblr {{ $icon_class_name }}" aria-hidden="true"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="icon" href="https://news.ycombinator.com/submitlink?u={{ .Permalink }}&t={{ .Title }}" aria-label="Hacker News">
|
||||
<i class="fab fa-hacker-news {{ $icon_class_name }}" aria-hidden="true"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
117
hugo-content/themes/cactus/layouts/posts/single.html
Normal file
117
hugo-content/themes/cactus/layouts/posts/single.html
Normal file
@@ -0,0 +1,117 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.LanguageCode }}">
|
||||
{{ partial "head.html" . }}
|
||||
<body class="max-width mx-auto px3 ltr">
|
||||
<div class="content index py4">
|
||||
|
||||
{{ partial "page_nav.html" . }}
|
||||
|
||||
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
|
||||
<header>
|
||||
<h1 class="posttitle" itemprop="name headline">
|
||||
{{ .Title }}
|
||||
</h1>
|
||||
<div class="meta">
|
||||
{{ if (or (isset .Site "author") (isset .Site "title"))}}
|
||||
<span class="author" itemprop="author" itemscope itemtype="http://schema.org/Person">
|
||||
<span itemprop="name">
|
||||
{{ if isset .Site "author" }}
|
||||
{{ .Site.Author }}
|
||||
{{ else if isset .Site "title" }}
|
||||
{{ .Site.Title }}
|
||||
{{ end }}
|
||||
</span>
|
||||
</span>
|
||||
{{ end }}
|
||||
<div class="postdate">
|
||||
{{ $dataFormat := .Site.Params.dateFormat | default "2006-01-02" }}
|
||||
<time datetime="{{ .Date }}" itemprop="datePublished">{{ .Date.Format $dataFormat }}</time>
|
||||
{{ if (and .Site.Params.show_updated (ne .Lastmod .Date)) }}
|
||||
(Updated: <time datetime="{{ .Lastmod }}" itemprop="dateModified">{{ .Lastmod.Format $dataFormat }}</time>)
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ $showReadTime := .Site.Params.showReadTime | default false }}
|
||||
{{if $showReadTime}}
|
||||
<div class="article-read-time">
|
||||
<i class="far fa-clock"></i>
|
||||
{{ $readTime := math.Round (div (countwords .Content) 220.0) }}
|
||||
{{ $readTime }} minute read
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ if gt .Params.categories 0 }}
|
||||
<div class="article-category">
|
||||
<i class="fas fa-archive"></i>
|
||||
{{ range $index, $value := .Params.categories }}
|
||||
{{ if gt $index 0 }} {{ print ", " }} {{ end }}
|
||||
<a class="category-link" href="{{ "/categories/" | relLangURL }}{{ $value | urlize }}">{{ $value }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ if gt .Params.tags 0 }}
|
||||
<div class="article-tag">
|
||||
<i class="fas fa-tag"></i>
|
||||
{{ range $index, $value := .Params.tags }}
|
||||
{{ if gt $index 0 }} {{ print ", " }} {{ end }}
|
||||
<a class="tag-link" href="{{ "/tags/" | relLangURL }}{{ $value | urlize }}" rel="tag">{{ $value }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{{ with .Resources.ByType "image" }}
|
||||
<div class="article-gallery">
|
||||
{{ range $index, $value := . }}
|
||||
<a class="gallery-item" href="{{ .RelPermalink }}" rel="gallery_{{ $index }}">
|
||||
<img src="{{ .RelPermalink }}" itemprop="image" />
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ if .Site.Params.tocInline }}
|
||||
<div id="toc">
|
||||
{{ .TableOfContents }}
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="content" itemprop="articleBody">
|
||||
{{ .Content}}
|
||||
</div>
|
||||
</article>
|
||||
|
||||
{{ partial "comments.html" . }}
|
||||
|
||||
{{ partial "page_nav_mobile.html" . }}
|
||||
|
||||
{{ partial "footer.html" . }}
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<link rel="stylesheet" href={{ "/lib/font-awesome/css/all.min.css" | relURL }}>
|
||||
<script src={{ "/lib/jquery/jquery.min.js" | relURL }}></script>
|
||||
<script src={{ "/js/main.js" | relURL }}></script>
|
||||
{{ if not (isset site.Params "disablecopy") }}
|
||||
<script src={{ "js/code-copy.js" | relURL }}></script>
|
||||
{{ end }}
|
||||
{{ $mathjax := false }}
|
||||
{{ if isset .Params "mathjax" }}
|
||||
{{ $mathjax = .Params.mathjax }}
|
||||
{{ else if isset .Site.Params "mathjax" }}
|
||||
{{ $mathjax = .Site.Params.mathjax }}
|
||||
{{ end }}
|
||||
{{ if $mathjax }}
|
||||
<script>
|
||||
MathJax = {
|
||||
tex: {
|
||||
inlineMath: [['$', '$'], ['\\(', '\\)']]
|
||||
},
|
||||
svg: {
|
||||
fontCache: 'global'
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" id="MathJax-script" async
|
||||
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
|
||||
</script>
|
||||
{{ end }}
|
||||
</html>
|
||||
Reference in New Issue
Block a user