├── exampleSite ├── content │ ├── homepage │ │ ├── index.md │ │ ├── about.md │ │ └── work.md │ ├── _index.md │ ├── archives.md │ ├── post │ │ ├── _index.md │ │ ├── rich-content.md │ │ ├── emoji-support.md │ │ ├── math-typesetting.mmark │ │ ├── placeholder-text.md │ │ └── markdown-syntax.md │ └── about.md └── config.toml ├── layouts ├── shortcodes │ ├── spoiler.html │ └── bilibili.html ├── index.html ├── page │ └── single.html ├── partials │ ├── css.html │ ├── utteranc.html │ ├── home_profile.html │ ├── footer.html │ ├── wechat.html │ ├── gitalk.html │ ├── paginator.html │ ├── seo_schema.html │ ├── head.html │ ├── js.html │ ├── social.html │ ├── home_post.html │ └── header.html ├── _default │ ├── baseof.html │ ├── posts.html │ ├── list.html │ ├── terms.html │ └── single.html ├── 404.html ├── sitemap.xml ├── index.atom.xml ├── robots.txt └── rss.xml ├── images ├── nt.png ├── KaTeX.png ├── Screenshot.png └── PlantUML.svg ├── .gitignore ├── .github ├── linters │ └── .markdown-lint.yml └── workflows │ └── linter.yml ├── archetypes └── default.md ├── assets ├── css │ ├── main.scss │ ├── _common │ │ ├── _partials │ │ │ ├── navbar.scss │ │ │ ├── tags.scss │ │ │ ├── home.scss │ │ │ ├── home_post.scss │ │ │ ├── terms.scss │ │ │ ├── pagination.scss │ │ │ ├── footer.scss │ │ │ └── post.scss │ │ └── _core │ │ │ ├── layout.scss │ │ │ ├── base.scss │ │ │ ├── normalize.scss │ │ │ └── media.scss │ └── _variables │ │ └── default.scss └── js │ └── main.js ├── theme.toml ├── LICENSE └── README.md /exampleSite/content/homepage/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | headless : true 3 | --- 4 | -------------------------------------------------------------------------------- /layouts/shortcodes/spoiler.html: -------------------------------------------------------------------------------- 1 | {{.Inner}} -------------------------------------------------------------------------------- /exampleSite/content/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "Hugo Authors" 3 | +++ 4 | 5 | -------------------------------------------------------------------------------- /images/nt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogeko/mogege/HEAD/images/nt.png -------------------------------------------------------------------------------- /images/KaTeX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogeko/mogege/HEAD/images/KaTeX.png -------------------------------------------------------------------------------- /images/Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogeko/mogege/HEAD/images/Screenshot.png -------------------------------------------------------------------------------- /exampleSite/content/archives.md: -------------------------------------------------------------------------------- 1 | --- 2 | date: 2019-05-28 3 | type: section 4 | layout: "archives" 5 | --- -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.exe 2 | *.exe~ 3 | *.dll 4 | *.so 5 | *.dylib 6 | *.test 7 | 8 | exampleSite/public/* 9 | exampleSite/resources/_gen/* -------------------------------------------------------------------------------- /.github/linters/.markdown-lint.yml: -------------------------------------------------------------------------------- 1 | { 2 | "default": true, 3 | "MD001": false, 4 | "MD013": false, 5 | "MD026": false, 6 | "MD033": false 7 | } 8 | -------------------------------------------------------------------------------- /exampleSite/content/post/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | aliases = ["posts","articles","blog","showcase","docs"] 3 | title = "Posts" 4 | author = "Hugo Authors" 5 | tags = ["index"] 6 | +++ 7 | -------------------------------------------------------------------------------- /layouts/index.html: -------------------------------------------------------------------------------- 1 | {{ define "content" }} 2 | {{ if eq .Site.Params.home_mode "post" }} 3 | {{ partial "home_post.html" . }} 4 | {{ else }} 5 | {{ partial "home_profile.html" . }} 6 | {{ end }} 7 | {{ end }} 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/page/single.html: -------------------------------------------------------------------------------- 1 | {{ define "content" }} 2 |
3 |

{{ .Title }}

4 |
5 | {{ .Content }} 6 |
7 |
8 | {{end }} -------------------------------------------------------------------------------- /layouts/partials/css.html: -------------------------------------------------------------------------------- 1 | {{ $style := resources.Get "css/main.scss" | resources.ToCSS | resources.Minify}} 2 | 3 | 4 | {{ range .Site.Params.custom.css }} 5 | 6 | {{ end }} -------------------------------------------------------------------------------- /archetypes/default.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | date: {{ .Date }} 4 | draft: false 5 | tags: [] 6 | categories: [""] 7 | featured_image: 8 | description: 9 | --- 10 | 11 | 14 | --> -------------------------------------------------------------------------------- /layouts/partials/utteranc.html: -------------------------------------------------------------------------------- 1 |
2 | 9 |
-------------------------------------------------------------------------------- /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/_default/baseof.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ partial "head.html" . }} 4 | 5 |
6 | {{ partial "header.html" . }} 7 |
8 |
9 | {{ block "content" . }}{{ end }} 10 |
11 |
12 | {{ partial "footer.html" . }} 13 |
14 | 15 | 16 | -------------------------------------------------------------------------------- /layouts/partials/home_profile.html: -------------------------------------------------------------------------------- 1 |
2 | {{ with .Site.Params.avatar}} 3 | {{ $avatar := .}} 4 |
5 | 6 |
7 | {{ end }} 8 | {{ with .Site.Params.subtitle}} 9 |

10 | {{ . }} 11 |

12 | {{ end }} 13 | 16 |
17 | 18 | {{ if .IsHome }} 19 | {{ partial "wechat.html" . }} 20 | {{ end }} -------------------------------------------------------------------------------- /layouts/_default/posts.html: -------------------------------------------------------------------------------- 1 | {{ define "content" }} 2 |
3 | {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} 4 |

{{ .Key }}

5 | 6 | {{ range .Pages }} 7 |
8 | {{ .Title }} 9 | 10 | {{ .Date.Format "January 2, 2006" }} 11 | 12 |
13 | {{ end }} {{ end }} 14 | {{ partial "paginator.html" . }} 15 |
16 | {{end }} -------------------------------------------------------------------------------- /assets/css/main.scss: -------------------------------------------------------------------------------- 1 | @import "_variables/default.scss"; 2 | 3 | @import "_common/_core/base.scss"; 4 | @import "_common/_core/layout.scss"; 5 | 6 | @import "_common/_partials/home.scss"; 7 | @import "_common/_partials/terms.scss"; 8 | @import "_common/_partials/post.scss"; 9 | @import "_common/_partials/tags.scss"; 10 | @import "_common/_partials/home_post.scss"; 11 | @import "_common/_partials/navbar.scss"; 12 | @import "_common/_partials/footer.scss"; 13 | @import "_common/_partials/pagination.scss"; 14 | 15 | @import "_common/_core/media.scss"; 16 | @import "_common/_core/normalize.scss"; -------------------------------------------------------------------------------- /layouts/shortcodes/bilibili.html: -------------------------------------------------------------------------------- 1 | {{ $videoID := index .Params 0 }} 2 | {{ $pageNum := index .Params 1 | default 1}} 3 | 4 | {{ if (findRE "^[bB][vV][0-9a-zA-Z]+$" $videoID) }} 5 |
6 | {{ else }} 7 |
8 | {{ end }} 9 | -------------------------------------------------------------------------------- /assets/css/_common/_partials/navbar.scss: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | .header-logo a{ 5 | padding: 0 ; 6 | 7 | i{ 8 | line-height: 2em; 9 | } 10 | } 11 | 12 | 13 | .navbar .navbar-right a { 14 | 15 | padding: 0 8px; 16 | } 17 | 18 | .navbar .navbar-right .active{ 19 | font-weight: 900; 20 | color: $light-navbar-active-color; 21 | 22 | .dark-theme &{ 23 | color: $dark-navbar-active-color; 24 | } 25 | } 26 | 27 | .navbar-header a:hover, .navbar .navbar-right a:hover { 28 | background-color: transparent; 29 | } 30 | 31 | .navbar-header a:hover { 32 | color: #fe5186; 33 | } 34 | -------------------------------------------------------------------------------- /layouts/_default/list.html: -------------------------------------------------------------------------------- 1 | {{ define "content" }} 2 | {{ $data := .Data }} 3 |
4 |

- {{ $data.Plural | humanize }} · {{ .Title }} -

5 | {{ range (.Paginate .Pages).Pages }} 6 |
7 | {{ .Title }} 8 | 9 | {{ .Date.Format "January 2, 2006" }} 10 | 11 |
12 | {{ end }} 13 | {{ partial "paginator.html" . }} 14 |
15 | {{end }} -------------------------------------------------------------------------------- /.github/workflows/linter.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Lint Code Base 3 | 4 | on: 5 | push: 6 | branches-ignore: 7 | - 'master' 8 | pull_request: 9 | branches: 10 | - '*' 11 | 12 | 13 | jobs: 14 | build: 15 | name: Lint Code Base 16 | runs-on: ubuntu-latest 17 | 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v2 21 | 22 | - name: Lint Code Base 23 | uses: docker://github/super-linter:v2.2.0 24 | env: 25 | VALIDATE_YAML: true 26 | VALIDATE_JSON: true 27 | VALIDATE_JAVASCRIPT_ES: true 28 | VALIDATE_CSS: true 29 | VALIDATE_MD: true 30 | VALIDATE_ALL_CODEBASE: false 31 | ... -------------------------------------------------------------------------------- /layouts/404.html: -------------------------------------------------------------------------------- 1 | {{ define "content" }} 2 |
3 |

4 |

/* 404 page not found. */

5 | 6 |
7 | 16 | {{ end }} 17 | -------------------------------------------------------------------------------- /assets/css/_common/_partials/tags.scss: -------------------------------------------------------------------------------- 1 | .tag-cloud-tags { 2 | margin: 10px 0; 3 | 4 | a { 5 | display: inline-block; 6 | position: relative; 7 | margin: 5px 10px; 8 | word-wrap: break-word; 9 | transition-duration: .3s; 10 | transition-property: transform; 11 | transition-timing-function: ease-out; 12 | 13 | &:active, 14 | &:focus, 15 | &:hover { 16 | color: $light-global-link-hover-color; 17 | transform: scale(1.1); 18 | 19 | .dark-theme &{ 20 | color: $dark-global-link-hover-color; 21 | } 22 | } 23 | 24 | small { 25 | color: $light-font-secondary-color; 26 | 27 | .dark-theme &{ 28 | color: $dark-global-link-hover-color; 29 | } 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /theme.toml: -------------------------------------------------------------------------------- 1 | # theme.toml template for a Hugo theme 2 | # See https://github.com/gohugoio/hugoThemes#themetoml for an example 3 | 4 | name = "mogege" 5 | license = "MIT" 6 | licenselink = "https://github.com/Mogeko/mogege/blob/master/LICENSE" 7 | description = "A blog theme for hugo." 8 | homepage = "https://mogeko.me/mogege" 9 | tags = [ 10 | "blog", 11 | "dark", 12 | "theme" 13 | ] 14 | features = [ 15 | "cover-image", 16 | "favicon", 17 | "multilingual", 18 | "pagination", 19 | "syntax-highlighting", 20 | ] 21 | min_version = "0.41" 22 | 23 | [author] 24 | name = "Mogeko" 25 | homepage = "https://mogeko.me" 26 | 27 | # If porting an existing theme 28 | [original] 29 | name = "LeaveIt" 30 | homepage = "https://liuzhichao.com/" 31 | repo = "https://github.com/liuzc/LeaveIt" 32 | -------------------------------------------------------------------------------- /layouts/partials/footer.html: -------------------------------------------------------------------------------- 1 | 20 | {{ partial "js.html" . }} 21 | -------------------------------------------------------------------------------- /exampleSite/content/post/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_simple 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_simple 1085870671291310081 >}} 35 | 36 |
37 | 38 | --- 39 | 40 | ## Vimeo Simple Shortcode 41 | 42 | {{< vimeo_simple 48912912 >}} 43 | -------------------------------------------------------------------------------- /layouts/partials/wechat.html: -------------------------------------------------------------------------------- 1 | {{ with .Site.Params.Social.Wechat}} 2 | {{ $wechat := .}} 3 | 36 | 37 | 38 | 44 | 45 | {{ end }} -------------------------------------------------------------------------------- /layouts/partials/gitalk.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Mogeko 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/sitemap.xml: -------------------------------------------------------------------------------- 1 | 3 | {{ range (where .Data.Pages "Section" "!=" "gallery") }} 4 | 5 | {{ .Permalink }} 6 | {{ if not .Lastmod.IsZero }} 7 | {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }} 8 | {{ end }} 9 | {{ with .Sitemap.ChangeFreq }} 10 | {{ . }} 11 | {{ end }} 12 | {{ if ge .Sitemap.Priority 0.0 }} 13 | {{ .Sitemap.Priority }} 14 | {{ end }} 15 | {{ if .IsTranslated }} 16 | {{ range .Translations }} 17 | 22 | {{ end }} 23 | 28 | {{ end }} 29 | 30 | {{ end }} 31 | 32 | -------------------------------------------------------------------------------- /assets/css/_variables/default.scss: -------------------------------------------------------------------------------- 1 | /** light theme **/ 2 | 3 | $light-background-color: #fff; 4 | 5 | $light-font-color: #161209; 6 | $light-font-secondary-color: #a9a9b3; 7 | 8 | $light-code-notclass-background-color: #eaeaea; 9 | 10 | $light-navbar-active-color: #161209; 11 | $light-navbar-background-color: #fafafa; 12 | 13 | $light-global-link-color: #161209; 14 | $light-global-link-hover-color:#2d96bd; 15 | 16 | $light-post-link-color: #2d96bd; 17 | $light-post-link-hover-color:#ef3982; 18 | 19 | $light-pagination-link-color : #2d96bd; 20 | $light-pagination-link-active-color: #000; 21 | 22 | $light-border-color: #dcdcdc; 23 | 24 | 25 | 26 | /** dark theme **/ 27 | 28 | $dark-background-color: #292a2d; 29 | 30 | $dark-font-color: #a9a9b3; 31 | $dark-font-secondary-color: #87878d; 32 | 33 | $dark-code-notclass-background-color: #3b3d42; 34 | 35 | $dark-navbar-active-color: #fff; 36 | $dark-navbar-background-color: #252627; 37 | 38 | $dark-global-link-color: #a9a9b3; 39 | $dark-global-link-hover-color:#fff; 40 | 41 | $dark-post-link-color: #eee; 42 | $dark-post-link-hover-color:#fff; 43 | 44 | $dark-pagination-link-color : #a9a9b3; 45 | $dark-pagination-link-active-color: #fff; 46 | 47 | $dark-border-color: #4a4b50; 48 | 49 | $dark-blockquote-background-color: #252529; -------------------------------------------------------------------------------- /layouts/partials/paginator.html: -------------------------------------------------------------------------------- 1 | {{ $pag := $.Paginator }} 2 | {{ if gt $pag.TotalPages 1 }} 3 | 28 | {{ end }} -------------------------------------------------------------------------------- /layouts/index.atom.xml: -------------------------------------------------------------------------------- 1 | 2 | {{ if .IsHome }} 3 | {{ .Title }} 4 | {{ else }} 5 | {{ .Title }} - {{ .Site.Title }} 6 | {{ end }} 7 | 8 | {{ if not .Date.IsZero }} 9 | {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}{{ end }} 10 | {{ .Permalink }}{{ with .Site.Author.name }} 11 | 12 | {{.}}{{ with $.Site.Author.email }} 13 | {{.}}{{end}} 14 | {{end}} 15 | Hugo -- gohugo.io{{ range first 15 (where .Data.Pages "Type" "in" .Site.Params.mainSections) }} 16 | 17 | {{ `<![CDATA[` | safeHTML }}{{ .Title }}]]> 18 | 19 | {{ .Permalink }}{{ with .Site.Params.Author }} 20 | 21 | {{.}} 22 | {{end}} 23 | {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }} 24 | {{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }} 25 | {{ ` 26 | {{ end }} 27 | -------------------------------------------------------------------------------- /layouts/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | 3 | Disallow: /images/ 4 | Disallow: /js/ 5 | Disallow: /css/ 6 | 7 | User-agent: MJ12bot 8 | Disallow: / 9 | 10 | User-agent: AhrefsBot 11 | Disallow: / 12 | 13 | User-agent: BLEXBot 14 | Disallow: / 15 | 16 | # Block SISTRIX 17 | User-agent: SISTRIX Crawler 18 | Disallow: / 19 | User-agent: sistrix 20 | Disallow: / 21 | User-agent: 007ac9 22 | Disallow: / 23 | User-agent: 007ac9 Crawler 24 | Disallow: / 25 | 26 | # Block Uptime robot 27 | User-agent: UptimeRobot/2.0 28 | Disallow: / 29 | 30 | # Block Ezooms Robot 31 | User-agent: Ezooms Robot 32 | Disallow: / 33 | 34 | # Block Perl LWP 35 | User-agent: Perl LWP 36 | Disallow: / 37 | 38 | # Block netEstate NE Crawler (+http://www.website-datenbank.de/) 39 | User-agent: netEstate NE Crawler (+http://www.website-datenbank.de/) 40 | Disallow: / 41 | 42 | # Block WiseGuys Robot 43 | User-agent: WiseGuys Robot 44 | Disallow: / 45 | 46 | # Block Turnitin Robot 47 | User-agent: Turnitin Robot 48 | Disallow: / 49 | 50 | # Block Heritrix 51 | User-agent: Heritrix 52 | Disallow: / 53 | 54 | # Block pricepi 55 | User-agent: pimonster 56 | Disallow: / 57 | User-agent: Pimonster 58 | Disallow: / 59 | 60 | User-agent: SurdotlyBot 61 | Disallow: / 62 | 63 | User-agent: ZoominfoBot 64 | Disallow: / 65 | 66 | Sitemap: {{ "sitemap.xml" | absLangURL }} -------------------------------------------------------------------------------- /assets/css/_common/_partials/home.scss: -------------------------------------------------------------------------------- 1 | 2 | /** Home **/ 3 | 4 | .intro { 5 | transform: translateY(25vh); 6 | text-align: center; 7 | .avatar { 8 | padding: 10px; 9 | img { 10 | width: 128px; 11 | height: auto; 12 | display: inline-block; 13 | -webkit-border-radius: 100%; 14 | border-radius: 100%; 15 | -webkit-box-shadow: 0 0 0 0.3618em rgba(0, 0, 0, 0.05); 16 | box-shadow: 0 0 0 0.3618em rgba(0, 0, 0, 0.05); 17 | margin: 0 auto; 18 | -webkit-transition: all ease 0.4s; 19 | -moz-transition: all ease 0.4s; 20 | -o-transition: all ease 0.4s; 21 | transition: all ease 0.4s; 22 | cursor: pointer; 23 | &:hover { 24 | position: relative; 25 | -webkit-transform: translateY(-0.75em); 26 | -moz-transform: translateY(-0.75em); 27 | -ms-transform: translateY(-0.75em); 28 | -o-transform: translateY(-0.75em); 29 | transform: translateY(-0.75em); 30 | cursor: pointer; 31 | } 32 | } 33 | } 34 | } 35 | 36 | h2.description { 37 | font-size: 1em; 38 | font-weight: normal; 39 | padding: 5px; 40 | } 41 | 42 | .social-links { 43 | a { 44 | 45 | padding: 0 5px; 46 | &:hover { 47 | 48 | background-color: transparent; 49 | } 50 | } 51 | .iconfont { 52 | font-size: 2em; 53 | } 54 | } -------------------------------------------------------------------------------- /layouts/rss.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }} 4 | {{ .Permalink }} 5 | Recent content {{ with .Title }}in {{.}} {{ end }}on {{ .Site.Title }} 6 | Hugo -- gohugo.io{{ with .Site.LanguageCode }} 7 | {{.}}{{end}}{{ with .Site.Author.email }} 8 | {{.}}{{ with site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} 9 | {{.}}{{ with site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} 10 | {{.}}{{end}}{{ if not .Date.IsZero }} 11 | {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} 12 | 13 | {{ range first 15 (where .Data.Pages "Type" "!=" "home") }} 14 | 15 | {{ .Title }} 16 | {{ .Permalink }} 17 | {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} 18 | {{ with .Site.Author.email }}{{.}}{{ with site.Author.name }} ({{.}}){{end}}{{end}} 19 | {{ .Permalink }} 20 | {{ .Content | html }} 21 | 22 | {{ end }} 23 | 24 | -------------------------------------------------------------------------------- /assets/css/_common/_partials/home_post.scss: -------------------------------------------------------------------------------- 1 | .post-warp { 2 | .intro { 3 | transform: translateY(0); 4 | margin: 2em 0 5em 0; 5 | 6 | .avatar { 7 | img { 8 | width: 96px; 9 | } 10 | } 11 | } 12 | 13 | .post { 14 | margin-bottom: 4em; 15 | border-bottom: 1px dashed #ddd; 16 | 17 | .post-content { 18 | padding-top: .5em; 19 | } 20 | 21 | .post-footer { 22 | display: flex; 23 | justify-content: space-between; 24 | align-items: center; 25 | 26 | .post-meta { 27 | a { 28 | color: rgba(85, 85, 85, 0.52941) !important; 29 | .dark-theme & { 30 | color: $dark-font-secondary-color !important; 31 | } 32 | 33 | &:hover { 34 | color: $light-font-secondary-color !important; 35 | .dark-theme & { 36 | color: $dark-font-secondary-color !important; 37 | } 38 | } 39 | } 40 | } 41 | .post-tags { 42 | span { 43 | a { 44 | color: rgba(85, 85, 85, 0.52941) !important; 45 | .dark-theme & { 46 | color: $dark-font-secondary-color !important; 47 | } 48 | 49 | &:hover { 50 | color: $light-font-secondary-color !important; 51 | .dark-theme & { 52 | color: $dark-font-secondary-color !important; 53 | } 54 | } 55 | } 56 | } 57 | } 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /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/yuin/goldmark 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/_default/terms.html: -------------------------------------------------------------------------------- 1 | {{ define "content" }} 2 | 3 | {{ $termName := .Data.Plural }} 4 | {{ $terms := .Data.Terms.ByCount }} 5 | {{ $length := len $terms }} 6 | {{ $type := .Type }} 7 | 8 |
9 |

- {{ .Data.Plural | humanize }} -

10 | {{ if and $.Site.Taxonomies.categories (eq $termName "categories") }} 11 |
12 | {{ range $terms }} 13 | {{ $term := .Term }} 14 | {{ $pages := .Pages }} 15 | {{ with $.Site.GetPage "taxonomy" (printf "%s/%s" $type $term) }} 16 |
17 |
18 |

{{ $term | humanize}}

19 | {{ range first 5 $pages }} 20 | 23 | {{ end }} 24 | {{ if gt (len $pages) 5 }} 25 | 26 | More >> 27 | 28 | {{ end }} 29 |
30 |
31 | {{ end }} 32 | {{ end }} 33 |
34 | 35 | 36 | 37 | {{ else if and $.Site.Taxonomies.tags (eq $termName "tags") }} 38 |
39 | {{ range $.Site.Taxonomies.tags.ByCount }} 40 | {{ if .Name }} 41 | {{ .Name }} ({{ .Count }}) 42 | {{ end }} 43 | {{end}} 44 |
45 | {{ end }} 46 | 47 | 48 |
49 | {{end }} -------------------------------------------------------------------------------- /exampleSite/content/post/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 >}} -------------------------------------------------------------------------------- /assets/css/_common/_partials/terms.scss: -------------------------------------------------------------------------------- 1 | .post-warp { 2 | 3 | .archive-item { 4 | margin-left: 2rem; 5 | } 6 | 7 | .categories-card { 8 | margin: 0 auto; 9 | margin-top: 3em; 10 | display: flex; 11 | align-items: center; 12 | justify-content: space-between; 13 | flex-direction: row; 14 | flex-wrap: wrap; 15 | padding: 0 2.5em; 16 | line-height: 1.6em; 17 | 18 | .card-item { 19 | font-size: 14px; 20 | text-align: left; 21 | width: 45%; 22 | display: flex; 23 | align-items: flex-start; 24 | margin-top:2em; 25 | min-height: 16em; 26 | padding: 0 2%; 27 | position: relative; 28 | 29 | .categories{ 30 | overflow: hidden; 31 | } 32 | } 33 | } 34 | 35 | .archive-item-link { 36 | display: inline-block; 37 | text-decoration: none; 38 | overflow: hidden; 39 | text-overflow: ellipsis; 40 | white-space: nowrap; 41 | max-width: 95%; 42 | &:hover { 43 | color: $light-global-link-hover-color; 44 | background-color: transparent; 45 | } 46 | 47 | .dark-theme & { 48 | color: $dark-global-link-color; 49 | text-decoration: none; 50 | transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease; 51 | 52 | &:hover { 53 | color: $dark-global-link-hover-color; 54 | text-decoration: none; 55 | transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease; 56 | } 57 | } 58 | } 59 | .archive-item-date { 60 | float: right; 61 | text-align: right; 62 | color: $light-font-secondary-color; 63 | 64 | .dark-theme & { 65 | color: $dark-font-secondary-color; 66 | } 67 | } 68 | 69 | .more-post { 70 | text-align: right; 71 | } 72 | } 73 | 74 | .categories { 75 | h3 { 76 | display: inline-block; 77 | } 78 | span { 79 | float: right; 80 | padding-right: 1em; 81 | } 82 | } -------------------------------------------------------------------------------- /layouts/partials/seo_schema.html: -------------------------------------------------------------------------------- 1 | 2 | {{ if .IsHome }} 3 | 16 | {{ end }} 17 | {{ if .IsPage }} 18 | 44 | {{ end }} -------------------------------------------------------------------------------- /assets/css/_common/_partials/pagination.scss: -------------------------------------------------------------------------------- 1 | /** pagination **/ 2 | 3 | .pagination { 4 | display: flex; 5 | flex-direction: row; 6 | justify-content: center; 7 | list-style: none; 8 | white-space: nowrap; 9 | width: 100%; 10 | padding-top: 2em; 11 | a { 12 | -webkit-font-smoothing: antialiased; 13 | font-size: 12px; 14 | color: #bfbfbf; 15 | letter-spacing: 0.1em; 16 | font-weight: 700; 17 | padding: 5px 5px; 18 | text-decoration: none; 19 | transition: 0.3s; 20 | } 21 | li { 22 | padding-bottom: 3px; 23 | margin: 0 20px; 24 | box-sizing: border-box; 25 | position: relative; 26 | display: inline; 27 | &.disabled { 28 | display: none; 29 | } 30 | &:hover a { 31 | color: $light-pagination-link-active-color; 32 | } 33 | 34 | .dark-theme &:hover a { 35 | color: $dark-pagination-link-active-color; 36 | } 37 | 38 | &:before, 39 | &:after { 40 | position: absolute; 41 | content: ""; 42 | width: 0; 43 | height: 3px; 44 | background: $light-pagination-link-active-color; 45 | transition: 0.3s; 46 | bottom: 0px; 47 | } 48 | .dark-theme &:before, 49 | .dark-theme &:after{ 50 | background: $dark-pagination-link-active-color; 51 | } 52 | 53 | &:before .active, 54 | &:after .active { 55 | width: 100%; 56 | } 57 | &:before { 58 | left: 50%; 59 | } 60 | &:after { 61 | right: 50%; 62 | } 63 | &:hover { 64 | &:before, 65 | &:after { 66 | width: 50%; 67 | } 68 | } 69 | &.active { 70 | a { 71 | color: $light-pagination-link-active-color; 72 | } 73 | 74 | .dark-theme & a { 75 | color: $dark-pagination-link-active-color; 76 | } 77 | &:before, 78 | &:after { 79 | width: 60%; 80 | } 81 | } 82 | } 83 | } -------------------------------------------------------------------------------- /exampleSite/content/post/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/partials/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{ with .Site.Params.author }}{{ end }} 7 | {{ with .Site.Params.description }}{{ end }} 8 | {{ with .Site.Params.keywords }}{{ end }} 9 | {{ with .Site.Params.google_verification }}{{ end }} 10 | {{ if .PrevInSection }}{{end}} 11 | {{ if .NextInSection}}{{end}} 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | {{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }} 22 | {{ if .IsHome }} 23 | {{ .Site.Title }} 24 | {{ else if .Params.heading }} 25 | {{ .Params.heading }} 26 | {{ else }} 27 | {{ .Title }} | {{ .Site.Title }} 28 | {{ end }} 29 | 30 | 31 | {{ partial "css.html" . }} 32 | {{ with .OutputFormats.Get "RSS" }} 33 | 34 | 35 | {{ end }} 36 | {{ partial "seo_schema.html" . }} 37 | -------------------------------------------------------------------------------- /layouts/partials/js.html: -------------------------------------------------------------------------------- 1 | {{ $highlight := resources.Get "/js/highlight.pack.js" }} 2 | {{ $main := resources.Get "/js/main.js" }} 3 | 4 | 5 | {{ $main := slice $highlight $main | resources.Concat "/js/vendor_main.js" | resources.Minify}} 6 | 7 | 8 | 9 | {{ if or .Page.Params.math .Site.Params.math }} 10 | 11 | 12 | 13 | 14 | {{ end }} 15 | 16 | {{ if or .Page.Params.plantuml .Site.Params.plantuml }} 17 | 18 | 19 | 31 | {{ end }} 32 | 33 | {{ if and (.Page.Params.restyleTextSpacing | default true) (.Site.Params.restyleTextSpacing | default true) }} 34 | 35 | 36 | 37 | {{ end }} 38 | 39 | {{ range .Site.Params.custom.js }} 40 | > 41 | 42 | {{ end }} 43 | -------------------------------------------------------------------------------- /layouts/partials/social.html: -------------------------------------------------------------------------------- 1 | {{ if .Site.Params.Social }} 2 | 13 | {{ end }} 14 | 15 | {{ with .Site.Params.Social.Github }} 16 | 17 | {{ end }} 18 | {{ with .Site.Params.Social.LinkedIn }} 19 | 20 | {{ end }} 21 | {{ with .Site.Params.Social.Twitter }} 22 | 23 | {{ end }} 24 | {{ with .Site.Params.Social.Instagram }} 25 | 26 | {{ end }} 27 | {{ with .Site.Params.Social.Email}} 28 | 29 | {{ end }} 30 | {{ with .Site.Params.Social.Facebook}} 31 | 32 | {{ end }} 33 | {{ with .Site.Params.Social.Telegram}} 34 | 35 | {{ end }} 36 | {{ with .Site.Params.Social.Dribbble}} 37 | 38 | {{ end }} 39 | {{ with .Site.Params.Social.Medium}} 40 | 41 | {{ end }} 42 | {{ with .Site.Params.Social.Wechat}} 43 | 44 | {{end}} -------------------------------------------------------------------------------- /exampleSite/config.toml: -------------------------------------------------------------------------------- 1 | baseURL = "https://example.com" 2 | title = "Mogeko`s Blog" # 浏览器的标题 3 | languageCode = "zh-cn" # 语言 4 | hasCJKLanguage = true # 开启可以让「字数统计」统计汉字 5 | theme = "mogege" # 主题 (需要自己下载) 6 | 7 | paginate = 11 # 每页的文章数 8 | enableEmoji = true # 支持 Emoji 9 | enableRobotsTXT = true # 支持 robots.txt 10 | 11 | 12 | preserveTaxonomyNames = true 13 | 14 | [blackfriday] 15 | hrefTargetBlank = true 16 | nofollowLinks = true 17 | noreferrerLinks = true 18 | 19 | [Permalinks] 20 | posts = "/:year/:filename/" 21 | 22 | [menu] 23 | [[menu.main]] 24 | name = "Blog" 25 | url = "/post/" 26 | weight = 1 27 | 28 | [[menu.main]] 29 | name = "Categories" 30 | url = "/categories/" 31 | weight = 2 32 | 33 | [[menu.main]] 34 | name = "Tags" 35 | url = "/tags/" 36 | weight = 3 37 | 38 | [[menu.main]] 39 | name = "About" 40 | url = "/about/" 41 | weight = 4 42 | 43 | [params] 44 | since = 2017 45 | author = "Mogeko" # Author's name 46 | avatar = "https://mogeko.me/blog-images/r/me/avatar.jpg" # Author's avatar 47 | subtitle = "Just for Fun" # Subtitle 48 | home_mode = "" # post or other 49 | enableGitalk = true # gitalk 评论系统 50 | 51 | google_verification = "" 52 | 53 | description = "Mogeko 的个人博客" # (Meta) 描述 54 | keywords = "" # site keywords 55 | 56 | beian = "" 57 | baiduAnalytics = "" 58 | googleAnalytics = "UA-104502658-2" # Google 统计 id 59 | 60 | license= '本文采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可' 61 | 62 | [params.gitalk] # Github: https://github.com/gitalk/gitalk 63 | clientID = "" # Your client ID 64 | clientSecret = "" # Your client secret 65 | repo = "" # The repo to store comments 66 | owner = "" # Your GitHub ID 67 | admin= "" # Required. Github repository owner and collaborators. (Users who having write access to this repository) 68 | id= "location.pathname" # The unique id of the page. 69 | labels= "gitalk" # Github issue labels. If you used to use Gitment, you can change it 70 | perPage= 15 # Pagination size, with maximum 100. 71 | pagerDirection= "last" # Comment sorting direction, available values are 'last' and 'first'. 72 | createIssueManually= true # If it is 'false', it is auto to make a Github issue when the administrators login. 73 | distractionFreeMode= false # Enable hot key (cmd|ctrl + enter) submit comment. 74 | -------------------------------------------------------------------------------- /layouts/partials/home_post.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | {{ with .Site.Params.avatar}} 5 | {{ $avatar := .}} 6 |
7 | 8 |
9 | {{ end }} 10 | {{ with .Site.Params.subtitle}} 11 |

12 | {{ . }} 13 |

14 | {{ end }} 15 | 16 |
17 | {{ range (.Paginate .Pages).Pages }} 18 |
19 | 20 |
21 |

{{ .Title }}

22 |
23 |
24 | 25 | {{ with .Params.featured_image }} 26 | {{- $img := . -}} 27 |

28 | {{ end }} 29 | 30 | 31 | {{ .Summary }} 32 |
33 | 61 |
62 | {{ end }} 63 | 64 | {{ partial "paginator.html" . }} 65 |
66 | -------------------------------------------------------------------------------- /assets/css/_common/_core/layout.scss: -------------------------------------------------------------------------------- 1 | /** Layout **/ 2 | 3 | .wrapper { 4 | display: flex; 5 | flex-direction: column; 6 | min-height: 100vh; 7 | width: 100%; 8 | } 9 | 10 | .navbar { 11 | height: 4rem; 12 | line-height: 4rem; 13 | width: 100%; 14 | background-color: $light-navbar-background-color; 15 | .dark-theme & { 16 | background-color: $dark-navbar-background-color; 17 | } 18 | // 顶部阅读进度条 19 | .content_progress { 20 | position: fixed; 21 | top: 0; 22 | left: 0; 23 | z-index: 9999; 24 | width: 100%; 25 | height: 3px; 26 | -webkit-appearance: none; 27 | -moz-appearance: none; 28 | appearance: none; 29 | border: none; 30 | background-color: transparent; 31 | color: #ef3982; 32 | } 33 | .content_progress::-webkit-progress-bar { 34 | background-color: transparent; 35 | } 36 | .content_progress::-webkit-progress-value { 37 | background-color: #ef3982; 38 | } 39 | .content_progress::-moz-progress-bar { 40 | background-color: #ef3982; 41 | } 42 | .container { 43 | width: auto; 44 | max-width: 1000px; 45 | text-align: center; 46 | margin: 0 auto; 47 | display: flex; 48 | justify-content: space-between; 49 | font-size: 1.125em; 50 | 51 | .divide { 52 | border-left: 2px solid; 53 | } 54 | 55 | .header-logo { 56 | font-weight: bold; 57 | font-size: 1.3em; 58 | font-family: 'Lobster', cursive; 59 | } 60 | 61 | .header-back2home-logo { 62 | font-weight: bold; 63 | font-family: 'Fira Code', Consolas, Monaco, Menlo, Consolas, monospace; 64 | 65 | .logo_mark { 66 | color: #23d18b; 67 | } 68 | 69 | .logo_cursor { 70 | display: inline-block; 71 | width: 10px; 72 | height: 0.3rem; 73 | background: #fe5186; 74 | margin-left: -8px; 75 | animation: cursor 1s infinite; 76 | } 77 | @media (prefers-reduced-motion: reduce) { 78 | .logo_cursor { 79 | animation: none; 80 | } 81 | } 82 | } 83 | } 84 | } 85 | 86 | .main { 87 | flex: 1 0 auto; 88 | } 89 | .container{ 90 | padding-left: 1em; 91 | padding-right: 1em; 92 | } 93 | 94 | .footer { 95 | height: 4rem; 96 | width: 100%; 97 | text-align: center; 98 | line-height: 4rem; 99 | padding-top: 2em; 100 | } 101 | 102 | 103 | .notfound { 104 | font-size: 2em; 105 | transform: translateY(35vh); 106 | text-align: center; 107 | } 108 | 109 | @keyframes cursor { 110 | 0% { opacity: 0; } 111 | 50% { opacity: 1; } 112 | 100% { opacity: 0; } 113 | } -------------------------------------------------------------------------------- /layouts/partials/header.html: -------------------------------------------------------------------------------- 1 | 31 | -------------------------------------------------------------------------------- /exampleSite/content/post/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 | -------------------------------------------------------------------------------- /assets/css/_common/_core/base.scss: -------------------------------------------------------------------------------- 1 | /** highlight.js**/ 2 | @import url('https://cdn.jsdelivr.net/npm/highlight.js@10.0.3/styles/github-gist.min.css'); 3 | 4 | /** Font **/ 5 | /* iconfont */ 6 | @import url('https://at.alicdn.com/t/font_1230224_omviwgy4rx.css'); 7 | /* josefin-sans-regular && Lobster && pt-sans-regular */ 8 | @import url('https://fonts.googleapis.com/css2?family=Josefin+Sans&family=Lobster&family=PT+Sans&display=swap'); 9 | /* FiraCode */ 10 | @import url('https://cdn.jsdelivr.net/npm/firacode@3.1.0/distr/fira_code.min.css'); 11 | 12 | html { 13 | &::-webkit-scrollbar { 14 | width: 8px; 15 | height: 8px; 16 | } 17 | &::-webkit-scrollbar-thumb { 18 | height: 40px; 19 | background-color: #eee; 20 | border-radius: 16px; 21 | &:hover { 22 | background-color: #ddd; 23 | } 24 | } 25 | } 26 | 27 | ::selection { 28 | background: rgba(0, 149, 255, 0.1); 29 | } 30 | 31 | html { 32 | font-family: "Josefin Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", STHeiti, "Microsoft Yahei", "WenQuanYi Micro Hei", Arial, Verdana, sans-serif; 33 | } 34 | 35 | body { 36 | font-size: 11pt; 37 | font-weight: 400; 38 | line-height: 2em; 39 | background-color: $light-background-color; 40 | color: $light-font-color; 41 | &:before { 42 | content: ""; 43 | background-repeat: no-repeat; 44 | background-position: center; 45 | opacity: 0.05; 46 | position: fixed; 47 | top: 0; 48 | left: 0; 49 | width: 100%; 50 | height: 100%; 51 | z-index: -1; 52 | -webkit-filter: grayscale(100%); 53 | -moz-filter: grayscale(100%); 54 | -ms-filter: grayscale(100%); 55 | -o-filter: grayscale(100%); 56 | filter: grayscale(100%); 57 | filter: gray; 58 | } 59 | 60 | &.dark-theme { 61 | background-color: $dark-background-color; 62 | color: $dark-font-color; 63 | } 64 | } 65 | 66 | a { 67 | color: $light-global-link-color; 68 | text-decoration: none; 69 | transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease; 70 | &:hover { 71 | color: $light-global-link-hover-color; 72 | text-decoration: none; 73 | transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease; 74 | } 75 | 76 | .dark-theme & { 77 | color: $dark-global-link-color; 78 | text-decoration: none; 79 | transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease; 80 | 81 | &:hover{ 82 | color: $dark-global-link-hover-color; 83 | text-decoration: none; 84 | transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease; 85 | } 86 | } 87 | } 88 | 89 | blockquote { 90 | font: 14px/22px normal helvetica, sans-serif; 91 | margin-top: 10px; 92 | margin-bottom: 10px; 93 | margin-left: 2%; 94 | margin-right: 0%; 95 | padding-left: 15px; 96 | padding-top: 10px; 97 | padding-right: 10px; 98 | padding-bottom: 10px; 99 | border-left: 3px solid #ccc; 100 | background-color:#f1f1f1; 101 | 102 | .dark-theme & { 103 | background-color:$dark-blockquote-background-color; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /assets/js/main.js: -------------------------------------------------------------------------------- 1 | 2 | var _Blog = _Blog || {} 3 | 4 | // Dark Mode 5 | _Blog.switchDarkMode = function () { 6 | const currentTheme = document.cookie.replace(/(?:(?:^|.*;\s*)dark\s*=\s*([^;]*).*$)|^.*$/, '$1') || '0' 7 | const isDark = currentTheme === '1' 8 | document.body.classList.toggle('dark-theme', isDark) 9 | // 手动切换 Dark Mode 10 | const themeSwitcher = document.querySelectorAll('.theme-switch') 11 | themeSwitcher.forEach(function (themeSwitcherItem) { 12 | themeSwitcherItem.addEventListener('click', () => { 13 | const currentTheme = document.cookie.replace(/(?:(?:^|.*;\s*)dark\s*=\s*([^;]*).*$)|^.*$/, '$1') || '0' 14 | if (currentTheme === '0') { 15 | document.body.classList.add('dark-theme') 16 | document.cookie = 'dark=1;path=/' 17 | console.log('Dark mode on') 18 | } else { 19 | document.body.classList.remove('dark-theme') 20 | document.cookie = 'dark=0;path=/' 21 | console.log('Dark mode off') 22 | } 23 | }) 24 | }) 25 | } 26 | 27 | // 开关移动端菜单 28 | _Blog.switchMobileMenu = function () { 29 | const menuSwitcher = document.querySelectorAll('.menu-toggle') 30 | const MobileMenu = document.querySelector('#mobile-menu') 31 | menuSwitcher.forEach(function (menuSwitcherItem) { 32 | menuSwitcherItem.addEventListener('click', () => { 33 | menuSwitcherItem.classList.toggle('active') 34 | MobileMenu.classList.toggle('active') 35 | }) 36 | }) 37 | } 38 | 39 | // 顶部阅读进度条 40 | _Blog.scrollIndicator = function () { 41 | const winHeight = window.innerHeight 42 | const docHeight = document.documentElement.scrollHeight 43 | const progressBar = document.querySelectorAll('.content_progress') 44 | progressBar.forEach(function (progressBarItem) { 45 | progressBarItem.max = docHeight - winHeight 46 | progressBarItem.value = window.scrollY 47 | }) 48 | 49 | document.addEventListener('scroll', function () { 50 | progressBar.forEach(function (progressBarItem) { 51 | progressBarItem.max = docHeight - winHeight 52 | progressBarItem.value = window.scrollY 53 | }) 54 | }) 55 | } 56 | 57 | // 在用户切换网页时改变浏览器标题 58 | _Blog.changeTile = function () { 59 | const currentTile = document.title 60 | window.onblur = function () { 61 | this.document.title = '别走啊,官人 _(:з」∠)_' 62 | } 63 | window.onfocus = function () { 64 | this.document.title = currentTile 65 | } 66 | } 67 | 68 | // 为代码块添加 Copy 按钮 69 | _Blog.addCopyBottons = function () { 70 | // Check if the browser supports navigator.clipboard 71 | if (navigator && navigator.clipboard) { 72 | copyButtons(navigator.clipboard) 73 | } else { 74 | var script = document.createElement('script') 75 | script.src = 'https://cdnjs.cloudflare.com/ajax/libs/clipboard-polyfill/2.7.0/clipboard-polyfill.promise.js' 76 | script.integrity = 'sha256-waClS2re9NUbXRsryKoof+F9qc1gjjIhc2eT7ZbIv94=' 77 | script.crossOrigin = 'anonymous' 78 | script.onload = function () { 79 | copyButtons(clipboard) 80 | } 81 | 82 | document.body.appendChild(script) 83 | } 84 | 85 | function copyButtons (clipboard) { 86 | document.querySelectorAll('pre > code').forEach(function (codeBlock) { 87 | var button = document.createElement('button') 88 | button.className = 'copy-code-button' 89 | button.type = 'button' 90 | button.innerText = 'Copy' 91 | 92 | button.addEventListener('click', function () { 93 | clipboard.writeText(codeBlock.innerText).then(function () { 94 | /* Chrome doesn't seem to blur automatically, 95 | leaving the button in a focused state. */ 96 | button.blur() 97 | 98 | button.innerText = 'Copied!' 99 | 100 | setTimeout(function () { 101 | button.innerText = 'Copy' 102 | }, 2000) 103 | }, function (error) { 104 | button.innerText = 'Error' 105 | }) 106 | }) 107 | 108 | var pre = codeBlock.parentNode 109 | if (pre.parentNode.classList.contains('highlight')) { 110 | var highlight = pre.parentNode 111 | highlight.appendChild(button) 112 | } 113 | }) 114 | } 115 | } 116 | 117 | document.addEventListener('DOMContentLoaded', function () { 118 | _Blog.addCopyBottons() 119 | _Blog.switchDarkMode() 120 | _Blog.switchMobileMenu() 121 | _Blog.scrollIndicator() 122 | _Blog.changeTile() 123 | }) 124 | -------------------------------------------------------------------------------- /exampleSite/content/post/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 | -------------------------------------------------------------------------------- /assets/css/_common/_partials/footer.scss: -------------------------------------------------------------------------------- 1 | /**Footer**/ 2 | 3 | .copyright { 4 | font-size: 14px; 5 | } 6 | 7 | #dynamic-to-top { 8 | display: none; 9 | overflow: hidden; 10 | width: auto; 11 | z-index: 90; 12 | position: fixed; 13 | bottom: 2em; 14 | right: 2em; 15 | top: auto; 16 | left: auto; 17 | font-family: sans-serif; 18 | font-size: 1em; 19 | color: #fff; 20 | text-decoration: none; 21 | text-shadow: 0 1px 0 #333; 22 | font-weight: bold; 23 | padding: 17px 16px; 24 | border: 1px solid $light-border-color; 25 | background: #222; 26 | &:hover { 27 | background: #000; 28 | cursor: pointer; 29 | } 30 | &:active { 31 | background: #000; 32 | outline: none; 33 | } 34 | outline: none; 35 | &:focus, &:hover { 36 | outline: none; 37 | } 38 | span { 39 | display: block; 40 | overflow: hidden; 41 | width: 14px; 42 | height: 12px; 43 | background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAKCAYAAACE2W/HAAAACXBIWXMAAArwAAAK8AFCrDSYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAKVJREFUeNqUz7ENgzAURdErUSXQMgdTZJFIqeg8DFI2YQeEvAEbUJja3y9NEiwCUXIlN/62jww7Saok3Z+r4pckXSRNWpskXb5deClHfeo7ylGrLqnbTmOMs/e+9d63McZ554GOlFLId0IIvXOuAUqgdM41IYQ+P5NSCpjZkitADRTZTwqgznUzWzCzZaMc9dbNbGEYhuuOclQB1OM43gBO/N/5MQAeMwpyB1MtLQAAAABJRU5ErkJggg==') no-repeat center center; 44 | } 45 | 46 | .dark-theme &{ 47 | border: 1px solid $dark-border-color; 48 | } 49 | } -------------------------------------------------------------------------------- /layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{ define "content" }} 2 |
3 |
4 |

{{ .Title }}

5 | 24 |
25 | 26 |
27 | 28 | 29 | {{ $images := findRE " 37 | {{ end }} 38 | 39 | {{ $reImgIn := "\"([^\"]+)\"" }} 40 | {{ $reImgOut := "\"$2\"" }} 41 | {{ $tmpContent := .Content | replaceRE $reImgIn $reImgOut | safeHTML }} 42 | 43 | {{ $reImgTitleIn := "\"([^\"]+)\"" }} 44 | {{ $reImgTitleOut := "
\"$2\"
$3
" }} 45 | {{ $finalContent := $tmpContent | replaceRE $reImgTitleIn $reImgTitleOut | safeHTML }} 46 | 47 | {{ $finalContent }} 48 |
49 | 50 |
51 | {{ with .Site.Params.author }} 52 | 56 | {{ end }} 57 | 58 | {{ with .Permalink }} 59 | 63 | {{ end }} 64 | {{ with .Site.Params.license }} 65 | 68 | {{ end }} 69 |
70 | 71 | 72 | 87 | 88 |
89 | {{ if .PrevInSection }} 90 | 91 | {{ end }} 92 | {{ if .NextInSection }} 93 | 94 | {{ end }} 95 |
96 | 97 |
98 | {{ if ( $.Params.showComments | default true ) }} 99 | {{ if ne .Site.DisqusShortname "" }} 100 | {{ template "_internal/disqus.html" . }} 101 | {{ else if .Site.Params.enableGitalk }} 102 | {{ partial "gitalk.html" . }} 103 | {{ else if .Site.Params.enableUtteranc }} 104 | {{ partial "utteranc.html" . }} 105 | {{ end }} 106 | {{ end }} 107 |
108 |
109 | {{- end }} 110 | -------------------------------------------------------------------------------- /images/PlantUML.svg: -------------------------------------------------------------------------------- 1 | BobBobAliceAliceOtherStringhellonewOtherStringYou can also put notes!ok 25 | -------------------------------------------------------------------------------- /assets/css/_common/_partials/post.scss: -------------------------------------------------------------------------------- 1 | /** Post **/ 2 | 3 | .post-warp { 4 | position: relative; 5 | width: 100%; 6 | max-width: 780px; 7 | margin: 0 auto; 8 | padding-top: 2rem; 9 | 10 | .post-header h1 { 11 | margin: 0 !important; 12 | } 13 | 14 | .post-title { 15 | font-size: 2em; 16 | line-height: 1.5em; 17 | } 18 | 19 | .post-meta { 20 | color: rgba(85, 85, 85, 0.52941) !important; 21 | .dark-theme & { 22 | color: $dark-font-secondary-color !important; 23 | } 24 | 25 | a { 26 | color: $light-post-link-color; 27 | .dark-theme & { 28 | color: $dark-post-link-color; 29 | } 30 | 31 | &:hover { 32 | color: $light-post-link-hover-color; 33 | .dark-theme & { 34 | color: $dark-post-link-hover-color; 35 | } 36 | } 37 | } 38 | } 39 | 40 | .post-content { 41 | padding-top: 2rem; 42 | 43 | // 隐藏文字 44 | .spoiler { 45 | color: black; 46 | background-color:black; 47 | } 48 | .spoiler:hover{ 49 | color: white; 50 | } 51 | 52 | // 嵌入 BiliBili 视频 53 | #biliplayer { 54 | width: 100%; 55 | height: 550px; 56 | } 57 | @media only screen and (min-device-width: 320px) and (max-device-width: 480px) { 58 | #biliplayer { 59 | width: 100%; 60 | height: 250px; 61 | } 62 | } 63 | 64 | h2, 65 | h3, 66 | h4, 67 | h5, 68 | h6 { 69 | padding-top: .8em; 70 | padding-bottom: .3em; 71 | } 72 | h2::before { 73 | content: "#"; 74 | margin-right: 5px; 75 | color: $light-post-link-color; 76 | .dark-theme & { 77 | color: $dark-post-link-color; 78 | } 79 | } 80 | 81 | h3::before { 82 | content: "|"; 83 | margin-right: 5px; 84 | color: $light-post-link-color; 85 | 86 | .dark-theme & { 87 | color: $dark-post-link-color; 88 | } 89 | } 90 | 91 | a { 92 | color: $light-post-link-color; 93 | .dark-theme & { 94 | color: $dark-post-link-color; 95 | } 96 | } 97 | 98 | a:hover { 99 | color: $light-post-link-hover-color; 100 | .dark-theme &:hover { 101 | color: $dark-post-link-hover-color; 102 | // font-weight: bold; 103 | text-decoration: underline; 104 | } 105 | } 106 | 107 | code, 108 | pre { 109 | padding: 16px; 110 | font-size: 13px; 111 | line-height: 1.45; 112 | text-indent: -1.2em; 113 | white-space: pre-wrap; 114 | word-wrap: break-word; 115 | font-family: 'Fira Code', Consolas, Monaco, Menlo, Consolas, monospace; 116 | word-break: break-all; 117 | word-wrap: break-word; 118 | } 119 | 120 | code:not([class]) { 121 | padding: 1px 6px; 122 | margin: 0 2px; 123 | background: $light-code-notclass-background-color; 124 | border-radius: 5px; 125 | 126 | .dark-theme &:not([class]) { 127 | background: $dark-code-notclass-background-color; 128 | } 129 | } 130 | 131 | .highlight { 132 | position: relative; 133 | .copy-code-button { 134 | position: absolute; 135 | bottom: 16px; 136 | right: 7px; 137 | border: 0; 138 | border-radius: 4px; 139 | padding: 1px; 140 | font-size: .7em; 141 | line-height: 1.8; 142 | color: #fff; 143 | background-color: #777; 144 | min-width: 55px; 145 | text-align: center; 146 | } 147 | .copy-code-button:hover { 148 | background-color: $light-post-link-hover-color; 149 | } 150 | } 151 | 152 | ul { 153 | padding-left: 2em; 154 | } 155 | 156 | table { 157 | max-width: 100%; 158 | margin: 10px 0; 159 | border-spacing: 0; 160 | box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.125); 161 | 162 | th, 163 | td { 164 | padding: 5px 15px; 165 | border: 1px double #ebe9f5; 166 | } 167 | } 168 | 169 | figure { 170 | text-align: center; 171 | img:hover{ 172 | cursor: zoom-in; 173 | } 174 | } 175 | 176 | .image-caption:not(:empty) { 177 | min-width: 20%; 178 | max-width: 100%; 179 | display: inline-block; 180 | padding: 10px; 181 | margin: 0 auto; 182 | border-bottom: 1px solid #d9d9d9; 183 | font-size: 14px; 184 | color: #969696; 185 | line-height: 1.7; 186 | } 187 | 188 | img { 189 | display: block; 190 | max-width: 100%; 191 | height: auto; 192 | margin: 0 auto; 193 | overflow: hidden; 194 | .dark-theme & { 195 | filter: brightness(50%) 196 | } 197 | } 198 | 199 | 200 | 201 | img[data-action="zoom"] { 202 | cursor: zoom-in; 203 | } 204 | 205 | .featured_image { 206 | width: 100% !important; 207 | max-width: 100% !important; 208 | height: auto !important; 209 | margin: 0 !important; 210 | } 211 | } 212 | 213 | p { 214 | font-size: 1em; 215 | margin: .5em 0 .5em 0; 216 | } 217 | 218 | .post-copyright { 219 | margin-top: 5rem; 220 | border-top: 1px solid $light-border-color; 221 | border-bottom: 1px solid $light-border-color; 222 | 223 | .copyright-item { 224 | margin: 5px 0; 225 | } 226 | 227 | .lincese { 228 | font-weight: bold; 229 | } 230 | 231 | .dark-theme & { 232 | border-top: 1px solid $dark-border-color; 233 | border-bottom: 1px solid $dark-border-color; 234 | } 235 | } 236 | 237 | .post-tags { 238 | padding: 1rem 0 1rem; 239 | display: flex; 240 | justify-content: space-between; 241 | 242 | } 243 | 244 | 245 | .post-nav { 246 | 247 | &:before, 248 | &:after { 249 | content: " "; 250 | display: table; 251 | } 252 | 253 | & a.prev, 254 | & a.next { 255 | font-weight: 600; 256 | font-size: 16px; 257 | 258 | transition-property: transform; 259 | transition-timing-function: ease-out; 260 | transition-duration: 0.3s; 261 | } 262 | 263 | & a.prev { 264 | float: left; 265 | } 266 | 267 | & a.prev:hover { 268 | transform: translateX(-4px); 269 | } 270 | 271 | & a.next { 272 | float: right; 273 | } 274 | & a.next:hover { 275 | transform: translateX(4px); 276 | } 277 | } 278 | 279 | .tag:not(:last-child) a::after { 280 | content: " / "; 281 | } 282 | 283 | .post-comment{ 284 | padding: 3em 0; 285 | } 286 | } 287 | -------------------------------------------------------------------------------- /assets/css/_common/_core/normalize.scss: -------------------------------------------------------------------------------- 1 | /*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ 2 | 3 | /* Document 4 | ========================================================================== */ 5 | 6 | /** 7 | * 1. Correct the line height in all browsers. 8 | * 2. Prevent adjustments of font size after orientation changes in iOS. 9 | */ 10 | @charset "UTF-8"; 11 | html { 12 | line-height: 1.15; /* 1 */ 13 | -webkit-text-size-adjust: 100%; /* 2 */ 14 | } 15 | 16 | /* Sections 17 | ========================================================================== */ 18 | 19 | /** 20 | * Remove the margin in all browsers. 21 | */ 22 | 23 | html, 24 | body, 25 | main, 26 | div, 27 | span, 28 | a, 29 | li, 30 | ul, 31 | hr, 32 | h1, 33 | h2, 34 | h3, 35 | h4 { 36 | padding: 0; 37 | margin: 0; 38 | } 39 | /** 40 | * Correct the font size and margin on `h1` elements within `section` and 41 | * `article` contexts in Chrome, Firefox, and Safari. 42 | */ 43 | 44 | h1 { 45 | font-size: 2em; 46 | margin: 0.67em 0; 47 | } 48 | 49 | /* Grouping content 50 | ========================================================================== */ 51 | 52 | /** 53 | * 1. Add the correct box sizing in Firefox. 54 | * 2. Show the overflow in Edge and IE. 55 | */ 56 | 57 | hr { 58 | box-sizing: content-box; /* 1 */ 59 | height: 0; /* 1 */ 60 | overflow: visible; /* 2 */ 61 | } 62 | 63 | /** 64 | * 1. Correct the inheritance and scaling of font size in all browsers. 65 | * 2. Correct the odd `em` font sizing in all browsers. 66 | */ 67 | 68 | pre { 69 | font-family: monospace, monospace; /* 1 */ 70 | font-size: 1em; /* 2 */ 71 | } 72 | 73 | /* Text-level semantics 74 | ========================================================================== */ 75 | 76 | /** 77 | * Remove the gray background on active links in IE 10. 78 | */ 79 | 80 | a { 81 | background-color: transparent; 82 | } 83 | 84 | /** 85 | * 1. Remove the bottom border in Chrome 57- 86 | * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. 87 | */ 88 | 89 | abbr[title] { 90 | border-bottom: none; /* 1 */ 91 | text-decoration: underline; /* 2 */ 92 | text-decoration: underline dotted; /* 2 */ 93 | } 94 | 95 | /** 96 | * Add the correct font weight in Chrome, Edge, and Safari. 97 | */ 98 | 99 | b, 100 | strong { 101 | font-weight: bolder; 102 | } 103 | 104 | /** 105 | * 1. Correct the inheritance and scaling of font size in all browsers. 106 | * 2. Correct the odd `em` font sizing in all browsers. 107 | */ 108 | 109 | code, 110 | kbd, 111 | samp { 112 | font-family: monospace, monospace; /* 1 */ 113 | font-size: 1em; /* 2 */ 114 | } 115 | 116 | /** 117 | * Add the correct font size in all browsers. 118 | */ 119 | 120 | small { 121 | font-size: 80%; 122 | } 123 | 124 | /** 125 | * Prevent `sub` and `sup` elements from affecting the line height in 126 | * all browsers. 127 | */ 128 | 129 | sub, 130 | sup { 131 | font-size: 75%; 132 | line-height: 0; 133 | position: relative; 134 | vertical-align: baseline; 135 | } 136 | 137 | sub { 138 | bottom: -0.25em; 139 | } 140 | 141 | sup { 142 | top: -0.5em; 143 | } 144 | 145 | /* Embedded content 146 | ========================================================================== */ 147 | 148 | /** 149 | * Remove the border on images inside links in IE 10. 150 | */ 151 | 152 | img { 153 | border-style: none; 154 | } 155 | 156 | /* Forms 157 | ========================================================================== */ 158 | 159 | /** 160 | * 1. Change the font styles in all browsers. 161 | * 2. Remove the margin in Firefox and Safari. 162 | */ 163 | 164 | button, 165 | input, 166 | optgroup, 167 | select, 168 | textarea { 169 | font-family: inherit; /* 1 */ 170 | font-size: 100%; /* 1 */ 171 | line-height: 1.15; /* 1 */ 172 | margin: 0; /* 2 */ 173 | } 174 | 175 | /** 176 | * Show the overflow in IE. 177 | * 1. Show the overflow in Edge. 178 | */ 179 | 180 | button, 181 | input { 182 | /* 1 */ 183 | overflow: visible; 184 | } 185 | 186 | /** 187 | * Remove the inheritance of text transform in Edge, Firefox, and IE. 188 | * 1. Remove the inheritance of text transform in Firefox. 189 | */ 190 | 191 | button, 192 | select { 193 | /* 1 */ 194 | text-transform: none; 195 | } 196 | 197 | /** 198 | * Correct the inability to style clickable types in iOS and Safari. 199 | */ 200 | 201 | button, 202 | [type="button"], 203 | [type="reset"], 204 | [type="submit"] { 205 | -webkit-appearance: button; 206 | } 207 | 208 | /** 209 | * Remove the inner border and padding in Firefox. 210 | */ 211 | 212 | button::-moz-focus-inner, 213 | [type="button"]::-moz-focus-inner, 214 | [type="reset"]::-moz-focus-inner, 215 | [type="submit"]::-moz-focus-inner { 216 | border-style: none; 217 | padding: 0; 218 | } 219 | 220 | /** 221 | * Restore the focus styles unset by the previous rule. 222 | */ 223 | 224 | button:-moz-focusring, 225 | [type="button"]:-moz-focusring, 226 | [type="reset"]:-moz-focusring, 227 | [type="submit"]:-moz-focusring { 228 | outline: 1px dotted ButtonText; 229 | } 230 | 231 | /** 232 | * Correct the padding in Firefox. 233 | */ 234 | 235 | fieldset { 236 | padding: 0.35em 0.75em 0.625em; 237 | } 238 | 239 | /** 240 | * 1. Correct the text wrapping in Edge and IE. 241 | * 2. Correct the color inheritance from `fieldset` elements in IE. 242 | * 3. Remove the padding so developers are not caught out when they zero out 243 | * `fieldset` elements in all browsers. 244 | */ 245 | 246 | legend { 247 | box-sizing: border-box; /* 1 */ 248 | color: inherit; /* 2 */ 249 | display: table; /* 1 */ 250 | max-width: 100%; /* 1 */ 251 | padding: 0; /* 3 */ 252 | white-space: normal; /* 1 */ 253 | } 254 | 255 | /** 256 | * Add the correct vertical alignment in Chrome, Firefox, and Opera. 257 | */ 258 | 259 | progress { 260 | vertical-align: baseline; 261 | } 262 | 263 | /** 264 | * Remove the default vertical scrollbar in IE 10+. 265 | */ 266 | 267 | textarea { 268 | overflow: auto; 269 | } 270 | 271 | /** 272 | * 1. Add the correct box sizing in IE 10. 273 | * 2. Remove the padding in IE 10. 274 | */ 275 | 276 | [type="checkbox"], 277 | [type="radio"] { 278 | box-sizing: border-box; /* 1 */ 279 | padding: 0; /* 2 */ 280 | } 281 | 282 | /** 283 | * Correct the cursor style of increment and decrement buttons in Chrome. 284 | */ 285 | 286 | [type="number"]::-webkit-inner-spin-button, 287 | [type="number"]::-webkit-outer-spin-button { 288 | height: auto; 289 | } 290 | 291 | /** 292 | * 1. Correct the odd appearance in Chrome and Safari. 293 | * 2. Correct the outline style in Safari. 294 | */ 295 | 296 | [type="search"] { 297 | -webkit-appearance: textfield; /* 1 */ 298 | outline-offset: -2px; /* 2 */ 299 | } 300 | 301 | /** 302 | * Remove the inner padding in Chrome and Safari on macOS. 303 | */ 304 | 305 | [type="search"]::-webkit-search-decoration { 306 | -webkit-appearance: none; 307 | } 308 | 309 | /** 310 | * 1. Correct the inability to style clickable types in iOS and Safari. 311 | * 2. Change font properties to `inherit` in Safari. 312 | */ 313 | 314 | ::-webkit-file-upload-button { 315 | -webkit-appearance: button; /* 1 */ 316 | font: inherit; /* 2 */ 317 | } 318 | 319 | /* Interactive 320 | ========================================================================== */ 321 | 322 | /* 323 | * Add the correct display in Edge, IE 10+, and Firefox. 324 | */ 325 | 326 | details { 327 | display: block; 328 | } 329 | 330 | /* 331 | * Add the correct display in all browsers. 332 | */ 333 | 334 | summary { 335 | display: list-item; 336 | } 337 | 338 | /* Misc 339 | ========================================================================== */ 340 | 341 | /** 342 | * Add the correct display in IE 10+. 343 | */ 344 | 345 | template { 346 | display: none; 347 | } 348 | 349 | /** 350 | * Add the correct display in IE 10. 351 | */ 352 | 353 | [hidden] { 354 | display: none; 355 | } 356 | -------------------------------------------------------------------------------- /assets/css/_common/_core/media.scss: -------------------------------------------------------------------------------- 1 | @media only screen and (min-device-width: 320px) and (max-device-width: 480px) { 2 | .navbar { 3 | display: none; 4 | } 5 | 6 | .navbar-mobile { 7 | display: block !important; 8 | position: fixed; 9 | width: 100%; 10 | z-index: 100; 11 | transition: all 0.6s ease 0s; 12 | // 顶部阅读进度条 13 | .content_progress { 14 | position: fixed; 15 | top: 0; 16 | left: 0; 17 | z-index: 9999; 18 | width: 100%; 19 | height: 3px; 20 | -webkit-appearance: none; 21 | -moz-appearance: none; 22 | appearance: none; 23 | border: none; 24 | background-color: transparent; 25 | color: #ef3982; 26 | } 27 | .content_progress::-webkit-progress-bar { 28 | background-color: transparent; 29 | } 30 | .content_progress::-webkit-progress-value { 31 | background-color: #ef3982; 32 | } 33 | .content_progress::-moz-progress-bar { 34 | background-color: #ef3982; 35 | } 36 | .container { 37 | padding: 0; 38 | margin: 0; 39 | height: 5em; 40 | line-height: 5.5em; 41 | background: $light-background-color; 42 | .header-logo { 43 | font-weight: bold; 44 | font-size: x-large; 45 | font-family: 'Lobster', cursive; 46 | } 47 | .navbar { 48 | display: flex; 49 | justify-content: space-between; 50 | align-items: center; 51 | width: 100%; 52 | padding-right: 1em; 53 | padding-left: 1em; 54 | box-sizing: border-box; 55 | position: fixed; 56 | z-index: 10; 57 | 58 | .navbar-right { 59 | display: flex; 60 | align-items: center; 61 | i { 62 | padding: 0 8px; 63 | float: left; 64 | font-size: 30px; 65 | } 66 | } 67 | 68 | .menu-toggle { 69 | cursor: pointer; 70 | line-height: 5.5em; 71 | 72 | span { 73 | display: block; 74 | background: #000; 75 | width: 36px; 76 | height: 2px; 77 | -webkit-border-radius: 3px; 78 | -moz-border-radius: 3px; 79 | border-radius: 3px; 80 | -webkit-transition: .25s margin .25s, .25s transform; 81 | -moz-transition: .25s margin .25s, .25s transform; 82 | transition: .25s margin .25s, .25s transform; 83 | 84 | .dark-theme & { 85 | background: $dark-font-color; 86 | } 87 | } 88 | 89 | span:nth-child(1) { 90 | margin-bottom: 8px; 91 | } 92 | span:nth-child(3) { 93 | margin-top: 8px; 94 | } 95 | 96 | &.active { 97 | span { 98 | -webkit-transition: .25s margin, .25s transform .25s; 99 | -moz-transition: .25s margin, .25s transform .25s; 100 | transition: .25s margin, .25s transform .25s; 101 | } 102 | span:nth-child(1) { 103 | -moz-transform: rotate(45deg) translate(4px, 6px); 104 | -ms-transform: rotate(45deg) translate(4px, 6px); 105 | -webkit-transform: rotate(45deg) translate(4px, 6px); 106 | transform: rotate(45deg) translate(4px, 6px); 107 | } 108 | 109 | span:nth-child(2) { 110 | opacity: 0 111 | } 112 | 113 | span:nth-child(3) { 114 | -moz-transform: rotate(-45deg) translate(8px, -10px); 115 | -ms-transform: rotate(-45deg) translate(8px, -10px); 116 | -webkit-transform: rotate(-45deg) translate(8px, -10px); 117 | transform: rotate(-45deg) translate(8px, -10px); 118 | } 119 | } 120 | } 121 | } 122 | 123 | .menu { 124 | text-align: center; 125 | background: #ffffff; 126 | width: 100%; 127 | height: 100vh; 128 | top: 0; 129 | left: 0; 130 | z-index: 9; 131 | position: fixed; 132 | display: none; 133 | .mb-md { 134 | padding-top: 150px; 135 | padding-right: 15px; 136 | padding-left: 15px; 137 | margin-right: auto; 138 | margin-left: auto; 139 | a { 140 | display: block; 141 | line-height: 2.5em; 142 | font-size: 2em; 143 | margin: auto; 144 | width: min-content; 145 | &.active .menu-active { 146 | position: relative; 147 | top: -1.25em; 148 | height: 4px; 149 | background-color: #dd1912; 150 | } 151 | } 152 | } 153 | &.active { 154 | display: block; 155 | } 156 | .dark-theme & { 157 | background: $dark-background-color; 158 | border-top: 2px solid $dark-font-secondary-color; 159 | } 160 | } 161 | .dark-theme & { 162 | background: $dark-background-color !important; 163 | } 164 | } 165 | } 166 | 167 | #dynamic-to-top { 168 | display: none !important; 169 | } 170 | .footer { 171 | height: 3rem; 172 | width: 100%; 173 | text-align: center; 174 | line-height: 1.5rem; 175 | padding-top: 2em; 176 | } 177 | 178 | .post-warp { 179 | padding-top: 6em; 180 | .archive-item-date { 181 | display: none; 182 | } 183 | .categories-card { 184 | .card-item { 185 | width: 95%; 186 | } 187 | } 188 | } 189 | } 190 | 191 | 192 | 193 | /* iPads (portrait and landscape) ----------- */ 194 | 195 | @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {} 196 | 197 | 198 | 199 | /* Desktops and laptops ----------- */ 200 | 201 | @media only screen and (min-width: 1224px) { 202 | .navbar-mobile { 203 | display: none; 204 | } 205 | } 206 | 207 | 208 | 209 | /* Large screens ----------- */ 210 | 211 | @media only screen and (min-width: 1824px) { 212 | /* Styles */ 213 | } 214 | 215 | 216 | 217 | /* Dark Mode */ 218 | 219 | @media (prefers-color-scheme: dark) { 220 | body { 221 | background-color: $dark-background-color; 222 | color: $dark-font-color; 223 | } 224 | 225 | a { 226 | color: $dark-global-link-color; 227 | text-decoration: none; 228 | transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease; 229 | 230 | &:hover{ 231 | color: $dark-global-link-hover-color; 232 | text-decoration: none; 233 | transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease; 234 | } 235 | } 236 | 237 | blockquote { 238 | background-color:$dark-blockquote-background-color; 239 | } 240 | 241 | .navbar { 242 | background-color: $dark-navbar-background-color; 243 | 244 | .navbar-right .active{ 245 | color: $dark-navbar-active-color; 246 | } 247 | } 248 | 249 | .navbar-mobile .container { 250 | 251 | background: $dark-background-color !important; 252 | 253 | .navbar .menu-toggle span { 254 | background: $dark-font-color; 255 | } 256 | 257 | .menu { 258 | background: $dark-background-color; 259 | border-top: 2px solid $dark-font-secondary-color; 260 | } 261 | } 262 | 263 | .post-warp { 264 | .post .post-footer { 265 | .post-meta a { 266 | color: $dark-font-secondary-color !important; 267 | 268 | &:hover { 269 | color: $dark-font-secondary-color !important; 270 | } 271 | } 272 | 273 | .post-tags span { 274 | color: $dark-font-secondary-color !important; 275 | 276 | a:hover { 277 | color: $dark-font-secondary-color !important; 278 | } 279 | } 280 | } 281 | 282 | .post-meta { 283 | color: $dark-font-secondary-color !important; 284 | 285 | a { 286 | color: $dark-post-link-color; 287 | 288 | &:hover { 289 | color: $dark-post-link-hover-color; 290 | } 291 | } 292 | } 293 | 294 | .post-content { 295 | h2::before, 296 | h3::before, 297 | a { 298 | color: $dark-post-link-color; 299 | } 300 | 301 | a:hover { 302 | color: $dark-post-link-hover-color; 303 | // font-weight: bold; 304 | text-decoration: underline; 305 | } 306 | 307 | code:not([class]) { 308 | background: $dark-code-notclass-background-color; 309 | } 310 | 311 | img { 312 | filter: brightness(50%) 313 | } 314 | } 315 | 316 | .post-copyright { 317 | border-top: 1px solid $dark-border-color; 318 | border-bottom: 1px solid $dark-border-color; 319 | } 320 | 321 | .archive-item-link { 322 | color: $dark-global-link-color; 323 | text-decoration: none; 324 | transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease; 325 | 326 | &:hover { 327 | color: $dark-global-link-hover-color; 328 | text-decoration: none; 329 | transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease; 330 | } 331 | } 332 | 333 | .archive-item-date { 334 | color: $dark-font-secondary-color; 335 | } 336 | } 337 | 338 | .tag-cloud-tags { 339 | a { 340 | &:active, 341 | &:focus, 342 | &:hover { 343 | color: $dark-global-link-hover-color; 344 | } 345 | 346 | small { 347 | color: $dark-global-link-hover-color; 348 | } 349 | } 350 | } 351 | 352 | .dynamic-to-top { 353 | border: 1px solid $dark-border-color; 354 | } 355 | 356 | .pagination { 357 | li{ 358 | &:hover a { 359 | color: $dark-pagination-link-active-color; 360 | } 361 | 362 | &:before, 363 | &:after{ 364 | background: $dark-pagination-link-active-color; 365 | } 366 | 367 | &.active a { 368 | color: $dark-pagination-link-active-color; 369 | } 370 | } 371 | } 372 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mogege 2 | 3 | [![Hugo](https://img.shields.io/badge/hugo-0.68.3-blue.svg)](https://gohugo.io) 4 | [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) 5 | 6 | ### A blog theme for [Hugo](https://gohugo.io). 7 | 8 | ![Screenshot](https://raw.githubusercontent.com/Mogeko/mogege/master/images/Screenshot.png) 9 | 10 | **This project is based on 11 | [LeaveIt](https://raw.githubusercontent.com/liuzc/LeaveIt/)** 12 | 13 | Because the author of 14 | [LeaveIt](https://raw.githubusercontent.com/liuzc/LeaveIt/) seems to have 15 | abandoned this project, but I prefer this theme, so I simply reopened a new 16 | project. 17 | 18 | At this stage, I mainly integrate the part I modified with LeaveIt, and will add 19 | more features in the future. 20 | 21 | ## Features 22 | 23 | - Images lazy loading 24 | ([Can I use?](https://caniuse.com/#search=Lazy%20loading%20via%20attribute%20for%20images%20%26%20iframes)) 25 | - Automatically highlighting code (Support by 26 | [highlight.js](https://highlightjs.org/)) 27 | - TeX Functions (Support by [KaTeX](https://katex.org/)) 28 | - [PlantUML](https://plantuml.com/en/) (Sequence diagram, Usecase diagram, Class 29 | diagram ...) 30 | - Dark/Light Mode 31 | - Support for embedded BiliBili video 32 | - Support hidden text ... 33 | 34 | Here is a table showing the similarities and differences between [mogege](https://github.com/Mogeko/mogege) and [LeaveIt](https://github.com/liuzc/LeaveIt): 35 | 36 | | Features | mogege | LeaveIt | 37 | | --------------------------- | ------------------------------------------------------------ | ------- | 38 | | Categories | Yes | Yes | 39 | | Tags | Yes | Yes | 40 | | RSS support | Yes | Yes | 41 | | sitemap.xml | Yes | Yes | 42 | | robots.txt | Yes | Yes | 43 | | Quote | Optimization | Yes | 44 | | Images lazy loading | Optimization[*](https://caniuse.com/#search=Lazy%20loading%20via%20attribute%20for%20images%20%26%20iframes) | Yes | 45 | | Dark/Light Mode | Optimization | Yes | 46 | | Highlighting code | Optimization | Yes | 47 | | Comment area | Optimization | Yes | 48 | | TeX Functions | Yes | | 49 | | PlantUML | Yes | | 50 | | BiliBili video (shortcodes) | Yes | | 51 | | Hidden text (shortcodes) | Yes | | 52 | | Social button | Yes | Yes | 53 | | lightGallery | | Yes | 54 | 55 | ## Requirements 56 | 57 | Hugo 0.68.3 or higher 58 | 59 | **Hugo extended version**, read more 60 | [here](https://gohugo.io/news/0.48-relnotes/) 61 | 62 | ## Installation 63 | 64 | Navigate to your hugo project root and run: 65 | 66 | ```bash 67 | git submodule add https://github.com/Mogeko/mogege themes/mogege 68 | ``` 69 | 70 | Then run hugo (or set `theme: mogege` in configuration file) 71 | 72 | ```bash 73 | hugo server --minify --theme mogege 74 | ``` 75 | 76 | ## Creating site from scratch 77 | 78 | Below is example how to create new site from scratch 79 | 80 | ```bash 81 | hugo new site mydocs; cd mydocs 82 | git init 83 | git submodule add https://github.com/Mogeko/mogege themes/mogege 84 | cp -R themes/mogege/exampleSite/content . 85 | ``` 86 | 87 | ```bash 88 | hugo server --minify --theme mogege 89 | ``` 90 | 91 | ## Lazy loading 92 | 93 | If your browser is 94 | [supported](https://caniuse.com/#search=Lazy%20loading%20via%20attribute%20for%20images%20%26%20iframes), 95 | we will lazy loading `` and `` 96 | 97 | Make sure your browser version: 98 | 99 | - Chrome > 76 100 | - Firefox > 75 101 | 102 | ## TeX Functions 103 | 104 | **Note:** 105 | [list of TeX functions supported by KaTeX](https://katex.org/docs/supported.html) 106 | 107 | To enable KaTex globally set the parameter `math` to `true` in a project's 108 | `config.toml` 109 | 110 | To enable KaTex on a per page basis include the parameter `math: true` in 111 | content files. 112 | 113 | ### Example 114 | 115 | ```latex 116 | % Inline math: 117 | $$ \varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887… $$ 118 | 119 | % or 120 | % Block math: 121 | $$ 122 | \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } 123 | $$ 124 | ``` 125 | 126 | ![KaTeX](https://raw.githubusercontent.com/Mogeko/mogege/master/images/KaTeX.png) 127 | 128 | ## PlantUML 129 | 130 | **PlantUML is supported by the 131 | [official server](http://www.plantuml.com/plantuml/uml/SyfFKj2rKt3CoKnELR1Io4ZDoSa70000)** 132 | 133 | To enable KaTex globally set the parameter `plantuml` to `true` in a project's 134 | `config.toml` 135 | 136 | To enable KaTex on a per page basis include the parameter `plantuml: true` in 137 | content files. 138 | 139 | You can insert PlantUML in the post by: 140 | 141 |
142 | ```plantuml
143 | PlantUML syntax
144 | ```
145 | 
146 | 147 | For example: 148 | 149 | ```plantuml 150 | @startuml 151 | Bob -> Alice : hello 152 | 153 | create Other 154 | Alice -> Other : new 155 | 156 | create control String 157 | Alice -> String 158 | note right : You can also put notes! 159 | 160 | Alice --> Bob : ok 161 | 162 | @enduml 163 | ``` 164 | 165 | ![PlantUML](https://raw.githubusercontent.com/Mogeko/mogege/master/images/PlantUML.svg) 166 | 167 | ## Embedded BiliBili video 168 | 169 | You can embed BiliBili videos via Shortcodes, just provide the AV 号/BV 号 of 170 | the bilibili video 171 | 172 | You can also use the PV 号 to control the 分 P (default: `1`) 173 | 174 | ```txt 175 | {{< bilibili [AV号/BV号] [PV号] >}} 176 | ``` 177 | 178 | Click [here](https://mogeko.github.io/2020/079#biliplayer) for examples 179 | 180 | ## Hidden text 181 | 182 | You can use "hidden text" to hide spoiler content 183 | 184 | ```txt 185 | {{< spoiler >}} HIDDEN TEXT {{< /spoiler >}} 186 | ``` 187 | 188 | Click [here](https://mogeko.github.io/2020/080#spoiler) for examples 189 | 190 | ## utteranc comment system 191 | 192 | This blog supports the 193 | [utteranc](https://utteranc.es) comment system. 194 | 195 | It is lighter and more powerful than Gitalk. 196 | 197 | To use utteranc, you need make sure the 198 | [utterances app](https://github.com/apps/utterances) is 199 | installed on the repo, otherwise users will not be able to post comments. 200 | 201 | Then enable utteranc in config.toml 202 | 203 | ```toml 204 | [params] 205 | enableUtteranc = true 206 | ``` 207 | 208 | Then Configuration: (For more settings, please refer to 209 | [HomePage](https://utteranc.es)) 210 | 211 | ```toml 212 | [params.utteranc] # Homepage: https://utteranc.es 213 | repo = "" # The repo to store comments 214 | issueTerm = "title" # the mapping between blog posts and GitHub issues. 215 | theme = "preferred-color-scheme" # Theme 216 | crossorigin = "anonymous" # default: anonymous 217 | ``` 218 | 219 | ## Gitalk comment system 220 | 221 | This blog supports the [gitalk](https://github.com/gitalk/gitalk) comment 222 | system. To use gitalk, you need to apply for a Github Application. For details, 223 | please refer to 224 | [here](https://mogeko.me/2018/024/#%E5%88%9B%E5%BB%BA-github-application). 225 | 226 | Then enable gitalk in config.toml 227 | 228 | ```toml 229 | [params] 230 | enableGitalk = true 231 | ``` 232 | 233 | Then provide your `Client ID` and `Client Secret` from Github Application in 234 | config.toml 235 | 236 | ```toml 237 | [params.gitalk] # Github: https://github.com/gitalk/gitalk 238 | clientID = "[Client ID]" # Your client ID 239 | clientSecret = "[Client Secret]" # Your client secret 240 | repo = "" # The repo to store comments 241 | owner = "" # Your GitHub ID 242 | admin= "" # Required. Github repository owner and collaborators. (Users who having write access to this repository) 243 | id= "location.pathname" # The unique id of the page. 244 | labels= "gitalk" # Github issue labels. If you used to use Gitment, you can change it 245 | perPage= 15 # Pagination size, with maximum 100. 246 | pagerDirection= "last" # Comment sorting direction, available values are 'last' and 'first'. 247 | createIssueManually= true # If it is 'false', it is auto to make a Github issue when the administrators login. 248 | distractionFreeMode= false # Enable hot key (cmd|ctrl + enter) submit comment. 249 | ``` 250 | 251 | ## Custom CSS/JavaScript 252 | 253 | Support custom CSS or JavaScript 254 | 255 | Place your custom CSS and JavaScript files in the `/static/css` and `/static/js` 256 | directories of your blog, respectively 257 | 258 | ```txt 259 | static 260 | ├── css 261 | │ └── _custom.css 262 | └── js 263 | └── _custom.js 264 | ``` 265 | 266 | Then edit in `config.toml`: 267 | 268 | ```toml 269 | [params.custom] 270 | css = ["css/_custom.css"] 271 | js = ["js/_custom.js"] 272 | ``` 273 | 274 | > Currently only supports CSS does not support Sass 275 | 276 | ## Configuration 277 | 278 | There are few configuration options you can add to your `config.toml` file. 279 | 280 | ```toml 281 | baseURL = "" # 里面的 baseurl 信息,填你的博客地址 282 | title = "" # 浏览器的标题 283 | languageCode = "zh-cn" # 语言 284 | hasCJKLanguage = true # 开启可以让「字数统计」统计汉字 285 | theme = "mogege" # 主题 286 | 287 | paginate = 11 # 每页的文章数 288 | enableEmoji = true # 支持 Emoji 289 | enableRobotsTXT = true # 支持 robots.txt 290 | 291 | 292 | preserveTaxonomyNames = true 293 | 294 | [blackfriday] 295 | hrefTargetBlank = true 296 | nofollowLinks = true 297 | noreferrerLinks = true 298 | 299 | [Permalinks] 300 | posts = "/:year/:filename/" 301 | 302 | [menu] 303 | [[menu.main]] 304 | name = "Blog" 305 | url = "/post/" 306 | weight = 1 307 | 308 | [[menu.main]] 309 | name = "Categories" 310 | url = "/categories/" 311 | weight = 2 312 | 313 | [[menu.main]] 314 | name = "Tags" 315 | url = "/tags/" 316 | weight = 3 317 | 318 | [[menu.main]] 319 | name = "About" 320 | url = "/about/" 321 | weight = 4 322 | 323 | [params] 324 | since = 325 | author = "" # Author's name 326 | avatar = "/images/me/avatar.jpg" # Author's avatar 327 | subtitle = "" # Subtitle 328 | home_mode = "" # post or other 329 | enableGitalk = true # gitalk 评论系统 330 | 331 | google_verification = "" 332 | 333 | description = "" # (Meta) 描述 334 | keywords = "" # site keywords 335 | 336 | beian = "" 337 | baiduAnalytics = "" 338 | googleAnalytics = "" # Google 统计 id 339 | 340 | license= '本文采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可' 341 | 342 | [params.gitalk] # Github: https://github.com/gitalk/gitalk 343 | clientID = "" # Your client ID 344 | clientSecret = "" # Your client secret 345 | repo = "" # The repo to store comments 346 | owner = "" # Your GitHub ID 347 | admin= "" # Required. Github repository owner and collaborators. (Users who having write access to this repository) 348 | id= "location.pathname" # The unique id of the page. 349 | labels= "gitalk" # Github issue labels. If you used to use Gitment, you can change it 350 | perPage= 15 # Pagination size, with maximum 100. 351 | pagerDirection= "last" # Comment sorting direction, available values are 'last' and 'first'. 352 | createIssueManually= true # If it is 'false', it is auto to make a Github issue when the administrators login. 353 | distractionFreeMode= false # Enable hot key (cmd|ctrl + enter) submit comment. 354 | 355 | ``` 356 | 357 | --- 358 | 359 | > The name of this project comes from the game 360 | > [_Mogeko Castle_](https://okegom.fandom.com/wiki/Mogeko_Castle), and the 361 | > [author](https://github.com/Mogeko)'s name also comes from this game. (this is 362 | > another story) 363 | --------------------------------------------------------------------------------