├── .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 |
2 |

{{ .Inner | markdownify }}

3 |
-------------------------------------------------------------------------------- /exampleSite/content/posts/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | aliases = ["posts","articles","blog","showcase","docs"] 3 | title = "Posts" 4 | author = "Hugo Authors" 5 | tags = ["index"] 6 | +++ -------------------------------------------------------------------------------- /layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{- define "content"}} 2 | {{- partial "sidebar-toc.html" . }} 3 |
4 | {{- partial "article.html" . }} 5 |
6 | {{- end}} -------------------------------------------------------------------------------- /layouts/partials/_script/analytics.html: -------------------------------------------------------------------------------- 1 | 2 | {{- if and (not .Site.IsServer) .Site.GoogleAnalytics -}} 3 | {{ template "_internal/google_analytics_async.html" . }} 4 | {{- end -}} -------------------------------------------------------------------------------- /layouts/partials/post/title.html: -------------------------------------------------------------------------------- 1 |

2 | {{- .Title -}} 7 |

8 | -------------------------------------------------------------------------------- /exampleSite/content/homepage/about.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Our Difference' 3 | button: 'About us' 4 | weight: 2 5 | --- 6 | 7 | Lorem ipsum dolor sit amet, et essent mediocritatem quo, choro volumus oporteat an mei. ipsum dolor sit amet, et essent mediocritatem quo, -------------------------------------------------------------------------------- /layouts/partials/post/tag.html: -------------------------------------------------------------------------------- 1 | {{- with .Params.tags}} 2 | 3 |   4 | {{- range . }} 5 | {{ . }} 6 | {{- end}} 7 | 8 | {{- end }} 9 | -------------------------------------------------------------------------------- /layouts/partials/sidebar.html: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /layouts/partials/post/category.html: -------------------------------------------------------------------------------- 1 | {{- with .Params.categories -}} 2 | 3 |   4 | {{- range . }} 5 | {{ . }} 6 | {{- end}} 7 | 8 | {{- end }} -------------------------------------------------------------------------------- /layouts/partials/_widgets/board.html: -------------------------------------------------------------------------------- 1 |
2 |

{{ T "widget_board" }}

3 |
4 |
5 |
6 | {{- printf $.Site.Params.site.board | safeHTML }} 7 |
8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /layouts/partials/item-post.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /layouts/partials/post/date.html: -------------------------------------------------------------------------------- 1 | {{ if .Date }} 2 | 3 |   4 | 5 | 6 | 7 | 8 | {{ end }} -------------------------------------------------------------------------------- /layouts/partials/sidebar-toc.html: -------------------------------------------------------------------------------- 1 | {{- if .Site.Params.config.toc }} 2 | 10 | {{- end }} -------------------------------------------------------------------------------- /layouts/partials/social.html: -------------------------------------------------------------------------------- 1 | {{- $social := .Site.Params.profile.social }} 2 | {{- with $social }} 3 | 9 | {{- end }} -------------------------------------------------------------------------------- /layouts/partials/math.html: -------------------------------------------------------------------------------- 1 | 2 | 10 | -------------------------------------------------------------------------------- /exampleSite/content/homepage/work.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'We Help Business Grow' 3 | button: 'Our Work' 4 | weight: 1 5 | --- 6 | 7 | Lorem ipsum dolor sit amet, et essent mediocritatem quo, choro volumus oporteat an mei. Numquam dolores mel eu, mea docendi omittantur et, mea ea duis erat. Elit melius cu ius. Per ex novum tantas putant, ei his nullam aliquam apeirian. Aeterno quaestio constituto sea an, no eum intellegat assueverit. -------------------------------------------------------------------------------- /layouts/partials/post/wc.html: -------------------------------------------------------------------------------- 1 | {{- $postCount := .Site.Params.postCount }} 2 | {{- $page := .Page}} 3 | {{- with $postCount.enable }} 4 | {{- with $postCount.wordcount }} 5 | 6 | {{- end }} 7 | {{- with $postCount.min2read }} 8 | 9 | {{- end }} 10 | {{- end }} -------------------------------------------------------------------------------- /layouts/partials/_widgets/tag.html: -------------------------------------------------------------------------------- 1 |
2 |

{{ T "widget_tags" }}

3 |
4 | 12 | 13 |
14 |
-------------------------------------------------------------------------------- /layouts/partials/_widgets/category.html: -------------------------------------------------------------------------------- 1 |
2 |

{{ T "widget_categories" }}

3 |
4 | 11 |
12 |
-------------------------------------------------------------------------------- /static/fonts/README.md: -------------------------------------------------------------------------------- 1 | # Font Assets 2 | 3 | If you are providing web font files, this is the place to put them. The fonts task will copy them over to the destination specified in `config.json`, and file names will be reved in production builds (if enabled). 4 | 5 | If you don't plan using web fonts, or are relying on an external service like Google Fonts, feel free to delete this folder and the `tasks.fonts` config in `gulpfile.js/config.json`. 6 | 7 | ### Tasks and Files 8 | ``` 9 | gulpfile.js/tasks/fonts 10 | ``` 11 | All this task does is copy fonts from `./src/fonts` to `./public/fonts`. 12 | 13 | A sass `+font-face` mixin is included in `./src/stylesheets/base/mixins`. 14 | -------------------------------------------------------------------------------- /theme.toml: -------------------------------------------------------------------------------- 1 | # theme.toml template for a Hugo theme 2 | # See https://github.com/gohugoio/hugoThemes#themetoml for an example 3 | 4 | name = "Hugo Theme Pure" 5 | license = "MIT" 6 | licenselink = "https://github.com/xiaoheiAh/hugo-theme-pure/blob/master/LICENSE" 7 | description = "A powerful and pure theme for hugo~enjoy~" 8 | homepage = "https://xiaohei.im/" 9 | tags = [ 10 | "blog", 11 | "clean", 12 | "simple", 13 | "dark", 14 | "white", 15 | "search" 16 | ] 17 | features = [] 18 | min_version = "0.57.2" 19 | 20 | [author] 21 | name = "xiaoheiah" 22 | homepage = "https://xiaohei.im" 23 | 24 | [original] 25 | name = "hexo-theme-pure" 26 | homepage = "https://blog.cofess.com" 27 | repo = "https://github.com/cofess/hexo-theme-pure" 28 | -------------------------------------------------------------------------------- /layouts/partials/footer.html: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /layouts/partials/pagination.html: -------------------------------------------------------------------------------- 1 | {{ $paginator := .Paginate .Site.RegularPages }} 2 | 28 | -------------------------------------------------------------------------------- /layouts/partials/post/comment.html: -------------------------------------------------------------------------------- 1 | {{- $comment := .Site.Params.comment}} 2 | {{- with $comment }} 3 |
4 | {{- if eq $comment.type "disqus" }} 5 |
6 | 7 |
8 | {{- else if eq $comment.type "youyan" }} 9 |
10 | {{- else if eq $comment.type "livere" }} 11 |
12 | 13 |
14 | {{- else if eq $comment.type "gitment" }} 15 | 16 | {{- else if eq $comment.type "gitalk" }} 17 | 18 | {{- else if eq $comment.type "valine" }} 19 |
20 | {{- end }} 21 |
22 | {{- end }} 23 | -------------------------------------------------------------------------------- /layouts/partials/_widgets/recent_posts.html: -------------------------------------------------------------------------------- 1 | {{- if $.Site.RegularPages }} 2 |
3 |

{{T "widget_recent_posts" }}

4 |
5 | 19 |
20 |
21 | {{- end }} -------------------------------------------------------------------------------- /layouts/partials/card-post.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 7 |

8 | {{- .Title }} 9 |

10 |
11 | {{- with .Params.tags }} 12 | 20 | {{- end }} 21 |
-------------------------------------------------------------------------------- /layouts/partials/post/pv.html: -------------------------------------------------------------------------------- 1 | {{- with .Site.Params.pv.busuanzi.enable }} 2 | 8 | {{- end }} 9 | {{- if .Site.Params.pv.leancloud.enable }} 10 | 14 | {{- else if (and (eq .Site.Params.comment.type "valine") (.Site.Params.comment.valine.visitor)) }} 15 | 21 | {{- end }} -------------------------------------------------------------------------------- /exampleSite/content/posts/rich-content.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "Hugo Authors" 3 | title = "Rich Content" 4 | date = "2019-03-10" 5 | description = "A brief description of Hugo Shortcodes" 6 | tags = [ 7 | "shortcodes", 8 | "privacy", 9 | ] 10 | +++ 11 | 12 | Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-management/shortcodes/#use-hugo-s-built-in-shortcodes) for rich content, along with a [Privacy Config](https://gohugo.io/about/hugo-and-gdpr/) and a set of Simple Shortcodes that enable static and no-JS versions of various social media embeds. 13 | 14 | --- 15 | 16 | ## Instagram Simple Shortcode 17 | 18 | {{< instagram BGvuInzyFAe hidecaption >}} 19 | 20 |
21 | 22 | --- 23 | 24 | ## YouTube Privacy Enhanced Shortcode 25 | 26 | {{< youtube ZJthWmvUzzc >}} 27 | 28 |
29 | 30 | --- 31 | 32 | ## Twitter Simple Shortcode 33 | 34 | {{< twitter 1085870671291310081 >}} 35 | 36 |
37 | 38 | --- 39 | 40 | ## Vimeo Simple Shortcode 41 | 42 | {{< vimeo 48912912 >}} 43 | -------------------------------------------------------------------------------- /layouts/_default/sitemap.xml: -------------------------------------------------------------------------------- 1 | {{ printf "" | safeHTML }} 2 | 4 | {{ range .Data.Pages }} 5 | 6 | {{ .Permalink }}{{ if not .Lastmod.IsZero }} 7 | {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} 8 | {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} 9 | {{ .Sitemap.Priority }}{{ end }}{{ if .IsTranslated }}{{ range .Translations }} 10 | {{ end }} 15 | {{ end }} 20 | 21 | {{ end }} 22 | 23 | -------------------------------------------------------------------------------- /layouts/_default/list.searchindex.json: -------------------------------------------------------------------------------- 1 | {{- $.Scratch.Add "categories" slice -}} 2 | {{- range .Site.Taxonomies.categories -}} 3 | {{- $.Scratch.Add "categories" (dict "title" .Page.Title "uri" .Page.Permalink ) -}} 4 | {{- end -}} 5 | {{- $.Scratch.Add "tags" slice -}} 6 | {{- range .Site.Taxonomies.tags -}} 7 | {{- $.Scratch.Add "tags" (dict "title" .Page.Title "uri" .Page.Permalink) -}} 8 | {{- end -}} 9 | {{- $.Scratch.Add "posts" slice -}} 10 | 11 | {{- range $index, $element := $.Scratch.Get "pages" -}} 12 | {{- $.Scratch.Add "posts" (dict "id" $index "title" $element.Title "uri" $element.Permalink "tags" $element.Params.tags "section" $element.Section "content" $element.Plain "summary" $element.Summary "year" ($element.Date.Format "2006")) -}} 13 | {{- end -}} 14 | {{- $.Scratch.SetInMap "searchindex" "posts" ($.Scratch.Get "posts") }} 15 | {{- $.Scratch.SetInMap "searchindex" "tags" ($.Scratch.Get "tags") }} 16 | {{- $.Scratch.SetInMap "searchindex" "categories" ($.Scratch.Get "categories") }} 17 | {{- $.Scratch.Get "searchindex" | jsonify -}} -------------------------------------------------------------------------------- /layouts/_default/tag.html: -------------------------------------------------------------------------------- 1 | {{- define "content" }} 2 | {{- $tags := .Site.Taxonomies.tags }} 3 |
4 |
5 |
6 |

{{- .Title }}

7 | 8 | 16 |
17 | 18 |
19 | {{- range .Pages }} 20 |
21 | {{- partial "card-post.html" . }} 22 |
23 | {{- end }} 24 |
25 |
26 |
27 | {{- end }} -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 xiaoheiah 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /layouts/partials/_widgets/tag_cloud.html: -------------------------------------------------------------------------------- 1 |
2 |

{{ T "widget_tags" }}

3 |
4 | {{ range $name, $taxonomy := $.Site.Taxonomies.tags }} 5 | {{ with $.Site.GetPage (printf "/tags/%s" $name) }} 6 | {{ $name }}{{ $taxonomy.Count}} 8 | {{ end }} 9 | {{- end }} 10 |
11 | 33 |
34 | -------------------------------------------------------------------------------- /layouts/partials/search.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /layouts/404.html: -------------------------------------------------------------------------------- 1 | {{- define "content" }} 2 |
3 |
4 |
5 |
6 |

7 | {{ T "page_not_found_heading" }} 8 |

9 |
10 | 20 |
21 |
22 |

{{ T "page_not_found_body" }}

23 | {{ T "page_not_found_back" }} 24 |
25 | 28 |
29 | {{- partial "post/comment.html" . }} 30 |
31 | {{- partial "post/donate.html" . }} 32 |
33 | {{- end -}} -------------------------------------------------------------------------------- /exampleSite/content/about.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "About" 3 | description = "Hugo, the world’s fastest framework for building websites" 4 | date = "2019-02-28" 5 | aliases = ["about-us","about-hugo","contact"] 6 | author = "Hugo Authors" 7 | +++ 8 | 9 | Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows. 10 | 11 | Hugo makes use of a variety of open source projects including: 12 | 13 | * https://github.com/russross/blackfriday 14 | * https://github.com/alecthomas/chroma 15 | * https://github.com/muesli/smartcrop 16 | * https://github.com/spf13/cobra 17 | * https://github.com/spf13/viper 18 | 19 | Hugo is ideal for blogs, corporate websites, creative portfolios, online magazines, single page applications or even a website with thousands of pages. 20 | 21 | Hugo is for people who want to hand code their own website without worrying about setting up complicated runtimes, dependencies and databases. 22 | 23 | Websites built with Hugo are extremelly fast, secure and can be deployed anywhere including, AWS, GitHub Pages, Heroku, Netlify and any other hosting provider. 24 | 25 | Learn more and contribute on [GitHub](https://github.com/gohugoio). 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /layouts/partials/article.html: -------------------------------------------------------------------------------- 1 |
2 |
4 | 5 | {{- partial "post/gallery" .}} 6 |
7 | {{- if or (.Permalink) (.Title)}} 8 | {{ .Scratch.Set "class_name" "article-title" }} 9 | {{- partial "post/title.html" . }} 10 | {{- end }} 11 | 23 |
24 |
25 | {{ .Content }} 26 |
27 | 30 |
31 | {{- if (.Site.Params.comment.type) }} 32 | {{- partial "post/comment.html" . }} 33 | {{- end }} 34 |
35 | {{- partial "post/nav.html" . }} 36 | {{- partial "post/donate.html" . }} 37 | -------------------------------------------------------------------------------- /layouts/_default/tag.terms.html: -------------------------------------------------------------------------------- 1 | {{- define "content"}} 2 | {{- $tags := .Site.Taxonomies.tags }} 3 |
4 |
5 |
6 |

{{- .Title }}

7 | 8 | 16 |
17 | 18 |
19 | {{- range $name, $taxonomy := $tags }} 20 |

21 | # {{ $name }} 22 | (Total {{- .Count }} articles) 23 |

24 |
25 | {{- range $taxonomy }} 26 |
27 | {{- partial "card-post.html" . }} 28 |
29 | {{- end }} 30 |
31 | {{- end }} 32 |
33 |
34 |
35 | {{- end }} -------------------------------------------------------------------------------- /layouts/partials/post/copyright.html: -------------------------------------------------------------------------------- 1 | {{- if .Site.Params.enablePostCopyright }} 2 |
3 | 17 |
18 | {{ $profile := .Site.Params.profile }} 19 | {{- with $profile.enabled }} 20 |
21 |
22 |
23 |
24 | 25 | 26 | 27 |
28 |
29 |

{{- $profile.author }}{{- $profile.author_title }}

30 |
{{- $profile.author_description }}
31 |
32 |
33 |
34 |
35 | {{- end }} 36 | {{- end }} 37 | -------------------------------------------------------------------------------- /layouts/index.html: -------------------------------------------------------------------------------- 1 | {{- define "content"}} 2 | 3 |
4 | {{/* partial "archive-list.html" . - */}} 5 |
6 | 7 | {{ $paginator := .Paginate ($.Scratch.Get "pages") }} 8 | {{ range $paginator.Pages }} 9 |
14 |
15 | {{- .Scratch.Set "class_name" "article-title" }} 16 | {{ partial "post/title.html" . -}} 17 | {{- .Scratch.Delete "class_name"}} 18 |
19 | {{- if .Description }} 20 |
21 | {{- .Description -}} 22 |
23 | {{ else if .Summary }} 24 |
25 | {{ .Summary }} 26 |
27 | {{- end }} 28 | 37 |
38 | {{- end -}} 39 |
40 | {{ partial "pagination.html" . }} 41 |
42 | {{- end }} 43 | 44 | -------------------------------------------------------------------------------- /layouts/_default/rss.xml: -------------------------------------------------------------------------------- 1 | {{ printf "" | safeHTML }} 2 | 3 | 4 | {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} 5 | {{ .Permalink }} 6 | Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} 7 | Hugo -- gohugo.io{{ with .Site.LanguageCode }} 8 | {{.}}{{end}}{{ with .Site.Author.email }} 9 | {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} 10 | {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} 11 | {{.}}{{end}}{{ if not .Date.IsZero }} 12 | {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} 13 | {{ with .OutputFormats.Get "RSS" }} 14 | {{ printf "" .Permalink .MediaType | safeHTML }} 15 | {{ end }} 16 | {{ range (.Paginate .Site.RegularPages 20).Pages }} 17 | 18 | {{ .Title }} 19 | {{ .Permalink }} 20 | {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} 21 | {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} 22 | {{ .Permalink }} 23 | {{ .Summary | html }} 24 | 25 | {{ end }} 26 | 27 | 28 | -------------------------------------------------------------------------------- /layouts/_default/baseof.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{- block "title" . -}} 6 | {{ if .IsPage }} 7 | {{ .Title }} - {{ .Site.Title }} 8 | {{ else}} 9 | {{ .Site.Title}}{{ end }} 10 | {{- end -}} 11 | 12 | {{ partial "head.html" . }} 13 | 14 | {{- $.Scratch.Add "bodyClass" slice }} 15 | {{- $config := .Site.Params.config }} 16 | {{- if $config.layout }} 17 | {{- $.Scratch.Add "bodyClass" $config.layout }} 18 | {{- else }} 19 | {{- $.Scratch.Add "bodyClass" "main-center" }} 20 | {{- end }} 21 | {{- with $config.skin }} 22 | {{- $.Scratch.Add "bodyClass" . }} 23 | {{- end}} 24 | {{- if eq .Site.Params.sidebar "none"}} 25 | {{- $.Scratch.Add "bodyClass" "no-sidebar" }} 26 | {{- end }} 27 | 28 | 29 | 30 | {{- if ($.Scratch.Get "pages") }} 31 | {{- $.Scratch.Delete "pages"}} 32 | {{- end}} 33 | {{- if and (.Site.Params.mainSections) (ge (len .Site.Params.mainSections) 0) }} 34 | {{- $.Scratch.Add "pages" (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }} 35 | {{- else }} 36 | {{- $.Scratch.Add "pages" (.Site.RegularPages) }} 37 | {{- end }} 38 | 39 | 40 | {{- partial "header.html" .}} 41 | {{- if and (.Site.Params.sidebar) (or (ne .Params.sidebar "none") (ne .Params.sidebar "custom"))}} 42 | {{- partial "sidebar.html" . }} 43 | {{end}} 44 | {{ block "content" . }}{{ end }} 45 | {{- partial "footer.html" . }} 46 | {{- partial "script.html" . }} 47 | 48 | 49 | -------------------------------------------------------------------------------- /exampleSite/content/posts/emoji-support.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "Hugo Authors" 3 | title = "Emoji Support" 4 | date = "2019-03-05" 5 | description = "Guide to emoji usage in Hugo" 6 | tags = [ 7 | "emoji", 8 | ] 9 | +++ 10 | 11 | Emoji can be enabled in a Hugo project in a number of ways. 12 | 13 | The [`emojify`](https://gohugo.io/functions/emojify/) function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes). 14 | 15 | To enable emoji globally, set `enableEmoji` to `true` in your site’s [configuration](https://gohugo.io/getting-started/configuration/) and then you can type emoji shorthand codes directly in content files; e.g. 16 | 17 | 18 |

🙈 :see_no_evil: 🙉 :hear_no_evil: 🙊 :speak_no_evil:

19 |
20 | 21 | The [Emoji cheat sheet](http://www.emoji-cheat-sheet.com/) is a useful reference for emoji shorthand codes. 22 | 23 | *** 24 | 25 | **N.B.** The above steps enable Unicode Standard emoji characters and sequences in Hugo, however the rendering of these glyphs depends on the browser and the platform. To style the emoji you can either use a third party emoji font or a font stack; e.g. 26 | 27 | {{< highlight html >}} 28 | .emoji { 29 | font-family: Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols; 30 | } 31 | {{< /highlight >}} 32 | 33 | {{< css.inline >}} 34 | 47 | {{< /css.inline >}} -------------------------------------------------------------------------------- /exampleSite/content/posts/math-typesetting.mmark: -------------------------------------------------------------------------------- 1 | --- 2 | author: Hugo Authors 3 | title: Math Typesetting 4 | date: 2019-03-08 5 | description: A brief guide to setup KaTeX 6 | markup: mmark 7 | math: true 8 | --- 9 | 10 | Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries. 11 | 12 | 13 | In this example we will be using [KaTeX](https://katex.org/) 14 | 15 | - Create a partial under `/layouts/partials/math.html` 16 | - Within this partial reference the [Auto-render Extension](https://katex.org/docs/autorender.html) or host these scripts locally. 17 | - Include the partial in your templates like so: 18 | 19 | ``` 20 | {{ if or .Params.math .Site.Params.math }} 21 | {{ partial "math.html" . }} 22 | {{ end }} 23 | ``` 24 | - To enable KaTex globally set the parameter `math` to `true` in a project's configuration 25 | - To enable KaTex on a per page basis include the parameter `math: true` in content files. 26 | 27 | **Note:** Use the online reference of [Supported TeX Functions](https://katex.org/docs/supported.html) 28 | {{< math.inline >}} 29 | {{ if or .Page.Params.math .Site.Params.math }} 30 | 31 | 32 | 33 | 34 | {{ end }} 35 | {{}} 36 | 37 | ### Examples 38 | 39 | Inline math: $$ \varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887… $$ 40 | 41 | Block math: 42 | 43 | $$ 44 | \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } 45 | $$ 46 | 47 | -------------------------------------------------------------------------------- /layouts/_default/category.html: -------------------------------------------------------------------------------- 1 | {{- define "content"}} 2 | {{- $categories := .Site.Taxonomies.categories }} 3 |
4 |
5 |
6 |

{{- .Title }}

7 | 8 | 16 |
17 | 18 |
19 |
20 | 29 |
31 |
32 |
33 | {{- range .Pages }} 34 | {{- partial "item-post.html" . }} 35 | {{- end }} 36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 | {{- end }} -------------------------------------------------------------------------------- /layouts/_default/category.terms.html: -------------------------------------------------------------------------------- 1 | {{- define "content"}} 2 | {{- $categories := .Site.Taxonomies.categories }} 3 |
4 |
5 |
6 |

{{- .Title }}

7 | 8 | 16 |
17 | 18 |
19 | {{- range $name, $taxonomy := $categories }} 20 |
21 | 30 |
32 |
33 |
34 | {{- range $taxonomy}} 35 | {{- .Page.Scratch.Set "type" "link"}} 36 | {{- partial "item-post.html" . }} 37 | {{- end }} 38 |
39 |
40 |
41 |
42 | {{- end }} 43 |
44 |
45 |
46 | {{- end }} -------------------------------------------------------------------------------- /layouts/partials/_script/comment.html: -------------------------------------------------------------------------------- 1 | {{- $comment := .Site.Params.comment}} 2 | {{- if eq $comment.type "valine"}} 3 | 4 | 5 | 24 | {{- else if eq $comment.type "disqus" }} 25 | 37 | {{- else if eq $comment.type "gitalk" }} 38 | 39 | 40 | 41 | 53 | {{- end }} 54 | -------------------------------------------------------------------------------- /layouts/partials/header.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 23 | 43 |
44 |
45 | 46 | -------------------------------------------------------------------------------- /layouts/partials/post/nav.html: -------------------------------------------------------------------------------- 1 | 50 | -------------------------------------------------------------------------------- /assets/js/application.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | // bootstrap tooltip 3 | $('[data-toggle="tooltip"]').tooltip(); 4 | 5 | // slimscroll 6 | if (typeof $.fn.slimScroll != 'undefined') { 7 | $(".sidebar .slimContent").slimScroll({ 8 | height: $(window).height(), 9 | color: "rgba(0,0,0,0.15)", 10 | size: "5px", 11 | position: 'right', 12 | // allowPageScroll: true 13 | }); 14 | } 15 | 16 | $('#collapseToc').on('shown.bs.collapse', function() { 17 | // do something… 18 | // slimscroll 19 | if (typeof $.fn.slimScroll != 'undefined') { 20 | $(".sidebar .slimContent").slimScroll().on('slimscroll'); 21 | } 22 | }); 23 | 24 | // geopattern 背景生成 25 | $(".geopattern").each(function() { 26 | $(this).geopattern($(this).data('pattern-id')); 27 | }); 28 | 29 | // okayNav 30 | var navigation = $('#nav-main').okayNav({ 31 | swipe_enabled: false, // If true, you'll be able to swipe left/right to open the navigation 32 | }); 33 | 34 | // modal居中 35 | // $('.modal').on('shown.bs.modal', function(e) { 36 | // $(this).show(); 37 | // var modalDialog = $(this).find(".modal-dialog"); 38 | // // Applying the top margin on modal dialog to align it vertically center 39 | // modalDialog.css("margin-top", Math.max(0, ($(window).height() - modalDialog.height()) / 2)); 40 | // }); 41 | 42 | // sticky 43 | $('[data-stick-bottom]').keepInView({ 44 | fixed: false, 45 | parentClass: "has-sticky", 46 | customClass: "sticky", 47 | trigger: 'bottom', 48 | zindex: 42, 49 | edgeOffset: 0 50 | }); 51 | 52 | $('[data-stick-top]').keepInView({ 53 | fixed: true, 54 | parentClass: "has-sticky", 55 | customClass: "sticky", 56 | trigger: 'top', 57 | zindex: 42, 58 | edgeOffset: 0 59 | }); 60 | 61 | // menu auto highlight 62 | var menuHighlight = $("ul.main-nav").hasClass('menu-highlight'); 63 | if (menuHighlight) { 64 | var currentPathname = location.pathname, 65 | $menuList = $("ul.main-nav>li"), 66 | activeIndex = -1; 67 | for (var i = 0, length = $menuList.length; i < length; i++) { 68 | var itemHref = $($menuList[i]).find('a').attr('href'); 69 | if (currentPathname.indexOf(itemHref) > -1 || 70 | (currentPathname === '/' && (itemHref === '/.' || itemHref === '/' || itemHref === 'index.html' || itemHref === '/index.html'))) { 71 | activeIndex = i; 72 | } 73 | $($menuList[i]).removeClass('active'); 74 | } 75 | $menuList[activeIndex] && $($menuList[activeIndex]).addClass('active'); 76 | } 77 | }); 78 | -------------------------------------------------------------------------------- /layouts/partials/script.html: -------------------------------------------------------------------------------- 1 | {{ if or .Site.Params.enableMathJax .Params.math }} 2 | {{ partial "math.html" . }} 3 | {{ end }} 4 | 5 | 8 | 9 | {{- range .Site.Params.highlightjs.langs }} 10 | 11 | {{- end -}} 12 | 20 | {{- $appjs := resources.Get "js/application.js" | resources.Minify | resources.Fingerprint}} 21 | 22 | {{- $plugin := resources.Get "js/plugin.js" | resources.Minify | resources.Fingerprint}} 23 | 24 | 25 | 41 | {{- $insight := resources.Get "js/insight.js" | resources.Minify | resources.Fingerprint "sha512" }} 42 | 43 | 44 | 56 | {{- if eq .Type "repository" }} 57 | {{- partial "_script/repository.html" . }} 58 | {{- end}} 59 | 60 | {{- if .IsPage }} 61 | {{- partial "_script/pv.html" . }} 62 | {{- end }} 63 | {{- if in $.Site.Params.mainSections .Type }} 64 | {{- partial "_script/comment.html" . }} 65 | {{- end }} 66 | {{- partial "_script/fancybox.html" . }} 67 | {{- partial "_script/analytics.html" . }} -------------------------------------------------------------------------------- /layouts/partials/post/donate.html: -------------------------------------------------------------------------------- 1 | {{- $donate := .Site.Params.donate }} 2 | {{- with $donate.enable }} 3 | 4 | 50 | {{- end }} -------------------------------------------------------------------------------- /exampleSite/content/posts/placeholder-text.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "Hugo Authors" 3 | title = "Placeholder Text" 4 | date = "2019-03-09" 5 | description = "Lorem Ipsum Dolor Si Amet" 6 | tags = [ 7 | "markdown", 8 | "text", 9 | ] 10 | +++ 11 | 12 | Lorem est tota propiore conpellat pectoribus de 13 | pectora summo. Redit teque digerit hominumque toris verebor lumina non cervice 14 | subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc 15 | caluere tempus inhospita parcite confusaque translucet patri vestro qui optatis 16 | lumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum. 17 | 18 | 1. Exierant elisi ambit vivere dedere 19 | 2. Duce pollice 20 | 3. Eris modo 21 | 4. Spargitque ferrea quos palude 22 | 23 | Rursus nulli murmur; hastile inridet ut ab gravi sententia! Nomine potitus 24 | silentia flumen, sustinet placuit petis in dilapsa erat sunt. Atria 25 | tractus malis. 26 | 27 | 1. Comas hunc haec pietate fetum procerum dixit 28 | 2. Post torum vates letum Tiresia 29 | 3. Flumen querellas 30 | 4. Arcanaque montibus omnes 31 | 5. Quidem et 32 | 33 | # Vagus elidunt 34 | 35 | 36 | 37 | [The Van de Graaf Canon](https://en.wikipedia.org/wiki/Canons_of_page_construction#Van_de_Graaf_canon) 38 | 39 | ## Mane refeci capiebant unda mulcebat 40 | 41 | Victa caducifer, malo vulnere contra 42 | dicere aurato, ludit regale, voca! Retorsit colit est profanae esse virescere 43 | furit nec; iaculi matertera et visa est, viribus. Divesque creatis, tecta novat collumque vulnus est, parvas. **Faces illo pepulere** tempus adest. Tendit flamma, ab opes virum sustinet, sidus sequendo urbis. 44 | 45 | Iubar proles corpore raptos vero auctor imperium; sed et huic: manus caeli 46 | Lelegas tu lux. Verbis obstitit intus oblectamina fixis linguisque ausus sperare 47 | Echionides cornuaque tenent clausit possit. Omnia putatur. Praeteritae refert 48 | ausus; ferebant e primus lora nutat, vici quae mea ipse. Et iter nil spectatae 49 | vulnus haerentia iuste et exercebat, sui et. 50 | 51 | Eurytus Hector, materna ipsumque ut Politen, nec, nate, ignari, vernum cohaesit sequitur. Vel **mitis temploque** vocatus, inque alis, *oculos nomen* non silvis corpore coniunx ne displicet illa. Crescunt non unus, vidit visa quantum inmiti flumina mortis facto sic: undique a alios vincula sunt iactata abdita! Suspenderat ego fuit tendit: luna, ante urbem 52 | Propoetides **parte**. 53 | 54 | {{< css.inline >}} 55 | 58 | {{< /css.inline >}} 59 | -------------------------------------------------------------------------------- /README-ZH.md: -------------------------------------------------------------------------------- 1 | # hugo-theme-pure 使用指南 2 | 3 | [hexo-theme-pure](https://github.com/cofess/hexo-theme-pure) 移植版本. 简单,功能丰富使用. 4 | 5 | ## 参与 6 | 7 | 由于主要做后端开发,其实对前端(`CSS` 啥的)一窍不通,完全是硬着脑阔移植. 有些很喜欢的特性,并不知道怎么加,研究太久就会很浪费时间,所以如果你有很不错的 `feature` 希望能放上来,那是最好不过了. 8 | 9 | `repo` 的文件结构大致是参考 [hexo-theme-pure](https://github.com/cofess/hexo-theme-pure) 的,应该是比较清晰了. 可以根据你的需求针对性的修改.如果稍微看一下文件结构的话你会发现还有听过功能没有实现的. 10 | 11 | ## 特性 12 | 13 | 1. 多语言支持 14 | 2. 多种评论系统集成 15 | 3. 多种皮肤 16 | 4. 集成站内搜索(感谢[@ppoffice](https://github.com/ppoffice)提供的`insight.js`) 17 | 18 | ## 预览 19 | 20 | ![](https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/master/images/grey.png) 21 | 22 | ![](https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/master/images/black.png) 23 | 24 | ![](https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/master/images/blue.png) 25 | 26 | ![](https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/master/images/green.png) 27 | 28 | ![](https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/master/images/purple.png) 29 | 30 | ## 安装 31 | 32 | ```bash 33 | $ cd $HUGO_ROOT 34 | $ git clone https://github.com/xiaoheiAh/hugo-theme-pure themes/pure 35 | $ ./hugo server -t pure 36 | ``` 37 | 38 | ### 注意 39 | 40 | 1. 请拷贝`exampleSite` 下的 `config.yml` 进行自定义配置. 41 | 42 | 2. 需要将你的博客文件放到 `content/posts` 文件夹下,才能渲染出来. 即: `./hugo new posts/blabla.md` 43 | 44 | ## 多语言支持 45 | 46 | 目前支持英语和中文两种语言,如需其他语言可以在 [i18n](i18n/) 目录下新增其他语言的 `yml` 文件,内容与现有的语言对应即可. 47 | 48 | 设置网页默认语言, `config.yml:` 49 | 50 | ```yml 51 | defaultContentLanguage: zh # en,fr... 52 | ``` 53 | 54 | ## 主题颜色及布局 55 | 56 | 修改下列配置 57 | 58 | ```yml 59 | # config 60 | config: 61 | skin: theme-black # 主题颜色 theme-black theme-blue theme-green theme-purple 62 | layout: main-center # 布局方式 main-left main-center main-right 63 | ``` 64 | 65 | ## 图标 66 | 67 | 菜单栏有默认的图标展示,需要更换请参考 [Iconfont](http://blog.cofess.com/hexo-theme-pure/iconfont/demo_fontclass.html), 并更改相应的配置 68 | 69 | ```yml 70 | menuIcons: 71 | enable: true # 是否启用导航菜单图标 72 | home: icon-home-fill 73 | archives: icon-archives-fill 74 | categories: icon-folder 75 | tags: icon-tags 76 | repository: icon-project 77 | books: icon-book-fill 78 | links: icon-friendship 79 | about: icon-cup-fill 80 | ``` 81 | 82 | ## 评论 83 | 84 | 目前支持三种评论: **Disqus**, **Gitalk**, **Valine**, 加上对应配置即可. 85 | 86 | ## 图片资源 87 | 88 | 图片资源放在static目录下即可,具体根据 `config` 配置. 89 | 90 | ```yml 91 | site: 92 | favicon: favicon.ico 93 | profile: 94 | avatar: avatar.png 95 | ``` 96 | 97 | ## TOC 98 | 99 | 开启 toc 100 | 101 | ```yml 102 | # config 103 | config: 104 | toc: true 105 | ``` 106 | 107 | ## 捐赠 108 | 109 | 支持支付宝,微信付款码,需要先将二维码截出来并存放在 `static` 目录下.目前默认是在 `static/donate`. 需要的配置如下: 110 | 111 | ```yml 112 | # Donate 113 | donate: 114 | enable: true 115 | # 微信打赏 116 | wechatpay: 117 | qrcode: donate/wechatpayimg.png 118 | title: 微信支付 119 | # 支付宝打赏 120 | alipay: 121 | qrcode: donate/alipayimg.png 122 | title: 支付宝 123 | ``` 124 | 125 | ## License 126 | 127 | Released under the [MIT](https://github.com/olOwOlo/hugo-theme-even/blob/master/LICENSE.md) License. 128 | 129 | ## 鸣谢 130 | 131 | - [hexo-theme-pure](https://github.com/cofess/hexo-theme-pure) 132 | 133 | - [hugo-theme-even](https://github.com/olOwOlo/hugo-theme-even) 134 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /i18n/zh.yaml: -------------------------------------------------------------------------------- 1 | 2 | nav_all: 3 | other: All 4 | nav_older: 5 | other: 下一篇 6 | nav_newer: 7 | other: 上一篇 8 | 9 | 10 | page_home: 11 | other: 主页 12 | page_archive: 13 | other: 归档 14 | page_archives: 15 | other: 归档 16 | page_category: 17 | other: 分类 18 | page_categories: 19 | other: 分类 20 | page_tag: 21 | other: 标签 22 | page_tags: 23 | other: 标签 24 | page_tagcloud: 25 | other: 标签云 26 | page_uncategorized: 27 | other: 未分类 28 | page_repository: 29 | other: 项目 30 | page_douban: 31 | other: 豆瓣 32 | page_books: 33 | other: 书单 34 | page_books-desc: 35 | other: 个人收藏的书单推荐给大家 36 | page_movies: 37 | other: 电影 38 | page_movies-desc: 39 | other: 个人喜欢的电影推荐给大家 40 | page_links: 41 | other: 友情链接 42 | page_links-desc: 43 | other: 欢迎交换链接, 可在当前页面留言 44 | page_about: 45 | other: 关于 46 | 47 | pagination_next: 48 | other: 下一页 49 | pagination_prev: 50 | other: 上一页 51 | pagination_page: 52 | other: 第 %d 页 53 | pagination_pageof: 54 | other: Page %d of %s 55 | 56 | widget_search: 57 | other: 搜索 58 | widget_board: 59 | other: 公告 60 | widget_archive: 61 | other: 归档 62 | widget_tags: 63 | other: 标签 64 | widget_categories: 65 | other: 分类 66 | widget_tagcloud: 67 | other: 标签云 68 | widget_recent_posts: 69 | other: 最新文章 70 | 71 | 72 | profile_follow: 73 | other: 关注 74 | profile_skill: 75 | other: 技能 76 | profile_label: 77 | other: 个人标签 78 | profile_work: 79 | other: 个人作品 80 | profile_project: 81 | other: 个人项目 82 | profile_link: 83 | other: 个人链接 84 | 85 | unit_word: 86 | other: 字 87 | unit_time: 88 | other: 分 89 | 90 | article_wordcount: 91 | other: "字数统计: " 92 | article_readcount: 93 | other: "阅读时长: " 94 | article_more: 95 | other: 查看更多 96 | article_comments: 97 | other: 评论 98 | article_share: 99 | other: 分享到 100 | article_catalogue: 101 | other: 文章目录 102 | 103 | total_article: 104 | other: 共 {{ .Count }} 篇文章 105 | total_tag: 106 | other: 共 {{ .Count }} 个标签 107 | total_category: 108 | other: 共 {{ .Count }} 个分类 109 | total_link: 110 | other: 共 {{ .Count }} 友链 111 | total_repository: 112 | other: 共 {{ .Count }} 项目 113 | 114 | 115 | donate_qrcode_alt: 116 | other: 扫码支持 117 | donate_qrcode_title: 118 | other: 扫一扫 119 | donate_button: 120 | other: 赏 121 | donate_title: 122 | other: 感谢您的支持,我会继续努力的! 123 | donate_tip: 124 | other: 扫码打赏, 多少你说了算~ 125 | donate_alipay_action_tip: 126 | other: 打开支付宝扫一扫,即可进行扫码打赏哦~ 127 | donate_wechatpay_action_tip: 128 | other: 打开微信扫一扫,即可进行扫码打赏哦 129 | donate_alipay: 130 | other: 支付宝 131 | donate_wechatpay: 132 | other: 微信支付 133 | 134 | 135 | comment: 136 | other: 评论 137 | tweets: 138 | other: 推文 139 | share: 140 | other: Share 141 | rss_feed: 142 | other: RSS Feed 143 | 144 | 145 | copyright_theme_by: 146 | other: Theme by 147 | copyright_base_on: 148 | other: base on 149 | copyright_powered_by: 150 | other: Powered by 151 | 152 | copyright_post: 153 | other: 本文链接 154 | copyright_license: 155 | other: License 156 | 157 | 158 | insight_hint: 159 | other: 想要查找什么... 160 | insight_posts: 161 | other: 文章 162 | insight_pages: 163 | other: 页面 164 | insight_categories: 165 | other: 分类 166 | insight_tags: 167 | other: 标签 168 | insight_untitled: 169 | other: (未命名) 170 | 171 | page_not_found_heading: 172 | other: 404 Not Found 173 | page_not_found_body: 174 | other: 找不到页面啦~请换个姿势( ̄. ̄) 175 | page_not_found_back: 176 | other: 返回首页 177 | -------------------------------------------------------------------------------- /layouts/_default/list.html: -------------------------------------------------------------------------------- 1 | {{- define "content"}} 2 | {{$pages := $.Scratch.Get "pages"}} 3 |
4 |
5 |
6 |

{{ .Title }}

7 |

{{- T "total_article" (len $pages) }}

8 |
9 |
10 | {{- $emptyDatePages := slice}} 11 | {{- $currentYearSection := 0}} 12 | {{- range $idx,$page := $pages}} 13 | {{- if $page.Date}} 14 | {{- $thisYear := $page.Date.Format ("2006") }} 15 | {{- if eq $currentYearSection 0 }} 16 | {{- $currentYearSection = $thisYear}} 17 | {{- end }} 18 | {{- if or (eq $idx 0) (ne $currentYearSection $thisYear)}} 19 | {{- if ne $idx 0 }} 20 |
21 | {{- end}} 22 |
23 | 31 |
33 |
34 |
35 | {{- $currentYearSection = $thisYear}} 36 | {{- end}} 37 | {{- .Scratch.Set "type" "link"}} 38 | {{- partial "item-post.html" . }} 39 | {{- else}} 40 | {{- $emptyDatePages = $emptyDatePages | append $page}} 41 | {{- end }} 42 | {{- end}} 43 | {{- if $emptyDatePages}} 44 |
45 |
46 | 54 |
56 |
57 |
58 | {{- range $page := $emptyDatePages}} 59 | {{- .Scratch.Set "type" "link"}} 60 | {{- partial "item-post.html" . }} 61 | {{- end}} 62 | {{- end }} 63 |
64 | 65 |
66 |
67 | {{- end }} 68 | -------------------------------------------------------------------------------- /i18n/en.yaml: -------------------------------------------------------------------------------- 1 | 2 | nav_all: 3 | other: All 4 | nav_older: 5 | other: Older 6 | nav_newer: 7 | other: Newer 8 | 9 | 10 | page_home: 11 | other: Home 12 | page_archive: 13 | other: Archive 14 | page_archives: 15 | other: Archives 16 | page_category: 17 | other: Category 18 | page_categories: 19 | other: Categories 20 | page_tag: 21 | other: Tag 22 | page_tags: 23 | other: Tags 24 | page_tagcloud: 25 | other: Tag Cloud 26 | page_about: 27 | other: About 28 | 29 | pagination_next: 30 | other: Next 31 | pagination_prev: 32 | other: Prev 33 | pagination_page: 34 | other: Page %d 35 | pagination_pageof: 36 | other: Page %d of %s 37 | 38 | widget_search: 39 | other: Search 40 | widget_board: 41 | other: Board 42 | widget_archive: 43 | other: Archive 44 | widget_tags: 45 | other: Tags 46 | widget_categories: 47 | other: Categories 48 | widget_tagcloud: 49 | other: Tag Cloud 50 | widget_recent_posts: 51 | other: Recent Posts 52 | 53 | 54 | profile_follow: 55 | other: Follow 56 | profile_skill: 57 | other: Skills 58 | profile_label: 59 | other: Labels 60 | profile_work: 61 | other: Works 62 | profile_project: 63 | other: Projects 64 | profile_link: 65 | other: Links 66 | 67 | insight_hint: 68 | other: Type something... 69 | insight_posts: 70 | other: Posts 71 | insight_pages: 72 | other: Pages 73 | insight_categories: 74 | other: Categories 75 | insight_tags: 76 | other: Tags 77 | insight_untitled: 78 | other: (Untitled) 79 | 80 | 81 | unit_word: 82 | other: " words" 83 | unit_time: 84 | other: " minutes" 85 | 86 | article_wordcount: 87 | other: "Word Count: " 88 | article_readcount: 89 | other: "Read Time: " 90 | article_more: 91 | other: Read More 92 | article_comments: 93 | other: Comments 94 | article_share: 95 | other: Share 96 | article_catalogue: 97 | other: Catalogue 98 | 99 | total_article: 100 | one: Total {{ .Count }} article 101 | other: Total {{ .Count }} articles 102 | total_tag: 103 | other: Total {{ .Count }} tags 104 | total_category: 105 | one: Total {{ .Count }} category 106 | other: Total {{ .Count }} categories 107 | total_link: 108 | other: Total {{ .Count }} link 109 | other: Total {{ .Count }} links 110 | total_repository: 111 | other: Total {{ .Count }} projects 112 | 113 | 114 | donate_qrcode_alt: 115 | other: Scan Qrcode 116 | donate_qrcode_title: 117 | other: Scan 118 | donate_button: 119 | other: $ 120 | donate_title: 121 | other: Maybe you could buy me a cup of coffee. 122 | donate_tip: 123 | other: Scan this qrcode 124 | donate_alipay_action_tip: 125 | other: Open alipay app scan this qrcode, buy me a coffee! 126 | donate_wechatpay_action_tip: 127 | other: Open wechat app scan this qrcode, buy me a coffee! 128 | donate_alipay: 129 | other: alipay 130 | donate_wechatpay: 131 | other: wechat payment 132 | 133 | 134 | comment: 135 | other: Comment 136 | tweets: 137 | other: Tweets 138 | share: 139 | other: Share 140 | rss_feed: 141 | other: RSS Feed 142 | 143 | 144 | copyright_theme_by: 145 | other: Theme by 146 | copyright_base_on: 147 | other: base on 148 | copyright_powered_by: 149 | other: Powered by 150 | copyright_post: 151 | other: Permalink 152 | copyright_license: 153 | other: License 154 | 155 | insight_hint: 156 | other: Type something... 157 | insight_posts: 158 | other: Posts 159 | insight_pages: 160 | other: Pages 161 | insight_categories: 162 | other: Categories 163 | insight_tags: 164 | other: Tags 165 | insight_untitled: 166 | other: (Untitled) 167 | 168 | page_not_found_heading: 169 | other: 404 Not Found 170 | page_not_found_body: 171 | other: The page you are looking for might have been removed, had its name changed or is temporarily unavailable. 172 | page_not_found_back: 173 | other: Go Back 174 | -------------------------------------------------------------------------------- /layouts/partials/_script/pv.html: -------------------------------------------------------------------------------- 1 | {{- if .Site.Params.pv.busuanzi.enable }} 2 | 3 | {{- else if and (.Site.Params.pv.leancloud.enable) ( not .Site.Params.comment.valine.visitor ) }} 4 | 5 | 6 | 93 | {{- end }} -------------------------------------------------------------------------------- /layouts/partials/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | {{ with .Site.Params.baiduVerification }} 17 | {{ end }} 18 | {{ with .Site.Params.googleVerification }} 19 | {{ end }} 20 | {{- if .Keywords -}} 21 | {{ $length := len .Keywords | add -1 -}} 22 | 24 | {{- else if .Site.Params.keywords -}} 25 | {{ $length := len .Site.Params.keywords | add -1 -}} 26 | 28 | {{- end }} 29 | 30 | {{- if .Description -}} 31 | 32 | {{- else if .IsPage -}} 33 | 34 | {{- else if .Site.Params.description -}} 35 | 36 | {{- end -}} 37 | 38 | 39 | 40 | 41 | 42 | {{- block "title" . -}} 43 | {{ if .IsPage }}{{ .Title }} - {{ .Site.Title }}{{ else }}{{ .Site.Title }}{{ end }} 44 | {{- end -}} 45 | 46 | 47 | {{ range .AlternativeOutputFormats -}} 48 | {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} 49 | {{ end -}} 50 | {{ $css := resources.Get "css/style.css" | minify | fingerprint}} 51 | 52 | {{ with .Site.Params.customCSS }} 53 | {{ end }} 54 | 55 | {{- if eq .Site.Params.comment.type "gitalk"}} 56 | 57 | {{- end }} 58 | 59 | {{/* NOTE: These Hugo Internal Templates can be found starting at https://github.com/spf13/hugo/blob/master/tpl/tplimpl/template_embedded.go#L158 */}} 60 | {{- template "_internal/opengraph.html" . -}} 61 | {{- template "_internal/google_news.html" . -}} 62 | {{- template "_internal/schema.html" . -}} 63 | {{- template "_internal/twitter_cards.html" . -}} 64 | 65 | 66 | {{ `` | safeHTML }} 69 | 70 | {{ `` | safeHTML }} -------------------------------------------------------------------------------- /exampleSite/content/posts/markdown-syntax.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "Hugo Authors" 3 | title = "Markdown Syntax Guide" 4 | date = "2019-03-11" 5 | description = "Sample article showcasing basic Markdown syntax and formatting for HTML elements." 6 | tags = [ 7 | "markdown", 8 | "css", 9 | "html", 10 | "themes", 11 | ] 12 | categories = [ 13 | "themes", 14 | "syntax", 15 | ] 16 | series = ["Themes Guide"] 17 | aliases = ["migrate-from-jekyl"] 18 | +++ 19 | 20 | This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme. 21 | 22 | 23 | ## Headings 24 | 25 | The following HTML `

`—`

` elements represent six levels of section headings. `

` is the highest section level while `

` is the lowest. 26 | 27 | # H1 28 | ## H2 29 | ### H3 30 | #### H4 31 | ##### H5 32 | ###### H6 33 | 34 | ## Paragraph 35 | 36 | Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat. 37 | 38 | Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat. 39 | 40 | ## Blockquotes 41 | 42 | The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations. 43 | 44 | #### Blockquote without attribution 45 | 46 | > Tiam, ad mint andaepu dandae nostion secatur sequo quae. 47 | > **Note** that you can use *Markdown syntax* within a blockquote. 48 | 49 | #### Blockquote with attribution 50 | 51 | > Don't communicate by sharing memory, share memory by communicating.

52 | > — Rob Pike[^1] 53 | 54 | 55 | [^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. 56 | 57 | ## Tables 58 | 59 | Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box. 60 | 61 | Name | Age 62 | --------|------ 63 | Bob | 27 64 | Alice | 23 65 | 66 | #### Inline Markdown within tables 67 | 68 | | Inline    | Markdown    | In    | Table | 69 | | ---------- | --------- | ----------------- | ---------- | 70 | | *italics* | **bold** | ~~strikethrough~~    | `code` | 71 | 72 | ## Code Blocks 73 | 74 | #### Code block with backticks 75 | 76 | ``` 77 | html 78 | 79 | 80 | 81 | 82 | Example HTML5 Document 83 | 84 | 85 |

Test

86 | 87 | 88 | ``` 89 | #### Code block indented with four spaces 90 | 91 | 92 | 93 | 94 | 95 | Example HTML5 Document 96 | 97 | 98 |

Test

99 | 100 | 101 | 102 | #### Code block with Hugo's internal highlight shortcode 103 | {{< highlight html >}} 104 | 105 | 106 | 107 | 108 | Example HTML5 Document 109 | 110 | 111 |

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 | not-set-mmark 31 | set-mmark 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 | ![](https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/master/images/grey.png) 59 | 60 | ![](https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/master/images/black.png) 61 | 62 | ![](https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/master/images/blue.png) 63 | 64 | ![](https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/master/images/green.png) 65 | 66 | ![](https://raw.githubusercontent.com/xiaoheiAh/hugo-theme-pure/master/images/purple.png) 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 175 | app_key: # leancloud 176 | 177 | # wordcount 178 | postCount: 179 | enable: true 180 | wordcount: true # 文章字数统计 181 | min2read: true # read time 阅读时长预计 182 | 183 | # config 184 | config: 185 | skin: theme-black # theme color default is white. other type [theme-black,theme-blue,theme-green,theme-purple] 186 | layout: main-center # main-left main-center main-right 187 | excerpt_link: Read More 188 | toc: true 189 | 190 | # Sidebar 191 | sidebar: right 192 | 193 | # Search 194 | search: 195 | enable: true # enable search. thanks for https://raw.githubusercontent.com/ppoffice/hexo-theme-icarus/master/source/js/insight.js 196 | 197 | # Sidebar only the following widgets. you can remove any you don't like it. 198 | widgets: 199 | - board 200 | - tag_cloud 201 | - category 202 | - tag 203 | - recent_posts 204 | 205 | -------------------------------------------------------------------------------- /assets/js/insight.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Insight search plugin 3 | * @author PPOffice { @link https://github.com/ppoffice } 4 | */ 5 | (function ($, CONFIG) { 6 | var $main = $('.ins-search'); 7 | var $input = $main.find('.ins-search-input'); 8 | var $wrapper = $main.find('.ins-section-wrapper'); 9 | var $container = $main.find('.ins-section-container'); 10 | $main.parent().remove('.ins-search'); 11 | $('body').append($main); 12 | 13 | function section (title) { 14 | return $('
').addClass('ins-section') 15 | .append($('
').addClass('ins-section-header').text(title)); 16 | } 17 | 18 | function searchItem (icon, title, slug, preview, url) { 19 | return $('
').addClass('ins-selectable').addClass('ins-search-item') 20 | .append($('
').append($('').addClass('icon').addClass('icon-' + icon)).append(title != null && title != '' ? title : CONFIG.TRANSLATION['UNTITLED']) 21 | .append(slug ? $('').addClass('ins-slug').text(slug) : null)) 22 | .append(preview ? $('

').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 fields Object's fields to find matches 62 | */ 63 | function filter (keywords, obj, fields) { 64 | var result = false; 65 | var keywordArray = parseKeywords(keywords); 66 | var containKeywords = keywordArray.filter(function (keyword) { 67 | var containFields = fields.filter(function (field) { 68 | if (!obj.hasOwnProperty(field)) 69 | return false; 70 | if (obj[field].toUpperCase().indexOf(keyword) > -1) 71 | return true; 72 | }); 73 | if (containFields.length > 0) 74 | return true; 75 | return false; 76 | }); 77 | return containKeywords.length === keywordArray.length; 78 | } 79 | 80 | function filterFactory (keywords) { 81 | return { 82 | POST: function (obj) { 83 | return filter(keywords, obj, ['title', 'content']); 84 | }, 85 | PAGE: function (obj) { 86 | return filter(keywords, obj, ['title', 'content']); 87 | }, 88 | CATEGORY: function (obj) { 89 | return filter(keywords, obj, ['title']); 90 | }, 91 | TAG: function (obj) { 92 | return filter(keywords, obj, ['title']); 93 | } 94 | }; 95 | } 96 | 97 | /** 98 | * Calculate the weight of a matched post/page/category/tag. 99 | * @param Object obj Object to be weighted 100 | * @param Array fields Object's fields to find matches 101 | * @param Array weights Weight of every field 102 | */ 103 | function weight (keywords, obj, fields, weights) { 104 | var value = 0; 105 | parseKeywords(keywords).forEach(function (keyword) { 106 | var pattern = new RegExp(keyword, 'img'); // Global, Multi-line, Case-insensitive 107 | fields.forEach(function (field, index) { 108 | if (obj.hasOwnProperty(field)) { 109 | var matches = obj[field].match(pattern); 110 | value += matches ? matches.length * weights[index] : 0; 111 | } 112 | }); 113 | }); 114 | return value; 115 | } 116 | 117 | function weightFactory (keywords) { 118 | return { 119 | POST: function (obj) { 120 | return weight(keywords, obj, ['title', 'content'], [3, 1]); 121 | }, 122 | PAGE: function (obj) { 123 | return weight(keywords, obj, ['title', 'content'], [3, 1]); 124 | }, 125 | CATEGORY: function (obj) { 126 | return weight(keywords, obj, ['title'], [1]); 127 | }, 128 | TAG: function (obj) { 129 | return weight(keywords, obj, ['title'], [1]); 130 | } 131 | }; 132 | } 133 | 134 | function search (json, keywords) { 135 | var WEIGHTS = weightFactory(keywords); 136 | var FILTERS = filterFactory(keywords); 137 | var posts = json.posts; 138 | var tags = json.tags; 139 | var categories = json.categories; 140 | return { 141 | posts: posts.filter(FILTERS.POST).sort(function (a, b) { return WEIGHTS.POST(b) - WEIGHTS.POST(a); }).slice(0,5), 142 | categories: categories.filter(FILTERS.CATEGORY).sort(function (a, b) { return WEIGHTS.CATEGORY(b) - WEIGHTS.CATEGORY(a); }).slice(0,5), 143 | tags: tags.filter(FILTERS.TAG).sort(function (a, b) { return WEIGHTS.TAG(b) - WEIGHTS.TAG(a); }).slice(0,5) 144 | }; 145 | } 146 | 147 | function searchResultToDOM (searchResult) { 148 | $container.empty(); 149 | for (var key in searchResult) { 150 | $container.append(sectionFactory(key.toUpperCase(), searchResult[key])); 151 | } 152 | } 153 | 154 | function scrollTo ($item) { 155 | if ($item.length === 0) return; 156 | var wrapperHeight = $wrapper[0].clientHeight; 157 | var itemTop = $item.position().top - $wrapper.scrollTop(); 158 | var itemBottom = $item[0].clientHeight + $item.position().top; 159 | if (itemBottom > wrapperHeight + $wrapper.scrollTop()) { 160 | $wrapper.scrollTop(itemBottom - $wrapper[0].clientHeight); 161 | } 162 | if (itemTop < 0) { 163 | $wrapper.scrollTop($item.position().top); 164 | } 165 | } 166 | 167 | function selectItemByDiff (value) { 168 | var $items = $.makeArray($container.find('.ins-selectable')); 169 | var prevPosition = -1; 170 | $items.forEach(function (item, index) { 171 | if ($(item).hasClass('active')) { 172 | prevPosition = index; 173 | return; 174 | } 175 | }); 176 | var nextPosition = ($items.length + prevPosition + value) % $items.length; 177 | $($items[prevPosition]).removeClass('active'); 178 | $($items[nextPosition]).addClass('active'); 179 | scrollTo($($items[nextPosition])); 180 | } 181 | 182 | function gotoLink ($item) { 183 | if ($item && $item.length) { 184 | location.href = $item.attr('data-url'); 185 | } 186 | } 187 | 188 | $.getJSON(CONFIG.CONTENT_URL, function (json) { 189 | if (location.hash.trim() === '#ins-search') { 190 | $main.addClass('show'); 191 | } 192 | $input.on('input', function () { 193 | var keywords = $(this).val(); 194 | searchResultToDOM(search(json, keywords)); 195 | }); 196 | $input.trigger('input'); 197 | }); 198 | 199 | 200 | $(document).on('click focus', '.search-form-input', function () { 201 | $main.addClass('show'); 202 | $main.find('.ins-search-input').focus(); 203 | }).on('click', '.ins-search-item', function () { 204 | gotoLink($(this)); 205 | }).on('click', '.ins-close', function () { 206 | $main.removeClass('show'); 207 | }).on('keydown', function (e) { 208 | if (!$main.hasClass('show')) return; 209 | switch (e.keyCode) { 210 | case 27: // ESC 211 | $main.removeClass('show'); break; 212 | case 38: // UP 213 | selectItemByDiff(-1); break; 214 | case 40: // DOWN 215 | selectItemByDiff(1); break; 216 | case 13: //ENTER 217 | gotoLink($container.find('.ins-selectable.active').eq(0)); break; 218 | } 219 | }); 220 | })(jQuery, window.INSIGHT_CONFIG); --------------------------------------------------------------------------------