Skip to content

Commit f327de6

Browse files
committed
v1.0.0
1 parent 835a87a commit f327de6

File tree

12 files changed

+449
-344
lines changed

12 files changed

+449
-344
lines changed

README.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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 &copy;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.

layouts/404.html

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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 }}

layouts/_default/baseof.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
<html>
33
{{- partial "head.html" . -}}
44
<body>
5+
<div class="base-body max-width">
56
{{- partial "header.html" . -}}
6-
<div id="content" class="body">
7+
<div id="content" class="flex-body max-body-width">
78
{{- block "main" . }}{{- end }}
89
</div>
910
{{- partial "footer.html" . -}}
11+
</div>
1012
</body>
1113
</html>

layouts/_default/single.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="article-title">{{ .Title | plainify }}</div>
44
<time class="article-date">{{ .Date.Format "2006-01-02" }}</time>
55
</div>
6-
<div id="article" class="article-body">
6+
<article class="markdown-body">
77
{{ .Content }}
8-
</div>
8+
</article>
99
{{ end }}

layouts/index.html

+22-20
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,32 @@
2020
{{ end }}
2121

2222
{{ if gt $paginator.TotalPages 1 }}
23-
<ul class="pagination">
24-
{{ if $paginator.HasPrev }}
25-
<li>
26-
<a href="{{ $paginator.Prev.URL }}" class="previous_page">&laquo;</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 }}
3626
<li>
37-
<a class="{{ $active }}" href="{{ .URL }}">{{ $pageNumber }}</a>
27+
<a href="{{ $paginator.Prev.URL }}" class="previous_page">&laquo;</a>
3828
</li>
3929
{{ end }}
4030

41-
{{ if $paginator.HasNext }}
42-
<li>
43-
<a href="{{ $paginator.Next.URL }}" class="next_page">&raquo;</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">&raquo;</a>
45+
</li>
46+
{{ end }}
47+
</ul>
48+
</div>
4749
{{ end }}
4850

4951
{{ end }}

layouts/partials/footer.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
<div id="footer" class="footer">
1+
<div id="footer" class="footer max-body-width text-gray">
22
{{ if .Site.Copyright }}
33
<div> {{ .Site.Copyright | safeHTML }}</div>
44
{{ end }}
5+
<div>Built <a href="https://github.com/cntrump/hugo-notepadium">hugo-notepadium</a>. 100% JavaScript-free.</div>
56
</div>

layouts/partials/head.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
<meta charset="utf-8">
1111
<meta name="viewport" content="width=device-width, initial-scale=1">
12+
<meta name="color-scheme">
1213

1314
{{- block "title" . }}{{- end }}
1415

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 }}">

layouts/partials/header.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<div id="header" class="header">
2-
<div class="header-content">
1+
<div id="header" class="header max-body-width">
2+
<div>
33
<a class="header-home" href="{{ .Site.BaseURL }}">
44
{{ .Site.Title }}
55
</a>

0 commit comments

Comments
 (0)