File tree 12 files changed +449
-344
lines changed
12 files changed +449
-344
lines changed Original file line number Diff line number Diff line change
1
+ # hugo-notepadium ![ ] ( https://img.shields.io/badge/license-MIT-blue.svg )
2
+
3
+ a fast [ gohugo] ( https://gohugo.io ) theme, HTML + CSS, 100% JavaScript-free.
4
+
5
+ - built-in ` syntanx highlight `
6
+ - custom ` 404 page `
7
+
8
+ ![ ] ( https://lvv.me/posts/2019-11-24_a_simple_hugo_theme/01.png )
9
+
10
+ the core CSS is ` core.css ` , transferred size < 3KB.
11
+
12
+ preview this theme: https://lvv.me
13
+
14
+ ## Quick Start
15
+
16
+ ``` shell
17
+ git submodule add https://github.com/cntrump/hugo-notepadium.git themes/hugo-notepadium
18
+ ```
19
+
20
+ demo ` config.toml ` :
21
+
22
+ ``` toml
23
+ baseURL = " /"
24
+ languageCode = " zh-cn"
25
+ title = " Lvv's notepad"
26
+ theme = " hugo-notepadium"
27
+ copyright = " Copyright ©2019 lvv. All rights reserved."
28
+ hasCJKLanguage = true
29
+ enableRobotsTXT = true
30
+ paginate = 5
31
+ pygmentsUseClasses = true
32
+ pygmentsCodeFences = true
33
+ pygmentsCodeFencesGuessSyntax = true
34
+ ```
35
+
36
+ custom your ` 404 page ` :
37
+
38
+ add ` /* /404.html 404 ` to your ` content/_redirects `
39
+
40
+ if ` _redirects ` not exists, you can create a new one.
Original file line number Diff line number Diff line change
1
+
2
+ {{ define "main"}}
3
+ < main id ="main ">
4
+ < div >
5
+ < h1 id ="title "> < a href ="{{ "/" | relURL }}"> Go Home</ a > </ h1 >
6
+ < div > < b > 404</ b > , I am lost.</ div >
7
+ </ div >
8
+ </ main >
9
+ {{ end }}
Original file line number Diff line number Diff line change 2
2
< html >
3
3
{{- partial "head.html" . -}}
4
4
< body >
5
+ < div class ="base-body max-width ">
5
6
{{- partial "header.html" . -}}
6
- < div id ="content " class ="body ">
7
+ < div id ="content " class ="flex- body max-body-width ">
7
8
{{- block "main" . }}{{- end }}
8
9
</ div >
9
10
{{- partial "footer.html" . -}}
11
+ </ div >
10
12
</ body >
11
13
</ html >
Original file line number Diff line number Diff line change 3
3
< div class ="article-title "> {{ .Title | plainify }}</ div >
4
4
< time class ="article-date "> {{ .Date.Format "2006-01-02" }}</ time >
5
5
</ div >
6
- < div id =" article " class ="article -body ">
6
+ < article class ="markdown -body ">
7
7
{{ .Content }}
8
- </ div >
8
+ </ article >
9
9
{{ end }}
Original file line number Diff line number Diff line change 20
20
{{ end }}
21
21
22
22
{{ if gt $paginator.TotalPages 1 }}
23
- < ul class ="pagination ">
24
- {{ if $paginator.HasPrev }}
25
- < li >
26
- < a href ="{{ $paginator.Prev.URL }} " class ="previous_page "> «</ a >
27
- </ li >
28
- {{ end }}
29
-
30
- {{ range $paginator.Pagers }}
31
- {{ $pageNumber := .PageNumber }}
32
- {{ $active := "" }}
33
- {{ if eq . $paginator }}
34
- {{ $active = "active" }}
35
- {{ end }}
23
+ < div class ="pagination ">
24
+ < ul >
25
+ {{ if $paginator.HasPrev }}
36
26
< li >
37
- < a class ="{{ $active }} " href =" {{ .URL }} " > {{ $pageNumber }} </ a >
27
+ < a href ="{{ $paginator.Prev.URL }} " class =" previous_page " > « </ a >
38
28
</ li >
39
29
{{ end }}
40
30
41
- {{ if $paginator.HasNext }}
42
- < li >
43
- < a href ="{{ $paginator.Next.URL }} " class ="next_page "> »</ a >
44
- </ li >
45
- {{ end }}
46
- </ ul >
31
+ {{ range $paginator.Pagers }}
32
+ {{ $pageNumber := .PageNumber }}
33
+ {{ $active := "" }}
34
+ {{ if eq . $paginator }}
35
+ {{ $active = "active" }}
36
+ {{ end }}
37
+ < li >
38
+ < a class ="{{ $active }} " href ="{{ .URL }} "> {{ $pageNumber }}</ a >
39
+ </ li >
40
+ {{ end }}
41
+
42
+ {{ if $paginator.HasNext }}
43
+ < li >
44
+ < a href ="{{ $paginator.Next.URL }} " class ="next_page "> »</ a >
45
+ </ li >
46
+ {{ end }}
47
+ </ ul >
48
+ </ div >
47
49
{{ end }}
48
50
49
51
{{ end }}
Original file line number Diff line number Diff line change 1
- < div id ="footer " class ="footer ">
1
+ < div id ="footer " class ="footer max-body-width text-gray ">
2
2
{{ if .Site.Copyright }}
3
3
< div > {{ .Site.Copyright | safeHTML }}</ div >
4
4
{{ end }}
5
+ < div > Built < a href ="https://github.com/cntrump/hugo-notepadium "> hugo-notepadium</ a > . 100% JavaScript-free.</ div >
5
6
</ div >
Original file line number Diff line number Diff line change 9
9
10
10
< meta charset ="utf-8 ">
11
11
< meta name ="viewport " content ="width=device-width, initial-scale=1 ">
12
+ < meta name ="color-scheme ">
12
13
13
14
{{- block "title" . }}{{- end }}
14
15
15
- < link rel ="stylesheet " href ="{{ `css/layout.css` | relURL }} ">
16
- < link rel ="stylesheet " href ="{{ `css/syntax.css` | relURL }} ">
16
+ < link rel ="stylesheet " href ="{{ `css/core.css` | relURL }} ">
Original file line number Diff line number Diff line change 1
- < div id ="header " class ="header ">
2
- < div class =" header-content " >
1
+ < div id ="header " class ="header max-body-width ">
2
+ < div >
3
3
< a class ="header-home " href ="{{ .Site.BaseURL }} ">
4
4
{{ .Site.Title }}
5
5
</ a >
You can’t perform that action at this time.
0 commit comments