Skip to content

Commit 36f36af

Browse files
committed
upgrade hugo version; fix amp shortcodes error; update hugo config; update rss template; add last modify time in post page.
1 parent f0b5491 commit 36f36af

File tree

14 files changed

+128
-16
lines changed

14 files changed

+128
-16
lines changed

config.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
baseurl = "https://www.bmpi.dev"
1+
baseURL = "https://www.bmpi.dev"
22
title = "Build My Passive Income"
33
theme = "hugo-coder"
44
languagecode = "zh-cn"
@@ -7,8 +7,10 @@ defaultcontentlanguage = "zh-cn"
77
enableRobotsTXT = true
88
canonifyURLs = true
99

10+
enableGitInfo = true
11+
enableEmoji = true
12+
1013
paginate = 9999
11-
canonifyurls = true
1214

1315
pygmentsstyle = "b2"
1416
pygmentscodefences = true

layouts/shortcodes/ad_embed_post.amp.html

Whitespace-only changes.

layouts/shortcodes/ad_embed_post.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{{ if not (in .Page.Permalink "/amp/") }}
21
<ins class="adsbygoogle"
32
style="display:block; text-align:center;"
43
data-ad-layout="in-article"
@@ -25,5 +24,4 @@
2524
}
2625
};
2726
})();
28-
</script>
29-
{{ end }}
27+
</script>

layouts/shortcodes/dashboard.amp.html

Whitespace-only changes.

layouts/shortcodes/dashboard.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
{{ if not (in .Page.Permalink "/amp/") }}
2-
<iframe id="dashboard_iframe" width="860" height="1450" src="https://datastudio.google.com/embed/reporting/6c3c6d3d-cd2f-4f8c-85e6-c06d672c445b/page/MnJzB" frameborder="0" style="border:0" allowfullscreen></iframe>
3-
{{ end }}
1+
<iframe id="dashboard_iframe" width="860" height="1450" src="https://datastudio.google.com/embed/reporting/6c3c6d3d-cd2f-4f8c-85e6-c06d672c445b/page/MnJzB" frameborder="0" style="border:0" allowfullscreen></iframe>

layouts/shortcodes/figure.amp.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<figure {{ with .Get "class" }}class="{{.}}"{{ end }}>
2+
{{ with .Get "link"}}<a href="{{.}}">{{ end }}
3+
<div class="fixed-container"><amp-img src="{{ .Get "src" }}" class="contain" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}"{{ end }} layout="fill"></amp-img></div>
4+
{{ if .Get "link"}}</a>{{ end }}
5+
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
6+
<figcaption>{{ if isset .Params "title" }}
7+
<h4>{{ .Get "title" }}</h4>{{ end }}
8+
{{ if or (.Get "caption") (.Get "attr")}}<p>
9+
{{ .Get "caption" }}
10+
{{ with .Get "attrlink"}}<a href="{{.}}"> {{ end }}
11+
{{ .Get "attr" }}
12+
{{ if .Get "attrlink"}}</a> {{ end }}
13+
</p> {{ end }}
14+
</figcaption>
15+
{{ end }}
16+
</figure>

layouts/shortcodes/figure.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<figure {{ with .Get "class" }}class="{{.}}"{{ end }}>
22
{{ with .Get "link"}}<a href="{{.}}">{{ end }}
3-
{{ if not (in .Page.Permalink "/amp/") }}
4-
<img data-src="{{ .Get "src" }}" class="lazyload" loading="lazy" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}"{{ end }} />
5-
{{ else }}
6-
<div class="fixed-container"><amp-img src="{{ .Get "src" }}" class="contain" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}"{{ end }} layout="fill"></amp-img></div>
7-
{{ end }}
3+
<img data-src="{{ .Get "src" }}" class="lazyload" loading="lazy" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}"{{ end }} />
84
{{ if .Get "link"}}</a>{{ end }}
95
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
106
<figcaption>{{ if isset .Params "title" }}

resources/_gen/assets/scss/scss/coder.scss_5e1eb8e37c42cdfb6215b61e44dcfa5f.content

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"Target":"css/coder.min.eef32085750fe4fe63f6dfb63c5e6338e7b82195983e19859b03b6d189815f3c.css","MediaType":"text/css","Data":{"Integrity":"sha256-7vMghXUP5P5j9t+2PF5jOOe4IZWYPhmFmwO20YmBXzw="}}
1+
{"Target":"css/coder.min.deacf4638e988eb7ad13026417a95fe49dbb6368f04ffe5ffa15de11c942ed6c.css","MediaType":"text/css","Data":{"Integrity":"sha256-3qz0Y46YjretEwJkF6lf5J27Y2jwT/5f+hXeEclC7Ww="}}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{{- $pctx := . -}}
2+
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
3+
{{- $pages := slice -}}
4+
{{- if or $.IsHome $.IsSection -}}
5+
{{- $pages = $pctx.RegularPages -}}
6+
{{- else -}}
7+
{{- $pages = $pctx.Pages -}}
8+
{{- end -}}
9+
{{- $limit := .Site.Config.Services.RSS.Limit -}}
10+
{{- if ge $limit 1 -}}
11+
{{- $pages = $pages | first $limit -}}
12+
{{- end -}}
13+
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
14+
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
15+
<channel>
16+
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
17+
<link>{{ .Permalink }}</link>
18+
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
19+
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
20+
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
21+
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
22+
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
23+
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
24+
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
25+
{{- with .OutputFormats.Get "RSS" -}}
26+
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
27+
{{- end -}}
28+
{{ range $pages }}
29+
<item>
30+
<title>{{ .Title }}</title>
31+
{{ if or (hasPrefix .RelPermalink "/dev/") (hasPrefix .RelPermalink "/en/dev/") }}
32+
<category>Full-Stack Developer</category>
33+
{{ end }}
34+
{{ if or (hasPrefix .RelPermalink "/self/") (hasPrefix .RelPermalink "/en/self/") }}
35+
<category>Lifelong Learner</category>
36+
{{ end }}
37+
{{ if or (hasPrefix .RelPermalink "/money/") (hasPrefix .RelPermalink "/en/money/") }}
38+
<category>ETF Trader</category>
39+
{{ end }}
40+
<link>{{ .Permalink }}</link>
41+
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
42+
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
43+
<guid>{{ .Permalink }}</guid>
44+
<description>{{ .Description }}</description>
45+
</item>
46+
{{ end }}
47+
</channel>
48+
</rss>

0 commit comments

Comments
 (0)