forked from maolonglong/hugo-simple
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0dd2cb8
commit fff14a2
Showing
17 changed files
with
211 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
.direnv/ | ||
node_modules/ | ||
public/ | ||
resources/ | ||
|
||
.DS_Store | ||
.hugo_build.lock | ||
package-lock.json | ||
result | ||
result-* | ||
|
||
.hugo_build.lock | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"plugins": ["prettier-plugin-go-template"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.html"], | ||
"options": { | ||
"parser": "go-template" | ||
} | ||
} | ||
], | ||
"goTemplateBracketSpacing": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{{ define "title" }}404{{ end }} | ||
|
||
{{ define "main" }} | ||
<h1>404</h1> | ||
<h2>ʕノ•ᴥ•ʔノ ︵ ┻━┻</h2> | ||
<h1>404</h1> | ||
<h2>ʕノ•ᴥ•ʔノ ︵ ┻━┻</h2> | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<!-- 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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,60 @@ | ||
<!DOCTYPE html> | ||
<!doctype html> | ||
<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en{{ 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" /> | ||
{{- partial "favicon.html" . -}} | ||
<title>{{- block "title" . }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{- end }}</title> | ||
|
||
{{- partial "seo_tags.html" . -}} | ||
<meta name="referrer" content="no-referrer-when-downgrade" /> | ||
|
||
{{ $simple := resources.Get "simple.css" | minify }} | ||
<link href="{{ $simple.RelPermalink }}" rel="stylesheet"> | ||
|
||
{{ $style := resources.Get "style.css" | minify }} | ||
<link href="{{ $style.RelPermalink }}" rel="stylesheet"> | ||
|
||
{{ if (.Page.Store.Get "hasCodeBlock") }} | ||
{{ $syntax := resources.Get "syntax.css" | minify }} | ||
<link href="{{ $syntax.RelPermalink }}" rel="stylesheet"> | ||
{{ end }} | ||
|
||
{{ with .Params.style }} | ||
{{ $extra := resources.Get . | minify }} | ||
<link href="{{ $extra.RelPermalink }}" rel="stylesheet"> | ||
{{ end }} | ||
|
||
{{ with .OutputFormats.Get "rss" -}} | ||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} | ||
{{ end -}} | ||
|
||
<!-- A partial to be overwritten by the user. | ||
<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" /> | ||
{{- partial "favicon.html" . -}} | ||
<title> | ||
{{- block "title" . }} | ||
{{ with .Title }}{{ . }} |{{ end }}{{ .Site.Title }} | ||
{{- end }} | ||
</title> | ||
|
||
{{- partial "seo_tags.html" . -}} | ||
<meta name="referrer" content="no-referrer-when-downgrade" /> | ||
|
||
{{ $simple := resources.Get "simple.css" | minify }} | ||
<link href="{{ $simple.RelPermalink }}" rel="stylesheet" /> | ||
|
||
{{ $style := resources.Get "style.css" | minify }} | ||
<link href="{{ $style.RelPermalink }}" rel="stylesheet" /> | ||
|
||
{{ if (.Page.Store.Get "hasCodeBlock") }} | ||
{{ $syntax := resources.Get "syntax.css" | minify }} | ||
<link href="{{ $syntax.RelPermalink }}" rel="stylesheet" /> | ||
{{ end }} | ||
|
||
{{ with .Params.style }} | ||
{{ $extra := resources.Get . | minify }} | ||
<link href="{{ $extra.RelPermalink }}" rel="stylesheet" /> | ||
{{ end }} | ||
|
||
{{ with .OutputFormats.Get "rss" -}} | ||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} | ||
{{ end -}} | ||
|
||
|
||
<!-- A partial to be overwritten by the user. | ||
Simply place a custom_head.html into | ||
your local /layouts/partials-directory --> | ||
{{- partial "custom_head.html" . -}} | ||
</head> | ||
|
||
<body> | ||
<header> | ||
{{ partial "header.html" . }} | ||
</header> | ||
<main> | ||
{{ block "main" . }}{{ end }} | ||
</main> | ||
<footer> | ||
{{ partial "footer.html" . }} | ||
</footer> | ||
|
||
<!-- A partial to be overwritten by the user. | ||
{{- partial "custom_head.html" . -}} | ||
</head> | ||
|
||
<body> | ||
<header> | ||
{{ partial "header.html" . }} | ||
</header> | ||
<main> | ||
{{ block "main" . }}{{ end }} | ||
</main> | ||
<footer> | ||
{{ partial "footer.html" . }} | ||
</footer> | ||
|
||
<!-- A partial to be overwritten by the user. | ||
Simply place a custom_body.html into | ||
your local /layouts/partials-directory --> | ||
{{- partial "custom_body.html" . -}} | ||
</body> | ||
|
||
{{- partial "custom_body.html" . -}} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,42 @@ | ||
{{ define "main" }} | ||
<content> | ||
{{ if .Data.Singular }} | ||
<h3>Filtering for "{{ .Title }}"</h3> | ||
<small> | ||
<a href="{{ relURL "blog" }}">Remove filter</a> | ||
</small> | ||
{{ end }} | ||
{{ if or .Paginator.HasPrev .Paginator.HasNext }} | ||
{{- partial "pagination.html" . -}} | ||
{{ end }} | ||
<ul class="blog-posts"> | ||
{{ range .Paginator.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> | ||
<content> | ||
{{ if .Data.Singular }} | ||
<h3>Filtering for "{{ .Title }}"</h3> | ||
<small> | ||
<a href="{{ relURL "blog" }}">Remove filter</a> | ||
</small> | ||
{{ end }} | ||
{{ if or .Paginator.HasPrev .Paginator.HasNext }} | ||
{{- partial "pagination.html" . -}} | ||
{{ end }} | ||
<ul class="blog-posts"> | ||
{{ range .Paginator.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="{{ .Permalink }}">{{ .Title }}</a> | ||
{{ end }} | ||
</li> | ||
{{ else }} | ||
<a href="{{ .Permalink }}">{{ .Title }}</a> | ||
<li>No posts yet</li> | ||
{{ end }} | ||
</li> | ||
{{ else }} | ||
<li> | ||
No posts yet | ||
</li> | ||
</ul> | ||
{{ if not .Data.Singular }} | ||
<small> | ||
<div> | ||
{{ range .Site.Taxonomies.tags }} | ||
<a href="{{ .Page.Permalink }}">#{{ .Page.Title }}</a> | ||
{{ end }} | ||
</div> | ||
</small> | ||
{{ end }} | ||
</ul> | ||
{{ if not .Data.Singular }} | ||
<small> | ||
<div> | ||
{{ range .Site.Taxonomies.tags }} | ||
<a href="{{ .Page.Permalink }}">#{{ .Page.Title }}</a> | ||
{{ end }} | ||
</div> | ||
</small> | ||
{{ end }} | ||
</content> | ||
</content> | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,28 @@ | ||
{{ define "main" }} | ||
{{ if eq .Type "blog" }}{{ if not .Params.menu }} | ||
<!-- <h1>{{ .Title }}</h1> --> | ||
<p> | ||
<i> | ||
<time datetime='{{ .Date.Format "2006-01-02" }}' pubdate> | ||
{{ .Date.Format (default "2006-01-02" .Site.Params.dateFormat) }} | ||
</time> | ||
</i> | ||
</p> | ||
{{ end }}{{ end }} | ||
{{ if and (gt .WordCount 400 ) (.Params.toc) }} | ||
<details> | ||
<summary>Table of contents</summary> | ||
{{ .TableOfContents }} | ||
</details> | ||
{{ end }} | ||
<content> | ||
{{ .Content }} | ||
</content> | ||
<p> | ||
{{ range (.GetTerms "tags") }} | ||
<a href="{{ .Permalink }}">#{{ .LinkTitle }}</a> | ||
{{ if eq .Type "blog" }} | ||
{{ if not .Params.menu }} | ||
<!-- <h1>{{ .Title }}</h1> --> | ||
<p> | ||
<i> | ||
<time datetime="{{ .Date.Format "2006-01-02" }}" pubdate> | ||
{{ .Date.Format (default "2006-01-02" .Site.Params.dateFormat) }} | ||
</time> | ||
</i> | ||
</p> | ||
{{ end }} | ||
{{ end }} | ||
{{ if and (gt .WordCount 400 ) (.Params.toc) }} | ||
<details> | ||
<summary>Table of contents</summary> | ||
{{ .TableOfContents }} | ||
</details> | ||
{{ end }} | ||
</p> | ||
<content> | ||
{{ .Content }} | ||
</content> | ||
<p> | ||
{{ range (.GetTerms "tags") }} | ||
<a href="{{ .Permalink }}">#{{ .LinkTitle }}</a> | ||
{{ end }} | ||
</p> | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{{ define "main" }} | ||
{{ .Content }} | ||
{{ .Content }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<!-- A partial to be overwritten by the user. | ||
<!-- A partial to be overwritten by the user. | ||
Simply place a custom_body.html into | ||
your local /layouts/partials-directory --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
{{ with .Site.Params.favicon }} | ||
<link rel="shortcut icon" href="{{ absURL . }}" />{{ end }} | ||
<link rel="shortcut icon" href="{{ absURL . }}" /> | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
{{ if not .Site.Params.hideMadeWithLine }}Made with <a href="https://github.com/maolonglong/hugo-simple/">Hugo ʕ•ᴥ•ʔ Simple</a>{{ end }} | ||
{{ if not .Site.Params.hideMadeWithLine }} | ||
Made with | ||
<a href="https://github.com/maolonglong/hugo-simple/">Hugo ʕ•ᴥ•ʔ Simple</a> | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
|
||
<h1>{{ .Title }}</h1> | ||
{{ with .Description }} | ||
<p>{{ . }}</p> | ||
<p>{{ . }}</p> | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
{{ $currentPage := . -}} | ||
{{ range .Site.Menus.main.ByWeight }} | ||
<a href="{{ .URL }}" {{ if eq $currentPage .Page }} class="current"{{ end }}>{{ .Name }}</a> | ||
{{ end }} | ||
<a href='{{ absURL "index.xml" }}'>RSS</a> | ||
<a | ||
href="{{ .URL }}" | ||
{{ if eq $currentPage .Page }}class="current"{{ end }} | ||
>{{ .Name }}</a | ||
> | ||
{{ end }} <a href="{{ absURL "index.xml" }}">RSS</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
<div class="pagination"> | ||
<a {{ if .Paginator.HasPrev }}href="{{ .Paginator.Prev.URL }}"{{ else }}style="visibility: hidden;"{{ end }}> | ||
<a | ||
{{ if .Paginator.HasPrev }} | ||
href="{{ .Paginator.Prev.URL }}" | ||
{{ else }} | ||
style="visibility: hidden;" | ||
{{ end }} | ||
> | ||
<span>←</span> | ||
<span>Newer posts</span> | ||
</a> | ||
{{ if .Paginator.HasNext }} | ||
<a href="{{ .Paginator.Next.URL }}"> | ||
<span>Older posts</span> | ||
<span>→</span> | ||
</a> | ||
<a href="{{ .Paginator.Next.URL }}"> | ||
<span>Older posts</span> | ||
<span>→</span> | ||
</a> | ||
{{ end }} | ||
</div> |
Oops, something went wrong.