├── .gitignore ├── archetypes └── default.md ├── layouts ├── partials │ ├── _script │ │ ├── fancybox.html │ │ ├── repository.html │ │ ├── analytics.html │ │ ├── comment.html │ │ └── pv.html │ ├── post │ │ ├── gallery.html │ │ ├── title.html │ │ ├── tag.html │ │ ├── category.html │ │ ├── date.html │ │ ├── wc.html │ │ ├── comment.html │ │ ├── pv.html │ │ ├── copyright.html │ │ ├── nav.html │ │ └── donate.html │ ├── sidebar.html │ ├── _widgets │ │ ├── board.html │ │ ├── tag.html │ │ ├── category.html │ │ ├── recent_posts.html │ │ └── tag_cloud.html │ ├── item-post.html │ ├── sidebar-toc.html │ ├── social.html │ ├── math.html │ ├── footer.html │ ├── pagination.html │ ├── card-post.html │ ├── search.html │ ├── article.html │ ├── header.html │ ├── script.html │ └── head.html ├── robots.txt ├── shortcodes │ └── alert.html ├── _default │ ├── single.html │ ├── sitemap.xml │ ├── list.searchindex.json │ ├── tag.html │ ├── tag.terms.html │ ├── rss.xml │ ├── baseof.html │ ├── category.html │ ├── category.terms.html │ └── list.html ├── 404.html └── index.html ├── exampleSite ├── content │ ├── homepage │ │ ├── index.md │ │ ├── about.md │ │ └── work.md │ ├── posts │ │ ├── _index.md │ │ ├── rich-content.md │ │ ├── emoji-support.md │ │ ├── math-typesetting.mmark │ │ ├── placeholder-text.md │ │ └── markdown-syntax.md │ └── about.md └── config.yml ├── images ├── tn.png ├── black.png ├── blue.png ├── green.png ├── grey.png ├── purple.png └── screenshot.png ├── assets ├── avatar.png ├── favicon.ico ├── donate │ ├── alipayimg.png │ └── wechatpayimg.png └── js │ ├── application.js │ └── insight.js ├── static ├── avatar.png ├── favicon.ico └── fonts │ ├── iconfont.eot │ ├── iconfont.ttf │ ├── iconfont.woff │ └── README.md ├── theme.toml ├── LICENSE ├── README-ZH.md ├── i18n ├── zh.yaml └── en.yaml └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /archetypes/default.md: -------------------------------------------------------------------------------- 1 | +++ 2 | +++ 3 | -------------------------------------------------------------------------------- /layouts/partials/_script/fancybox.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /layouts/partials/_script/repository.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /layouts/partials/post/gallery.html: -------------------------------------------------------------------------------- 1 | {{/* gallery */}} -------------------------------------------------------------------------------- /exampleSite/content/homepage/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | headless : true 3 | --- 4 | -------------------------------------------------------------------------------- /layouts/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Request-rate: 1/1 3 | Crawl-delay: 5 4 | -------------------------------------------------------------------------------- /images/tn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/HEAD/images/tn.png -------------------------------------------------------------------------------- /images/black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/HEAD/images/black.png -------------------------------------------------------------------------------- /images/blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/HEAD/images/blue.png -------------------------------------------------------------------------------- /images/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/HEAD/images/green.png -------------------------------------------------------------------------------- /images/grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/HEAD/images/grey.png -------------------------------------------------------------------------------- /assets/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/HEAD/assets/avatar.png -------------------------------------------------------------------------------- /assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/HEAD/assets/favicon.ico -------------------------------------------------------------------------------- /images/purple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/HEAD/images/purple.png -------------------------------------------------------------------------------- /static/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/HEAD/static/avatar.png -------------------------------------------------------------------------------- /static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/HEAD/static/favicon.ico -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/HEAD/images/screenshot.png -------------------------------------------------------------------------------- /static/fonts/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/HEAD/static/fonts/iconfont.eot -------------------------------------------------------------------------------- /static/fonts/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/HEAD/static/fonts/iconfont.ttf -------------------------------------------------------------------------------- /static/fonts/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/HEAD/static/fonts/iconfont.woff -------------------------------------------------------------------------------- /assets/donate/alipayimg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/HEAD/assets/donate/alipayimg.png -------------------------------------------------------------------------------- /assets/donate/wechatpayimg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/HEAD/assets/donate/wechatpayimg.png -------------------------------------------------------------------------------- /layouts/shortcodes/alert.html: -------------------------------------------------------------------------------- 1 |
{{ .Inner | markdownify }}
3 |3 |18 | {{ $profile := .Site.Params.profile }} 19 | {{- with $profile.enabled }} 20 |4 | 8 |
17 |- 9 | {{ T "copyright_license" }}: 10 | {{- if .Site.Params.copyright_link }} 11 | {{ .Site.Copyright }} 12 | {{- else }} 13 | {{ .Site.Copyright }} 14 | {{- end }} 15 |
16 |
🙈 :see_no_evil: 🙉 :hear_no_evil: 🙊 :speak_no_evil:
{{- T "total_article" (len $pages) }}
8 |Test
86 | 87 | 88 | ``` 89 | #### Code block indented with four spaces 90 | 91 | 92 | 93 | 94 | 95 |Test
99 | 100 | 101 | 102 | #### Code block with Hugo's internal highlight shortcode 103 | {{< highlight html >}} 104 | 105 | 106 | 107 | 108 |Test
112 | 113 | 114 | {{< /highlight >}} 115 | 116 | ## List Types 117 | 118 | #### Ordered List 119 | 120 | 1. First item 121 | 2. Second item 122 | 3. Third item 123 | 124 | #### Unordered List 125 | 126 | * List item 127 | * Another item 128 | * And another item 129 | 130 | #### Nested list 131 | 132 | * Item 133 | 1. First Sub-item 134 | 2. Second Sub-item 135 | 136 | ## Other Elements — abbr, sub, sup, kbd, mark 137 | 138 | GIF is a bitmap image format. 139 | 140 | H2O 141 | 142 | Xn + Yn = Zn 143 | 144 | Press CTRL+ALT+Delete to end the session. 145 | 146 | Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. 147 | 148 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hugo-theme-pure 2 | 3 | A port of [hexo-theme-pure](https://github.com/cofess/hexo-theme-pure) for Hugo. Powerful & Clean. [Iconfont](http://blog.cofess.com/hexo-theme-pure/iconfont/demo_fontclass.html) 4 | 5 | [简体中文](README-ZH.md) 6 | 7 | ## Contribute 8 | 9 | Since I mainly do back-end development, I don’t know anything about the front-end (`CSS` or something). It’s a hard-hitting transplant. Some of the features that I like very much don’t know how to add it. It’s a waste of time to study too long, so If you have a very good `feature` and hope to put it up, it would be best. 10 | 11 | The file structure of `repo` is roughly referred to [hexo-theme-pure](https://github.com/cofess/hexo-theme-pure) and should be clearer. It can be modified according to your needs. If you look at the file structure a little, you will find that the function has not been implemented. 12 | 13 | ## Changelog 14 | 15 | 1. [2019-11-19] Add `mainSections` param to avoid hard code.You can set this param to choose which directory under your content folder you want to render. `posts` by default. You can also unset it,but there seems have some problem. 16 | 17 | 2. [2019-11-19] Support MathJax([PR](https://github.com/xiaoheiAh/hugo-theme-pure/pull/20)) Reference:[MathJax-With-Hugo](https://gohugo.io/content-management/formats/#mathjax-with-hugo)& Upgrade jQuery version([PR](https://github.com/xiaoheiAh/hugo-theme-pure/pull/19)). 18 | 19 | e.g. 20 | 21 | ```latex 22 | $$\begin{cases} 23 | a_1x+b_1y+c_1z=d_1\\ 24 | a_2x+b_2y+c_2z=d_2\\ 25 | a_3x+b_3y+c_3z=d_3\\ 26 | \end{cases} 27 | $$ 28 | ``` 29 | 30 |
31 |
32 |
33 | 3. [2019-12-07] beautify toc by [tocbot](https://github.com/tscanlin/tocbot/)
34 |
35 | 4. [2019-12-24] support pagination
36 |
37 | 5. [2019-12-31]
38 | 1. support highlight shortcode Note: Just compatible with basic `highlight` usage like:
39 |
40 | ```html
41 | {{< highlight go >}}
42 | // ... code
43 | {{< / highlight >}}
44 | ```
45 |
46 | If you use hugo official example like,rendering will be very ugly.I don't want to compatible with it or maybe you want. Don't forget send a pr~ thanks.
47 |
48 | ```html
49 | {{< highlight go "linenos=table,hl_lines=8 15-17,linenostart=199" >}}
50 | // ... code
51 | {{< / highlight >}}
52 | ```
53 |
54 | 2. Minify css&js file.
55 |
56 | ## Screenshots
57 |
58 | 
59 |
60 | 
61 |
62 | 
63 |
64 | 
65 |
66 | 
67 |
68 | ## Installation
69 |
70 | ```bash
71 | $ cd $HUGO_ROOT
72 | $ git clone https://github.com/xiaoheiAh/hugo-theme-pure themes/pure
73 | $ ./hugo server -t pure
74 | ```
75 |
76 | ### **Note**
77 |
78 | 1. Please copy the config.yml under the `exampleSite` folder to the root folder of your Hugo Site. Feel free to change it. If you don't like `.yml` file, you can also convert it to you want.
79 |
80 | 2. Your post should under the `posts` folder, like this : `hugo new posts/any.md`
81 |
82 | ## Multilingual
83 |
84 | Translations are collected from the [`themes/even/i18n/`](https://github.com/olOwOlo/hugo-theme-even/tree/master/i18n) folder (built into the theme), as well as present in `i18n` at your root of project.
85 |
86 | You can specify `defaultContentLanguage` to use translations.
87 |
88 | ```yml
89 | defaultContentLanguage: zh # en,fr...
90 | ```
91 |
92 | Currently supports English and Chinese, you can see `en.yml` and `zh.yml` under `pure/i18n`. If you want to support other language, you can copy any yml file under `i18n` and rename to new language, then feel free to translate.
93 |
94 | ## Favicon & Images
95 |
96 | You should put you images into `static` folder at your root project. When specify `favicon` or `donate qr code` , don't use absolute url like `/favicon.ico`, please use relative url like `favicon.ico` or `donate/alipay.png`
97 |
98 | ## Menu Icons
99 |
100 | You can configure the menu according to the icons of [Iconfont](http://blog.cofess.com/hexo-theme-pure/iconfont/demo_fontclass.html), the following is configuration.
101 |
102 | ```yml
103 | menuIcons:
104 | enable: true
105 | home: icon-home-fill
106 | archives: icon-archives-fill
107 | categories: icon-folder
108 | tags: icon-tags
109 | repository: icon-project
110 | books: icon-book-fill
111 | links: icon-friendship
112 | about: icon-cup-fill
113 | ```
114 |
115 | ## TOC
116 |
117 | enable toc
118 |
119 | ```yml
120 | # config
121 | config:
122 | toc: true
123 | ```
124 |
125 |
126 |
127 | ## TODO
128 |
129 | - [x] TOC
130 | - [x] pagination
131 |
132 | ## License
133 |
134 | Released under the [MIT](https://github.com/olOwOlo/hugo-theme-even/blob/master/LICENSE.md) License.
135 |
136 | ## Acknowledgements
137 |
138 | - [hexo-theme-pure](https://github.com/cofess/hexo-theme-pure)
139 |
140 | - [hugo-theme-even](https://github.com/olOwOlo/hugo-theme-even)
141 |
142 |
143 |
144 |
--------------------------------------------------------------------------------
/exampleSite/config.yml:
--------------------------------------------------------------------------------
1 | baseURL: https://example.com/
2 | theme: pure
3 | title: Pure theme for Hugo
4 | copyright: CC BY 4.0 CN
5 | defaultContentLanguage: en # en/zh/...
6 | footnoteReturnLinkContents: ↩
7 | hasCJKLanguage: true
8 | paginate: 7
9 | enableEmoji: true
10 | PygmentsCodeFences: false
11 | googleAnalytics: "" # UA-XXXXXXXX-X
12 | permalinks:
13 | posts: /:year/:month/:filename/
14 |
15 | taxonomies:
16 | category : categories
17 | tag : tags
18 | series : series
19 | outputFormats: # use for search. recommend not to modify
20 | SearchIndex:
21 | mediaType: "application/json"
22 | baseName: "searchindex"
23 | isPlainText: true
24 | notAlternative: true
25 |
26 | outputs:
27 | home: ["HTML","RSS","SearchIndex"] # recommend not to modify
28 | # sitemap
29 | sitemap:
30 | changefreq: monthly
31 | filename: sitemap.xml
32 | priority: 0.5
33 |
34 | menu:
35 | main:
36 | - identifier: home
37 | name: Home
38 | title: Home
39 | url: /
40 | weight: 1
41 |
42 | - identifier: archives
43 | name: Archives
44 | title: Archives
45 | url: /posts/
46 | weight: 2
47 |
48 | - identifier: categories
49 | name: Categories
50 | title: Categories
51 | url: /categories/
52 | weight: 3
53 |
54 | - identifier: tags
55 | name: Tags
56 | title: Tags
57 | url: /tags/
58 | weight: 4
59 |
60 | - identifier: about
61 | name: About
62 | title: About
63 | url: /about/
64 | weight: 5
65 |
66 |
67 | params:
68 | since: 2017
69 | dateFormatToUse: "2006-01-02"
70 | enablePostCopyright: true
71 | copyright_link: http://creativecommons.org/licenses/by/4.0/deed.zh
72 | # the directory under content folder that you want to render
73 | mainSections: ["posts"]
74 | # Enable/Disable menu icons
75 | # Icon Reference: http://blog.cofess.com/hexo-theme-pure/iconfont/demo_fontclass.html
76 | enableMathJax: true #Enable mathjax support, to use mathematical notations
77 | highlightjs:
78 | langs: ["python", "javascript"] # refer to http://staticfile.org/, search highlight.js, already have highlight.min.js
79 |
80 | tag_cloud:
81 | min: 8
82 | max: 20
83 | # Allows you to specify an override stylesheet
84 | # put custom.css in $hugo_root_dir/static/
85 | # customCSS: css/custom.css
86 |
87 | menuIcons:
88 | enable: true # 是否启用导航菜单图标
89 | home: icon-home-fill
90 | archives: icon-archives-fill
91 | categories: icon-folder
92 | tags: icon-tags
93 | repository: icon-project
94 | books: icon-book-fill
95 | links: icon-friendship
96 | about: icon-cup-fill
97 |
98 | # profile
99 | profile:
100 | enabled: true # Whether to show profile bar
101 | avatar: avatar.png
102 | gravatar: # Gravatar email address, if you enable Gravatar, your avatar config will be overriden
103 | author: xiaoheiAh
104 | author_title: author title
105 | author_description: Good Good Study, Day Day Up~
106 | location: Shanghai, China
107 | follow: https://github.com/xiaoheiAh
108 | # Social Links
109 | social:
110 | links:
111 | github: https://github.com/xiaoheiAh
112 | # weibo: http://weibo.com/{yourid}
113 | # twitter: https://twitter.com/
114 | # facebook: /
115 | rss: /index.xml
116 | link_tooltip: false # enable the social link tooltip, options: true, false
117 | # Site
118 | site:
119 | logo:
120 | enabled: true
121 | width: 40
122 | height: 40
123 | url: favicon.ico
124 | title: Hugo # 页面title
125 | favicon: favicon.ico
126 | board: enjoy~
# 公告牌 127 | 128 | # Share 129 | # weibo,qq,qzone,wechat,tencent,douban,diandian,facebook,twitter,google,linkedin 130 | share: 131 | enable: true # 是否启用分享 132 | sites: weibo,qq,wechat,facebook,twitter # PC端显示的分享图标 133 | mobile_sites: weibo,qq,qzone # 移动端显示的分享图标 134 | 135 | # Comment 136 | comment: 137 | type: # type disqus/gitalk/valine 启用哪种评论系统 138 | disqus: your_disqus_name # enter disqus shortname here 139 | gitalk: # gitalk. https://gitalk.github.io/ 140 | owner: #必须. GitHub repository 所有者,可以是个人或者组织。 141 | admin: #必须. GitHub repository 的所有者和合作者 (对这个 repository 有写权限的用户)。 142 | repo: #必须. GitHub repository. 143 | ClientID: #必须. GitHub Application Client ID. 144 | ClientSecret: #必须. GitHub Application Client Secret. 145 | valine: # Valine. https://valine.js.org 146 | appid: # your leancloud application appid 147 | appkey: # your leancloud application appkey 148 | notify: # mail notifier , https://github.com/xCss/Valine/wiki 149 | verify: # Verification code 150 | placeholder: enjoy~ # comment box placeholder 151 | avatar: mm # gravatar style 152 | meta: nick,mail # custom comment header 153 | pageSize: 10 # pagination size 154 | visitor: false # Article reading statistic https://valine.js.org/visitor.html 155 | 156 | # Donate 157 | donate: 158 | enable: false 159 | # 微信打赏 160 | wechatpay: 161 | qrcode: donate/wechatpayimg.png 162 | title: 微信支付 163 | # 支付宝打赏 164 | alipay: 165 | qrcode: donate/alipayimg.png 166 | title: 支付宝 167 | 168 | # PV 169 | pv: 170 | busuanzi: 171 | enable: false # 不蒜子统计 172 | leancloud: 173 | enable: false # leancloud统计 174 | app_id: # leancloud').addClass('ins-search-preview').text(preview) : null)
23 | .attr('data-url', url);
24 | }
25 |
26 | function sectionFactory (type, array) {
27 | var sectionTitle;
28 | var $searchItems;
29 | if (array.length === 0) return null;
30 | sectionTitle = CONFIG.TRANSLATION[type];
31 | switch (type) {
32 | case 'POSTS':
33 | $searchItems = array.map(function (item) {
34 | // Use config.root instead of permalink to fix url issue
35 | return searchItem('file', item.title, null, item.content.slice(0, 150), item.uri);
36 | });
37 | break;
38 | case 'CATEGORIES':
39 | case 'TAGS':
40 | $searchItems = array.map(function (item) {
41 | return searchItem(type === 'CATEGORIES' ? 'folder' : 'tag', item.title, '', null, item.uri);
42 | });
43 | break;
44 | default:
45 | return null;
46 | }
47 | return section(sectionTitle).append($searchItems);
48 | }
49 |
50 | function parseKeywords (keywords) {
51 | return keywords.split(' ').filter(function (keyword) {
52 | return !!keyword;
53 | }).map(function (keyword) {
54 | return keyword.toUpperCase();
55 | });
56 | }
57 |
58 | /**
59 | * Judge if a given post/page/category/tag contains all of the keywords.
60 | * @param Object obj Object to be weighted
61 | * @param Array