all: Convert to new theme, KeepIt.
This commit is contained in:
parent
b2a2c66f41
commit
2d35cb5544
12 changed files with 166 additions and 49 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1 +1,2 @@
|
|||
/public/
|
||||
/resources/
|
||||
3
.gitmodules
vendored
3
.gitmodules
vendored
|
|
@ -1,3 +1,6 @@
|
|||
[submodule "themes/natrium"]
|
||||
path = themes/natrium
|
||||
url = https://github.com/mobybit/hugo-natrium-theme.git
|
||||
[submodule "themes/KeepIt"]
|
||||
path = themes/KeepIt
|
||||
url = https://github.com/Fastbyte01/KeepIt.git
|
||||
|
|
|
|||
3
.vscode/launch.json
vendored
Normal file
3
.vscode/launch.json
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"defaultTheme": "natrium"
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
---
|
||||
title: "{{ replace .Name "-" " " | title }}"
|
||||
date: {{ .Date }}
|
||||
draft: true
|
||||
---
|
||||
|
||||
63
config.toml
63
config.toml
|
|
@ -1,42 +1,45 @@
|
|||
baseurl = "//notmy.space/blog/"
|
||||
languageCode = "en-us"
|
||||
baseURL = "//notmy.space/blog/"
|
||||
languageCode = "en"
|
||||
defaultContentLanguage = "en"
|
||||
title = "William Floyd's Blog"
|
||||
theme = "natrium"
|
||||
preserveTaxonomyNames = true
|
||||
rssLimit = 10
|
||||
theme = "KeepIt"
|
||||
paginate = 10
|
||||
pygmentsCodefences = true
|
||||
pygmentsStyle = "native"
|
||||
canonifyURLs = true
|
||||
enableEmoji = true
|
||||
|
||||
[taxonomies]
|
||||
category = "categories"
|
||||
tag = "tags"
|
||||
[sitemap]
|
||||
changefreq = "daily"
|
||||
filename = "sitemap.xml"
|
||||
priority = 0.5
|
||||
|
||||
[permalinks]
|
||||
post = "/:slug/"
|
||||
page = "/:slug/"
|
||||
[blackfriday]
|
||||
hrefTargetBlank = true
|
||||
nofollowLinks = true
|
||||
noreferrerLinks = true
|
||||
|
||||
[[menu.main]]
|
||||
name = "About"
|
||||
url = "/about/"
|
||||
weight = -110
|
||||
|
||||
[[menu.main]]
|
||||
name = "Tags"
|
||||
url = "/tags"
|
||||
weight = -120
|
||||
[Permalinks]
|
||||
posts = "/:year/:filename/"
|
||||
|
||||
[[menu.main]]
|
||||
[menu]
|
||||
[[menu.main]]
|
||||
name = "Blog"
|
||||
url = "/posts/"
|
||||
weight = 1
|
||||
|
||||
[[menu.main]]
|
||||
name = "Categories"
|
||||
url = "/categories"
|
||||
weight = -130
|
||||
url = "/categories/"
|
||||
weight = 3
|
||||
|
||||
[[menu.main]]
|
||||
name = "About"
|
||||
url = "/about"
|
||||
weight = 4
|
||||
|
||||
[params]
|
||||
description = ""
|
||||
since = 2018
|
||||
author = "William Floyd"
|
||||
home_mode = "post"
|
||||
|
||||
[params.logo]
|
||||
url = "logo.png"
|
||||
width = 50
|
||||
height = 50
|
||||
alt = "Logo"
|
||||
[params.share]
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ tags: [
|
|||
]
|
||||
---
|
||||
|
||||
See my ongoing [Smart Rice Cooker](../smart-rice-cooker-conversion) conversion post for my attempt at making the rice cooker smarter.
|
||||
See my ongoing [Smart Rice Cooker](../smart-rice-cooker) conversion post for my attempt at making the rice cooker smarter.
|
||||
|
||||
***
|
||||
|
||||
0
content/projects/.empty
Normal file
0
content/projects/.empty
Normal file
112
layouts/_default/single.html
Normal file
112
layouts/_default/single.html
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
{{ define "content" -}}
|
||||
{{ $cdn_url := .Scratch.Get "cdn_url" }}
|
||||
<article class="post-warp">
|
||||
<header class="post-header">
|
||||
<h1 class="post-title">{{ .Title }}</h1>
|
||||
<div class="post-meta">
|
||||
{{ i18n "Written" }} {{ i18n "by" }} <a href="{{.Site.BaseURL }}" rel="author">{{ if isset .Params "author" }}{{ .Params.author }}{{ else }}{{ .Site.Params.author }}{{ end }}</a>
|
||||
<span class="post-time">
|
||||
{{ i18n "on" }} <time datetime={{.Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }} >{{ .Date.Format (.Site.Params.dateFormatToUse | default "2 January 2006") }}</time>
|
||||
</span>
|
||||
{{ i18n "in" }}
|
||||
{{ with .Params.categories -}}
|
||||
<i class="iconfont icon-folder"></i>
|
||||
<span class="post-category">
|
||||
{{ range . }}
|
||||
{{- $name := . -}}
|
||||
{{- with $.Site.GetPage "taxonomy" (printf "categories/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "categories/%s" ($name | urlize))) -}}
|
||||
<a href="{{ .Permalink }}"> {{ $name }} </a>
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
</span>
|
||||
{{- end }}
|
||||
<i class="iconfont icon-timer"></i>
|
||||
{{.ReadingTime }} min
|
||||
</div>
|
||||
</header>
|
||||
<div class="post-content">
|
||||
<!--featured_image-->
|
||||
|
||||
{{ $images := findRE "<img src=\"[^\"|\\\"]*\"" .Content -}}
|
||||
{{ if ge (len $images) 1}}
|
||||
{{ $.Scratch.Set "postHasImages" true }}
|
||||
{{ end }}
|
||||
|
||||
{{ with .Params.featured_image }}
|
||||
{{- $img := . -}}
|
||||
<img src="{{ printf "%s%s" $cdn_url $img }}" class="featured_image">
|
||||
{{ end }}
|
||||
<!-- end featured_image-->
|
||||
|
||||
{{ $reAltIn := "<img src=\"([^\"]+)\" alt=\"([^\"]+)?\" />" }}
|
||||
{{ $reAltOut := ( printf "<figure><img src=\"/images/ring.svg\" data-sizes=\"auto\" data-src=\"%s$1\" alt=\"$2\" class=\"lazyload\"><figcaption class=\"image-caption\">$2</figcaption></figure>" $cdn_url ) }}
|
||||
{{ $altContent := .Content | replaceRE $reAltIn $reAltOut | safeHTML }}
|
||||
|
||||
{{ $reAltTitleIn := "<img src=\"([^\"]+)\" alt=\"([^\"]+)?\" title=\"([^\"]+)?\" />" }}
|
||||
{{ $reAltTitleOut := ( printf "<figure><img src=\"/images/ring.svg\" data-src=\"%s$1\" data-sizes=\"auto\" alt=\"$2\" title=\"$3\" class=\"lazyload\"><figcaption class=\"image-caption\">$2</figcaption></figure>" $cdn_url ) }}
|
||||
{{ $finalContent := $altContent | replaceRE $reAltTitleIn $reAltTitleOut | safeHTML }}
|
||||
|
||||
{{ $finalContent }}
|
||||
</div>
|
||||
|
||||
<div class="post-copyright">
|
||||
{{ with .Site.Params.author }}
|
||||
<p class="copyright-item">
|
||||
<span>{{ i18n "Author" }}:</span>
|
||||
<span>{{ . }} </span>
|
||||
</p>
|
||||
{{ end }}
|
||||
|
||||
<p class="copyright-item">
|
||||
<span>{{ i18n "Words" }}:</span>
|
||||
<span>{{ .WordCount }}</span>
|
||||
</p>
|
||||
|
||||
<p class="copyright-item">
|
||||
{{ if and ( $.Param "socialShare" ) (gt (len ($.Param "share")) 0) }}
|
||||
<span>{{ i18n "Share" }}:</span>
|
||||
<span>{{ partial "share-links" . }}</span>
|
||||
{{ end }}
|
||||
</p>
|
||||
|
||||
{{ with .Site.Params.license }}
|
||||
<p class="copyright-item">
|
||||
{{ . | safeHTML}}
|
||||
</p>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="post-tags">
|
||||
{{ with .Params.tags }}
|
||||
<section>
|
||||
<i class="iconfont icon-icon-tag"></i>{{ i18n "Tag" }}:
|
||||
{{ range . }}
|
||||
<span class="tag"><a href="{{ "tags/" | absURL }}{{ . | urlize }}/">
|
||||
#{{.}}</a></span>
|
||||
{{ end }}
|
||||
</section>
|
||||
{{ end }}
|
||||
<section>
|
||||
<a href="javascript:window.history.back();">{{ i18n "back" }}</a></span> ·
|
||||
<span><a href="{{ .Site.BaseURL }}">{{ i18n "Home" }}</a></span>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="post-nav">
|
||||
{{ if .PrevInSection }}
|
||||
<a href="{{.PrevInSection.Permalink}}" class="prev" rel="prev" title="{{ .PrevInSection.Title}}"><i class="iconfont icon-dajiantou"></i> {{ .PrevInSection.Title}}</a>
|
||||
{{ end }}
|
||||
{{ if .NextInSection }}
|
||||
<a href="{{.NextInSection.Permalink}}" class="next" rel="next" title="{{.NextInSection.Title}}">{{.NextInSection.Title}} <i class="iconfont icon-xiaojiantou"></i></a>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
<div class="post-comment">
|
||||
{{ if ( .Params.showComments | default true ) }}
|
||||
{{ partial "comments.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</article>
|
||||
{{- end }}
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
<footer class="footer">
|
||||
<ul class="footer-links">
|
||||
<li>
|
||||
<a href="{{ .Site.RSSLink }}" type="application/rss+xml" target="_blank"><i class="fa fa-rss"></i> {{ i18n "footerRSS" }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://github.com/W-Floyd/blog"><i class="fa fa-github"></i> Code</a>
|
||||
</li>
|
||||
</ul>
|
||||
</footer>
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
©
|
||||
{{ with .Site.Params.since }}
|
||||
<span itemprop="copyrightYear">{{.}} - {{ now.Year }}</span>
|
||||
{{ end }}
|
||||
{{ if .Site.Params.author }}
|
||||
<span class="author" itemprop="copyrightHolder"><a href="{{ .Site.BaseURL }}">{{ .Site.Params.author }}</a></span>
|
||||
{{ end }}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</footer>
|
||||
|
||||
{{ partial "js.html" . }}
|
||||
|
|
|
|||
1
themes/KeepIt
Submodule
1
themes/KeepIt
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 3e2972c318b3c8297a5ac775cb897adefa90b2ee
|
||||
Loading…
Add table
Reference in a new issue