diff --git a/archetypes/default.md b/archetypes/default.md index 4ee62f42..97e6386d 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -6,13 +6,13 @@ draft: true description: "" show_in_homepage: true show_description: false -license: '' +license: "" tags: [] categories: [] -featured_image: '' -featured_image_preview: '' +featured_image: "" +featured_image_preview: "" comment: true toc: false diff --git a/assets/css/_core/_base.scss b/assets/css/_core/_base.scss index 80cf7df0..6d1a264a 100644 --- a/assets/css/_core/_base.scss +++ b/assets/css/_core/_base.scss @@ -1,7 +1,5 @@ -@import url(https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900); - html { - font-family: "Lato", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", STHeiti, "Microsoft Yahei", "WenQuanYi Micro Hei", Arial, Verdana, sans-serif; + font-family: $global-font-family; /* scrollbar, only support webkit */ &::-webkit-scrollbar { diff --git a/assets/css/_core/_media.scss b/assets/css/_core/_media.scss index 0f5d524c..e8a0f61b 100644 --- a/assets/css/_core/_media.scss +++ b/assets/css/_core/_media.scss @@ -1,5 +1,5 @@ @media only screen and (max-width: 1800px) { - .post-warp { + .warpper { max-width: 780px; .post-toc { @@ -9,7 +9,7 @@ } @media only screen and (max-width: 1300px) { - .post-warp { + .warpper { max-width: 560px; .post-toc { @@ -25,7 +25,7 @@ } } - .post-warp { + .warpper { max-width: 80%; .post-toc { @@ -38,7 +38,7 @@ } } -@media only screen and (max-width: 480px) { +@media only screen and (max-width: 560px) { .navbar { display: none; } @@ -47,7 +47,7 @@ display: block; } - .post-warp { + .warpper { max-width: 100%; .categories-card { diff --git a/assets/css/_core/_normalize.scss b/assets/css/_core/_normalize.scss index 20dbded8..192eb9ce 100644 --- a/assets/css/_core/_normalize.scss +++ b/assets/css/_core/_normalize.scss @@ -1,4 +1,4 @@ -/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ /* Document ========================================================================== */ @@ -7,41 +7,35 @@ * 1. Correct the line height in all browsers. * 2. Prevent adjustments of font size after orientation changes in iOS. */ - @charset "UTF-8"; - html { - line-height: 1.15; /* 1 */ - -webkit-text-size-adjust: 100%; /* 2 */ - } + +html { + line-height: 1.15; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} /* Sections - ========================================================================== */ + ========================================================================== */ /** -* Remove the margin in all browsers. -*/ + * Remove the margin in all browsers. + */ -html, -body, -main, -div, -span, -a, -li, -ul, -hr, -h1, -h2, -h3, -h4, -h5, -h6 { - padding: 0; +body { margin: 0; } + /** -* Correct the font size and margin on `h1` elements within `section` and -* `article` contexts in Chrome, Firefox, and Safari. -*/ + * Render the `main` element consistently in IE. + */ + +main { + display: block; +} + +/** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ h1 { font-size: 2em; @@ -49,12 +43,12 @@ h1 { } /* Grouping content - ========================================================================== */ + ========================================================================== */ /** -* 1. Add the correct box sizing in Firefox. -* 2. Show the overflow in Edge and IE. -*/ + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ hr { box-sizing: content-box; /* 1 */ @@ -63,9 +57,9 @@ hr { } /** -* 1. Correct the inheritance and scaling of font size in all browsers. -* 2. Correct the odd `em` font sizing in all browsers. -*/ + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ pre { font-family: monospace, monospace; /* 1 */ @@ -73,20 +67,20 @@ pre { } /* Text-level semantics - ========================================================================== */ + ========================================================================== */ /** -* Remove the gray background on active links in IE 10. -*/ + * Remove the gray background on active links in IE 10. + */ a { background-color: transparent; } /** -* 1. Remove the bottom border in Chrome 57- -* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. -*/ + * 1. Remove the bottom border in Chrome 57- + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ abbr[title] { border-bottom: none; /* 1 */ @@ -95,8 +89,8 @@ abbr[title] { } /** -* Add the correct font weight in Chrome, Edge, and Safari. -*/ + * Add the correct font weight in Chrome, Edge, and Safari. + */ b, strong { @@ -104,9 +98,9 @@ strong { } /** -* 1. Correct the inheritance and scaling of font size in all browsers. -* 2. Correct the odd `em` font sizing in all browsers. -*/ + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ code, kbd, @@ -116,17 +110,17 @@ samp { } /** -* Add the correct font size in all browsers. -*/ + * Add the correct font size in all browsers. + */ small { font-size: 80%; } /** -* Prevent `sub` and `sup` elements from affecting the line height in -* all browsers. -*/ + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ sub, sup { @@ -145,23 +139,23 @@ sup { } /* Embedded content - ========================================================================== */ + ========================================================================== */ /** -* Remove the border on images inside links in IE 10. -*/ + * Remove the border on images inside links in IE 10. + */ img { border-style: none; } /* Forms - ========================================================================== */ + ========================================================================== */ /** -* 1. Change the font styles in all browsers. -* 2. Remove the margin in Firefox and Safari. -*/ + * 1. Change the font styles in all browsers. + * 2. Remove the margin in Firefox and Safari. + */ button, input, @@ -175,30 +169,28 @@ textarea { } /** -* Show the overflow in IE. -* 1. Show the overflow in Edge. -*/ + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ button, -input { - /* 1 */ +input { /* 1 */ overflow: visible; } /** -* Remove the inheritance of text transform in Edge, Firefox, and IE. -* 1. Remove the inheritance of text transform in Firefox. -*/ + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ button, -select { - /* 1 */ +select { /* 1 */ text-transform: none; } /** -* Correct the inability to style clickable types in iOS and Safari. -*/ + * Correct the inability to style clickable types in iOS and Safari. + */ button, [type="button"], @@ -208,8 +200,8 @@ button, } /** -* Remove the inner border and padding in Firefox. -*/ + * Remove the inner border and padding in Firefox. + */ button::-moz-focus-inner, [type="button"]::-moz-focus-inner, @@ -220,8 +212,8 @@ button::-moz-focus-inner, } /** -* Restore the focus styles unset by the previous rule. -*/ + * Restore the focus styles unset by the previous rule. + */ button:-moz-focusring, [type="button"]:-moz-focusring, @@ -231,19 +223,19 @@ button:-moz-focusring, } /** -* Correct the padding in Firefox. -*/ + * Correct the padding in Firefox. + */ fieldset { padding: 0.35em 0.75em 0.625em; } /** -* 1. Correct the text wrapping in Edge and IE. -* 2. Correct the color inheritance from `fieldset` elements in IE. -* 3. Remove the padding so developers are not caught out when they zero out -* `fieldset` elements in all browsers. -*/ + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ legend { box-sizing: border-box; /* 1 */ @@ -255,25 +247,25 @@ legend { } /** -* Add the correct vertical alignment in Chrome, Firefox, and Opera. -*/ + * Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ progress { vertical-align: baseline; } /** -* Remove the default vertical scrollbar in IE 10+. -*/ + * Remove the default vertical scrollbar in IE 10+. + */ textarea { overflow: auto; } /** -* 1. Add the correct box sizing in IE 10. -* 2. Remove the padding in IE 10. -*/ + * 1. Add the correct box sizing in IE 10. + * 2. Remove the padding in IE 10. + */ [type="checkbox"], [type="radio"] { @@ -282,8 +274,8 @@ textarea { } /** -* Correct the cursor style of increment and decrement buttons in Chrome. -*/ + * Correct the cursor style of increment and decrement buttons in Chrome. + */ [type="number"]::-webkit-inner-spin-button, [type="number"]::-webkit-outer-spin-button { @@ -291,9 +283,9 @@ textarea { } /** -* 1. Correct the odd appearance in Chrome and Safari. -* 2. Correct the outline style in Safari. -*/ + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ [type="search"] { -webkit-appearance: textfield; /* 1 */ @@ -301,17 +293,17 @@ textarea { } /** -* Remove the inner padding in Chrome and Safari on macOS. -*/ + * Remove the inner padding in Chrome and Safari on macOS. + */ [type="search"]::-webkit-search-decoration { -webkit-appearance: none; } /** -* 1. Correct the inability to style clickable types in iOS and Safari. -* 2. Change font properties to `inherit` in Safari. -*/ + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to `inherit` in Safari. + */ ::-webkit-file-upload-button { -webkit-appearance: button; /* 1 */ @@ -319,38 +311,38 @@ textarea { } /* Interactive - ========================================================================== */ + ========================================================================== */ /* -* Add the correct display in Edge, IE 10+, and Firefox. -*/ + * Add the correct display in Edge, IE 10+, and Firefox. + */ details { display: block; } /* -* Add the correct display in all browsers. -*/ + * Add the correct display in all browsers. + */ summary { display: list-item; } /* Misc - ========================================================================== */ + ========================================================================== */ /** -* Add the correct display in IE 10+. -*/ + * Add the correct display in IE 10+. + */ template { display: none; } /** -* Add the correct display in IE 10. -*/ + * Add the correct display in IE 10. + */ [hidden] { display: none; diff --git a/assets/css/_page/_index.scss b/assets/css/_page/_index.scss index e0f88941..8a0b5df4 100644 --- a/assets/css/_page/_index.scss +++ b/assets/css/_page/_index.scss @@ -1,6 +1,6 @@ @import "_home"; -.post-warp { +.warpper { position: relative; width: 100%; max-width: 960px; @@ -26,4 +26,4 @@ text-align: right; padding-bottom: 2rem; } -} \ No newline at end of file +} diff --git a/assets/css/_page/_post.scss b/assets/css/_page/_post.scss index 8bac91a6..513eb44e 100644 --- a/assets/css/_page/_post.scss +++ b/assets/css/_page/_post.scss @@ -7,14 +7,14 @@ .post-meta { font-size: .88rem; - color: rgba(85, 85, 85, 0.52941) !important; + color: $global-font-secondary-color; span { display: inline-block; } .dark-theme & { - color: $global-font-secondary-color-dark !important; + color: $global-font-secondary-color-dark; } a { @@ -246,7 +246,6 @@ max-width: 100%; margin: .625rem 0; border-spacing: 0; - box-shadow: 2px 2px 3px rgba(0,0,0,.125); background: $table-background-color; .dark-theme & { @@ -306,7 +305,7 @@ margin: 0 0 2em 0; position: relative; - &:before { + &::before { content: '\201C'; position: absolute; top: 0em; @@ -323,8 +322,8 @@ } } - &:after { - content: "#blockquote" attr(cite); + &::after { + content: '#blockquote' attr(cite); display: block; text-align: right; font-size: 0.875em; @@ -340,6 +339,14 @@ } } + .footnotes { + color: $global-font-secondary-color; + + .dark-theme & { + color: $global-font-secondary-color-dark; + } + } + @import "../_partial/_post/code"; @import "../_partial/_post/admonition"; @@ -420,45 +427,9 @@ .code { padding: .375rem; font-size: .875rem; - font-family: Consolas, Monaco, Menlo, Consolas, monospace; + font-family: $code-font-family; font-weight: bold; word-break: break-all; - - .k { - color: #D371E3; - } - - .kt { - color: #D371E3; - } - - .kc { - color: #D371E3; - } - - .o { - color: #D371E3; - } - - .nf { - color: #F16473; - } - - .na { - color: #41B1F5; - } - - .s { - color: #8BC56F; - } - - .n { - color: #DB975C; - } - - .c1 { - color: #7E848F; - } } } @@ -544,20 +515,20 @@ } .post-nav { - &:before, - &:after { - content: " "; + &::before, + &::after { + content: ' '; display: table; } & a.prev, & a.next { - font-weight: 600; font-size: 1rem; + font-weight: 600; + transition-duration: .3s; transition-property: transform; transition-timing-function: ease-out; - transition-duration: 0.3s; } & a.prev { @@ -580,4 +551,4 @@ .post-comment { padding: 4rem 0; -} \ No newline at end of file +} diff --git a/assets/css/_page/_posts.scss b/assets/css/_page/_posts.scss index 9daa4cf8..43e4a18b 100644 --- a/assets/css/_page/_posts.scss +++ b/assets/css/_page/_posts.scss @@ -24,7 +24,7 @@ width: 100%; padding: 30% 0 0; position: relative; - margin-bottom: 1rem; + margin: 0.6rem auto; img { position: absolute; @@ -32,7 +32,7 @@ height: 100%; left: 0; top: 0; - object-fit: scale-down; + object-fit: cover; } } diff --git a/assets/css/_partial/_post/_code.scss b/assets/css/_partial/_post/_code.scss index d43d256f..8d2d0ffe 100644 --- a/assets/css/_partial/_post/_code.scss +++ b/assets/css/_partial/_post/_code.scss @@ -34,9 +34,8 @@ p > code { // chroma .highlight > .chroma { margin: 1em 0; - border-radius: 5px; + border-radius: 6px; overflow-x: auto; - box-shadow: 1px 1px 2px rgba(0,0,0,0.125); position: relative; background: $code-background-color; @@ -66,7 +65,7 @@ p > code { } @each $sign, $text in $code-type-list { - &.#{$sign} table::after { + & .#{$sign} table::after { content: $text; } } @@ -119,7 +118,7 @@ p > code { } } -.code { +.highlight { /* Parentheses */ .p { color: #A9A9B3 } /* Keyword */ .k { color: #859900 } /* KeywordConstant */ .kc { color: #859900; font-weight: bold } diff --git a/assets/css/_variables.scss b/assets/css/_variables.scss index 26412a78..4301ae86 100644 --- a/assets/css/_variables.scss +++ b/assets/css/_variables.scss @@ -3,6 +3,10 @@ // ============================== // ========== Global ========== // +@import url(https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900); + +$global-font-family: Lato, -apple-system, BlinkMacSystemFont, PingFang-SC-Regular, Hiragino Sans GB, Microsoft Yahei, Arial, sans-serif !default; + // Background color of the body $global-background-color: #fff !default; $global-background-color-dark: #292a2d !default; @@ -31,7 +35,7 @@ $navbar-active-color-dark: #fff !default; $post-link-color: #2d96bd !default; $post-link-color-dark: #eee !default; $post-link-hover-color: #ef3982 !default; -$post-link-hover-color-dark: #fff !default; +$post-link-hover-color-dark: #2d96bd !default; $pagination-link-color: #2d96bd !default; $pagination-link-color-dark: #a9a9b3 !default; @@ -52,7 +56,7 @@ $code-color: #E74C3C !default; $code-color-dark: #E5BF78 !default; // Color of the code background. -$code-background-color: whitesmoke !default; +$code-background-color: #f5f5f5 !default; $code-background-color-dark: #272C34 !default; $code-info-color: #cacaca !default; @@ -61,7 +65,7 @@ $code-info-color: #cacaca !default; $code-font-size: 13px !default; // Font family of the code. -$code-font-family: Consolas, Monaco, Menlo, "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace !default; +$code-font-family: Source Code Pro, Consolas, Liberation Mono, Menlo, Courier, monospace !default; // Code type list. $code-type-list: ( diff --git a/assets/js/blog.js b/assets/js/blog.js index be869656..6abaeaad 100644 --- a/assets/js/blog.js +++ b/assets/js/blog.js @@ -157,27 +157,23 @@ jQuery(function($) { }; changeTocState(); - const HEADERFIX = 100; + const HEADERFIX = 150; const $toclink = $('.toc-link'); const $headerlink = $('.headerlink'); const $tocLinkLis = $('.post-toc-content li'); - const activeIndex = function() { + const activeIndex = function () { const scrollTop = $(window).scrollTop(); const headerlinkTop = $.map($headerlink, function(link) { return $(link).offset().top; }); - const headerLinksOffsetForSearch = $.map(headerlinkTop, function(offset) { - return offset - HEADERFIX; - }); const searchActiveTocIndex = function(array, target) { for (let i = 0; i < array.length - 1; i++) { - if (target > array[i] && target <= array[i + 1]) return i; + if ( target < array[i + 1]) return i; } - if (target > array[array.length - 1]) return array.length - 1; - return 0; + return array.length - 1; }; - const activeTocIndex = searchActiveTocIndex(headerLinksOffsetForSearch, scrollTop); + const activeTocIndex = searchActiveTocIndex(headerlinkTop, scrollTop + HEADERFIX); $($toclink).removeClass('active'); $($tocLinkLis).removeClass('has-active'); diff --git a/exampleSite/static/images/loading.svg b/assets/svg/loading.svg similarity index 72% rename from exampleSite/static/images/loading.svg rename to assets/svg/loading.svg index 075a3990..b852575c 100644 --- a/exampleSite/static/images/loading.svg +++ b/assets/svg/loading.svg @@ -1,10 +1,10 @@ - \ No newline at end of file diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 532195c9..218d8b60 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -1,41 +1,64 @@ baseURL = "https://example.com/" -languageCode = "en" # website language -defaultContentLanguage = "en" # [en, zh, ...] determines which i18n file to use -title = "LoveIt Theme" # website title -theme = "LoveIt" # theme -enableGitInfo = false # whether to use git commit log to generate lastmod record -hasCJKLanguage = false # whether to include chinese/japanese/korean -paginate = 12 # default amount of posts in each pages -enableEmoji = true # whether to use emoji code -enableRobotsTXT = true # whether to use robots.txt -googleAnalytics = "" # [UA-XXXXXXXX-X] google analytics code -disqusShortname = "dillonzq" # Disqus shortname to use Disqus in posts +# website language +languageCode = "en" +# [en, zh, ...] determines which i18n file to use +defaultContentLanguage = "en" +# website title +title = "LoveIt Theme" +# theme +theme = "LoveIt" +# whether to use git commit log to generate lastmod record +enableGitInfo = false +# whether to include chinese/japanese/korean +hasCJKLanguage = false +# default amount of posts in each pages +paginate = 12 +# whether to use emoji code +enableEmoji = true +# whether to use robots.txt +enableRobotsTXT = true +# [UA-XXXXXXXX-X] google analytics code +googleAnalytics = "" +# copyright description used only for seo schema copyright = "This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License." - # copyright description used only for seo schema - - #### Syntax Highlighting (https://gohugo.io/content-management/syntax-highlighting) -pygmentsOptions = "linenos=table" -pygmentsCodefences = true -pygmentsUseClasses = true -pygmentsCodefencesGuessSyntax = true +# Markup related configuration in Hugo [markup] -[markup.goldmark] -[markup.goldmark.renderer] -unsafe = true + # Syntax Highlighting (https://gohugo.io/content-management/syntax-highlighting) + [markup.highlight] + codeFences = true + guessSyntax = true + lineNoStart = 1 + lineNos = true + lineNumbersInTable = true + noClasses = false + style = "monokai" + tabWidth = 4 + # Goldmark is from Hugo 0.60 the default library used for Markdown + [markup.goldmark] + [markup.goldmark.renderer] + unsafe = true + # Table Of Contents settings + [markup.tableOfContents] + startLevel = 2 + endLevel = 6 -[author] #### Author Info - name = "XXXX" +# Author Info +[author] + name = "xxxx" -[sitemap] #### Sitemap Info +# Sitemap Info +[sitemap] changefreq = "weekly" filename = "sitemap.xml" priority = 0.5 -[Permalinks] #### Permalinks Info (https://gohugo.io/content-management/urls/#permalinks) +# Permalinks Info (https://gohugo.io/content-management/urls/#permalinks) +[Permalinks] posts = ":year/:month/:filename" -[menu] #### Menu Info +# Menu Info +[menu] [[menu.main]] identifier = "posts" name = "Posts" @@ -62,41 +85,56 @@ unsafe = true [[menu.main]] identifier = "zh" - name = '' + name = '' url = "https://hugo-loveit-zh.netlify.com" weight = 5 [params] - version = "5.x" # LoveIt theme version - description = "LoveIt Theme Demo" # site description - keywords = ["XXXX", "Theme", "Hugo"] # site keywords + # LoveIt theme version + version = "0.1.X" + # site description + description = "LoveIt Theme Demo" + # site keywords + keywords = ["Theme", "Hugo"] - #### Home Page Info - home_mode = "post" # [post, other] home mode - home_paginate = 6 # special amount of posts in each home post page - avatar = "images/avatar.png" # URL of avatar shown in home page - subtitle = "A Clean, Elegant but Advanced Hugo Theme" # subtitle shown in home page + # Home Page Info + ## [post, other] home mode + home_mode = "post" + ## special amount of posts in each home post page + home_paginate = 6 + ## URL of avatar shown in home page + avatar = "images/avatar.png" + ## subtitle shown in home page + subtitle = "A Clean, Elegant but Advanced Hugo Theme" - socialShare = true # whether to show social share links in post page + # whether to show social share links in post page + socialShare = true - #### Footer CopyRight Info - since = 2018 # Site creation time - icp = '' # ICP info only in China (HTML format is allowed) + # Footer CopyRight Info + ## Site creation time + since = 2018 + ## ICP info only in China (HTML format is allowed) + icp = "" + ## license info (HTML format is allowed) license= 'CC BY-NC 4.0' - # license info (HTML format is allowed) - gitRepo = "" # public git repo url to link lastmod git commit only then enableGitInfo is true - linkToMarkdown = true # whether to show link to Raw Markdown content of the post + # public git repo url to link lastmod git commit only then enableGitInfo is true + gitRepo = "" - #### site verification code for Google/Bing/Yandex/Pinterest/Baidu + # whether to show link to Raw Markdown content of the post + linkToMarkdown = true + + # site verification code for Google/Bing/Yandex/Pinterest/Baidu google_verification = "" bing_verification = "" yandex_verification = "" pinterest_verification = "" baidu_verification = "" - [params.cdn] #### CSS and JS Files CDN - fontawesome_free_css = '' # for example '' + # CSS and JS Files CDN + [params.cdn] + ## for example '' + fontawesome_free_css = '' animate_css = '' gitalk_css = '' gitalk_js = '' @@ -116,15 +154,17 @@ unsafe = true aplayer_js = '' meting_js = '' - [params.gravatar] # Gravatar Info for preferred avatar in home page + # Gravatar Info for preferred avatar in home page + [params.gravatar] email = "" - [params.social] # Social Info in home page + # Social Info in home page + [params.social] GitHub = "xxxx" Linkedin = "xxxx" Twitter = "xxxx" #Instagram = "xxxx" - #Email = "xxxx" + Email = "xxxx@outlook.com" Facebook = "xxxx" Telegram = "xxxx" #Medium = "xxxx" @@ -180,7 +220,8 @@ unsafe = true #Thingiverse = "xxxx" #Devto = "xxxx" - [params.share] # Social Share Links in post page + # Social Share Links in post page + [params.share] enable = true Twitter = true Facebook = true @@ -193,30 +234,40 @@ unsafe = true #VKontakte = true #Weibo = true - [params.publisher] # Publisher Info just for SEO - name = "XXXX" + # Publisher Info just for SEO + [params.publisher] + name = "xxxx" [params.publisher.logo] url = "logo.png" width = 127 height = 40 - [params.logo] # Website Log Info just for SEO + # Website Log Info just for SEO + [params.logo] url = "logo.png" width = 127 height = 40 - [params.image] # Website Image Info just for SEO + # Website Image Info just for SEO + [params.image] url = "cover.png" width = 800 height = 600 - [params.gitalk] # Gittalk Comment Config (https://github.com/gitalk/gitalk) + # Disqus Comment Config (https://disqus.com/) + [params.disqus] + # Disqus shortname to use Disqus in posts + shortname = "" + + # Gittalk Comment Config (https://github.com/gitalk/gitalk) + [params.gitalk] owner = "" repo = "" clientId = "" clientSecret = "" - [params.valine] # Valine Comment Config (https://github.com/xCss/Valine) + # Valine Comment Config (https://github.com/xCss/Valine) + [params.valine] enable = false appId = "" appKey = "" @@ -227,30 +278,35 @@ unsafe = true visitor = true recordIP = true - [params.facebook] # Facebook Comment Config (https://developers.facebook.com/docs/plugins/comments) + # Facebook Comment Config (https://developers.facebook.com/docs/plugins/comments) + [params.facebook] enable = false width = "100%" numPosts = 10 appId = "" languageCode = "en_US" -[privacy] #### Privacy Info (https://gohugo.io/about/hugo-and-gdpr/) +# Privacy Info (https://gohugo.io/about/hugo-and-gdpr/) +[privacy] [privacy.googleAnalytics] anonymizeIP = true [privacy.youtube] privacyEnhanced = true -[mediaTypes] #### Options to make hugo output .md files. +# Options to make hugo output .md files. +[mediaTypes] [mediaTypes."text/plain"] suffixes = ["md"] -[outputFormats.MarkDown] #### Options to make hugo output .md files. +# Options to make hugo output .md files. +[outputFormats.MarkDown] mediaType = "text/plain" isPlainText = true isHTML = false -[outputs] #### Options to make hugo output .md files. +# Options to make hugo output files. +[outputs] home = ["HTML", "RSS"] page = ["HTML", "MarkDown"] section = ["HTML", "RSS"] diff --git a/exampleSite/content/posts/LoveIt-Preview.md b/exampleSite/content/posts/LoveIt-Preview.md index b9f215d1..f9938d61 100644 --- a/exampleSite/content/posts/LoveIt-Preview.md +++ b/exampleSite/content/posts/LoveIt-Preview.md @@ -6,13 +6,13 @@ draft: false description: "This is a LoveIt theme preview and documentation page." show_in_homepage: true show_description: false -license: '' +license: "" -tags: ['Hugo', 'Theme'] -categories: ['Documentation'] +tags: ["Hugo", "Theme"] +categories: ["Documentation"] -featured_image: '' -featured_image_preview: '' +featured_image: "" +featured_image_preview: "" comment: true toc: true diff --git a/exampleSite/content/posts/markdown-syntax.md b/exampleSite/content/posts/markdown-syntax.md new file mode 100644 index 00000000..ffb943a7 --- /dev/null +++ b/exampleSite/content/posts/markdown-syntax.md @@ -0,0 +1,169 @@ +--- +author: "Hugo Authors" +title: "Markdown Syntax Guide" +date: 2020-01-30T21:57:40+08:00 +lastmod: 2020-01-30T21:57:40+08:00 +draft: false +description: "Sample article showcasing basic Markdown syntax and formatting for HTML elements." +show_in_homepage: true +show_description: false +license: "" + +tags: [ + "markdown", + "css", + "html", + "themes", +] +categories: [ + "themes", + "syntax", +] + +featured_image: /images/markdown.png +featured_image_preview: "" + +comment: true +toc: true +autoCollapseToc: true +math: false +--- + +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. + + +## Headings + +The following HTML `
Test
+ + +``` + +### Code block indented with four spaces + + + + + +Test
+ + + +### Code block with Hugo's internal highlight shortcode + +{{< highlight html >}} + + + + +Test
+ + +{{< /highlight >}} + +## List Types + +### Ordered List + +1. First item +2. Second item +3. Third item + +### Unordered List + +* List item +* Another item +* And another item + +### Nested list + +* Item + 1. First Sub-item + 2. Second Sub-item + +## Other Elements — abbr, sub, sup, kbd, mark + +GIF is a bitmap image format. + +H2O + +Xn + Yn = Zn + +Press CTRL+ALT+Delete to end the session. + +Most salamanders are nocturnal, and hunt for insects, worms, +and other small creatures. + +[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. diff --git a/exampleSite/static/images/markdown.png b/exampleSite/static/images/markdown.png new file mode 100644 index 00000000..b31e1a58 Binary files /dev/null and b/exampleSite/static/images/markdown.png differ diff --git a/i18n/en.toml b/i18n/en.toml index 0653e756..48889d42 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -48,7 +48,7 @@ other = "Theme - " # === posts/single.html === [toc] -other = "Table of Contents" +other = "Contents" [publish] other = "published on" @@ -103,6 +103,9 @@ other = "return" [pageNotFound] other = "Page not found" +[pageNotFoundText] +other = "The page you're looking for doesn't exist. Sorry." + [backToHome] other = "Back to Home" # === 404.html === diff --git a/i18n/zh.toml b/i18n/zh.toml index d60b6179..71c0f36e 100644 --- a/i18n/zh.toml +++ b/i18n/zh.toml @@ -106,6 +106,9 @@ other = "返回" [pageNotFound] other = "页面没找到" +[pageNotFoundText] +other = "抱歉,您要查找的页面不存在。" + [backToHome] other = "回到主页" # === 404.html === diff --git a/layouts/404.html b/layouts/404.html index 6e101893..f49926d6 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,10 +1,16 @@ -{{ define "title" }}{{ T "pageNotFound" }} | {{ .Site.Title }}{{ end -}} +{{- define "title" }}{{ T "pageNotFound" | printf "404 %s" }} | {{ .Site.Title }}{{ end -}} -{{ define "content" }} +{{- define "content" -}}/* 404 {{ T "pageNotFound" }}. */
- ++ {{- T "pageNotFoundText" -}} +
+