added cactus theme files
This commit is contained in:
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>
|
||||
Reference in New Issue
Block a user