Initial version of hugo-stack
This commit is contained in:
commit
e19eb92b4b
28 changed files with 487 additions and 0 deletions
|
|
@ -0,0 +1,6 @@
|
|||
<!-- https://github.com/jmooring/hugo-testing/blob/hugo-forum-topic-40998/layouts/_default/_markup/render-codeblock-katex.html -->
|
||||
{{ .Page.Store.Set "hasCodeBlock" true }}
|
||||
|
||||
<!-- https://www.veriphor.com/articles/code-block-render-hooks/ -->
|
||||
{{ $result := transform.HighlightCodeBlock . }}
|
||||
{{ $result.Wrapped }}
|
||||
26
exampleSite/layouts/_default/baseof.html
Normal file
26
exampleSite/layouts/_default/baseof.html
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="{{ with .Site.Language.Lang }}{{ . }}{{ else }}en-US{{ end }}">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="X-Clacks-Overhead" content="GNU Terry Pratchett" />
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<style>
|
||||
.container {
|
||||
padding: 20%;
|
||||
box-sizing: border-box
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
<main id="main-content">
|
||||
<div class="container">
|
||||
{{- block "main" . }}{{- end }}
|
||||
</div>
|
||||
</main>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
36
exampleSite/layouts/_default/list.html
Normal file
36
exampleSite/layouts/_default/list.html
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{{ define "main" }}
|
||||
<content>
|
||||
{{ if .Data.Singular }}
|
||||
<h3 class="blog-filter">{{ i18n "filtering-for" }} "{{ .Title }}"</h3>
|
||||
{{ end }}
|
||||
<ul class="blog-posts">
|
||||
{{ range .Pages }}
|
||||
<li>
|
||||
<span>
|
||||
<i>
|
||||
<time datetime='{{ .Date.Format "2006-01-02" }}' pubdate>
|
||||
{{ .Date.Format (default "2006-01-02" .Site.Params.dateFormat) }}
|
||||
</time>
|
||||
</i>
|
||||
</span>
|
||||
{{ if .Params.link }}
|
||||
<a href="{{ .Params.link }}" target="_blank">{{ .Title }} ↪</a>
|
||||
{{ else }}
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ else }}
|
||||
<li>
|
||||
{{ i18n "no-posts" }}
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ if not .Data.Singular }}
|
||||
<div>
|
||||
{{ range .Site.Taxonomies.tags }}
|
||||
<a class="blog-tags" href="{{ .Page.RelPermalink }}">#{{ lower .Page.Title }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</content>
|
||||
{{ end }}
|
||||
64
exampleSite/layouts/_default/rss.xml
Normal file
64
exampleSite/layouts/_default/rss.xml
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
{{- $authorEmail := "" }}
|
||||
{{- with site.Params.author }}
|
||||
{{- if reflect.IsMap . }}
|
||||
{{- with .email }}
|
||||
{{- $authorEmail = . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- $authorName := "" }}
|
||||
{{- with site.Params.author }}
|
||||
{{- if reflect.IsMap . }}
|
||||
{{- with .name }}
|
||||
{{- $authorName = . }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- $authorName = . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- $pctx := . }}
|
||||
{{- if .IsHome }}{{ $pctx = .Site }}{{ end }}
|
||||
{{- $pages := slice }}
|
||||
{{- if or $.IsHome $.IsSection }}
|
||||
{{- $pages = $pctx.RegularPages }}
|
||||
{{- else }}
|
||||
{{- $pages = $pctx.Pages }}
|
||||
{{- end }}
|
||||
{{- $limit := .Site.Config.Services.RSS.Limit }}
|
||||
{{- if ge $limit 1 }}
|
||||
{{- $pages = $pages | first $limit }}
|
||||
{{- end }}
|
||||
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
|
||||
<channel>
|
||||
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<description>Recent content {{ if not .IsHome }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }}</description>
|
||||
<generator>Hugo -- gohugo.io</generator>
|
||||
{{ with site.Language.Lang }}
|
||||
<language>{{ . }}</language>
|
||||
{{ else }}
|
||||
<language>en</language>
|
||||
{{ end }}{{ with $authorEmail }}
|
||||
<managingEditor>{{.}}{{ with $authorName }} ({{ . }}){{ end }}</managingEditor>{{ end }}{{ with $authorEmail }}
|
||||
<webMaster>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</webMaster>{{ end }}{{ with .Site.Copyright }}
|
||||
<copyright>{{ . }}</copyright>{{ end }}{{ if not .Date.IsZero }}
|
||||
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
|
||||
{{- with .OutputFormats.Get "RSS" }}
|
||||
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
||||
{{- end }}
|
||||
{{- range $pages }}
|
||||
<item>
|
||||
<title>{{ .Title }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||
{{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }}
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
<description>{{ .Summary | transform.XMLEscape | safeHTML }}</description>
|
||||
<content:encoded>{{ `<![CDATA[` | safeHTML }}{{ .Content | safeHTML }}{{ `]]>` | safeHTML }}</content:encoded>
|
||||
</item>
|
||||
{{- end }}
|
||||
</channel>
|
||||
</rss>
|
||||
40
exampleSite/layouts/_default/single.html
Normal file
40
exampleSite/layouts/_default/single.html
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{{ define "main" }}
|
||||
{{ if not .Params.menu }}
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ if not .Params.hideDate }}
|
||||
<p class="byline">
|
||||
<time datetime='{{ .Date.Format "2006-01-02" }}' pubdate>
|
||||
{{ .Date.Format (default "2006-01-02" .Site.Params.dateFormat) }}
|
||||
</time>
|
||||
{{ with .Params.author }}· {{.}}{{ end }}
|
||||
</p>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<content>
|
||||
{{ .Content }}
|
||||
</content>
|
||||
<p>
|
||||
{{ range (.GetTerms "tags") }}
|
||||
<a class="blog-tags" href="{{ .RelPermalink }}">#{{ lower .LinkTitle }}</a>
|
||||
{{ end }}
|
||||
</p>
|
||||
{{ if not .Params.hideReply }}
|
||||
{{ with .Site.Params.author.email }}
|
||||
<p>
|
||||
<a href='mailto:{{ . }}?subject={{ i18n "email-subject" }}"{{ default $.Site.Title $.Page.Title }}"'>
|
||||
{{ i18n "email-reply" }} ↪
|
||||
</a>
|
||||
</p>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if and .Site.Params.upvotes (not .Params.hideUpvotes) }}
|
||||
<div class="upvote">
|
||||
<button id="upvote-btn" aria-label="Upvote">
|
||||
<span id="upvote-chevron">⌃</span>
|
||||
<span id="upvote-count">—</span>
|
||||
</button>
|
||||
</div>
|
||||
<script>window.UPVOTE_API = "{{ .Site.Params.upvoteApi }}";</script>
|
||||
<script src="/upvote.js"></script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
5
exampleSite/layouts/index.html
Normal file
5
exampleSite/layouts/index.html
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{{ define "main" }}
|
||||
|
||||
{{ partial "stack.html" . }}
|
||||
|
||||
{{ end }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue