diff --git a/assets/css/_core/_base.scss b/assets/css/_core/_base.scss index 6d1a264a..57b4b2b9 100644 --- a/assets/css/_core/_base.scss +++ b/assets/css/_core/_base.scss @@ -1,35 +1,37 @@ html { font-family: $global-font-family; +} - /* scrollbar, only support webkit */ - &::-webkit-scrollbar { - width: 8px; - height: 8px; - } +/* scrollbar, only support webkit */ +::-webkit-scrollbar { + width: 6px; + height: 6px; +} - &::-webkit-scrollbar-thumb { - height: 40px; - background-color: #87878D; - border-radius: 16px; +::-webkit-scrollbar-thumb { + background-color: $scrollbar-color; - &:hover { - background-color: #A9A9B3; - } + &:hover { + background-color: $scrollbar-hover-color; } } ::selection { - background: rgba(0, 149, 255, 0.1); + background: $selection-color; + + .dark-theme & { + background: $selection-color-dark; + } } body { font-size: 16px; font-weight: 400; - line-height: 26px; + line-height: 1.5rem; background-color: $global-background-color; color: $global-font-color; - &:before { + &::before { content: ""; background-repeat: no-repeat; background-position: center; diff --git a/assets/css/_core/_layout.scss b/assets/css/_core/_layout.scss index 52fb9b16..8e56844e 100644 --- a/assets/css/_core/_layout.scss +++ b/assets/css/_core/_layout.scss @@ -2,17 +2,17 @@ .wrapper { display: flex; flex-direction: column; - min-height: 98vh; + min-height: 97.5vh; width: 100%; -} -.main { - flex: 1 0 auto; -} + main { + flex: 1 0 auto; -.container { - padding-left: 1rem; - padding-right: 1rem; + .container { + padding-left: 1rem; + padding-right: 1rem; + } + } } .footer { @@ -27,4 +27,4 @@ font-size: 2rem; transform: translateY(35vh); text-align: center; -} \ No newline at end of file +} diff --git a/assets/css/_core/_media.scss b/assets/css/_core/_media.scss index ab9fd36d..1825df1f 100644 --- a/assets/css/_core/_media.scss +++ b/assets/css/_core/_media.scss @@ -1,5 +1,5 @@ @media only screen and (max-width: 1800px) { - .warpper { + .page { max-width: 780px; .post-toc { @@ -10,7 +10,7 @@ } @media only screen and (max-width: 1440px) { - .warpper { + .page { max-width: 680px; .post-toc { @@ -21,7 +21,7 @@ } @media only screen and (max-width: 1200px) { - .warpper { + .page { max-width: 560px; .post-toc { @@ -38,7 +38,7 @@ } } - .warpper { + .page { max-width: 80%; .post-toc { @@ -60,7 +60,7 @@ display: block; } - .warpper { + .page { max-width: 100%; .categories-card { diff --git a/assets/css/_page/_index.scss b/assets/css/_page/_index.scss index 568d9fd1..ce3a8a7c 100644 --- a/assets/css/_page/_index.scss +++ b/assets/css/_page/_index.scss @@ -1,6 +1,6 @@ @import "_home"; -.warpper { +.page { position: relative; width: 100%; max-width: 980px; diff --git a/assets/css/_page/_post.scss b/assets/css/_page/_post.scss index da722a6e..f2a23fce 100644 --- a/assets/css/_page/_post.scss +++ b/assets/css/_page/_post.scss @@ -138,6 +138,14 @@ .table-wrapper { overflow-x: auto; + &::-webkit-scrollbar { + background-color: $table-background-color; + + .dark-theme & { + background-color: $table-background-color-dark; + } + } + > table { width: 100%; max-width: 100%; diff --git a/assets/css/_partial/_post/_code.scss b/assets/css/_partial/_post/_code.scss index 6be97951..661e3f0b 100644 --- a/assets/css/_partial/_post/_code.scss +++ b/assets/css/_partial/_post/_code.scss @@ -1,19 +1,9 @@ code, pre { - padding: 7px; font-size: $code-font-size; font-family: $code-font-family; - background: $code-background-color; - - .dark-theme & { - background: $code-background-color-dark; - } -} - -code { - padding: 3px 5px; - border-radius: 4px; color: $code-color; + padding: 5px; background: $code-background-color; .dark-theme & { @@ -22,50 +12,46 @@ code { } } -p > code { - background: darken($code-background-color, 3%); - - .dark-theme & { - color: $code-color-dark; - background: darken($code-background-color-dark, 3%); - } +.highlight > pre.chroma { + padding: 38px 7px 8px; + overflow-x: auto; } -// chroma .highlight > .chroma { margin: 1em 0; - border-radius: 6px; - overflow-x: auto; position: relative; - background: $code-background-color; + font-family: $code-font-family; code { padding: 0; } - table { - position: relative; + pre { + margin: 0; + padding: 38px 7px 8px; + overflow-x: visible; + } - &::after { - position: absolute; - top: 0; - right: 0; - left: 0; - padding: 2px 7px; - font-size: $code-font-size; - font-weight: bold; - color: darken($code-info-color, 10%); - background: darken($code-background-color, 3%); - content: 'Code'; + &::after { + position: absolute; + top: 0; + right: 0; + left: 0; + padding: 2px 7px; + font-size: $code-font-size; + font-weight: bold; + color: $code-info-color; + background: darken($code-background-color, 3%); + content: 'Code'; - .dark-theme & { - background: darken($code-background-color-dark, 3%); - } + .dark-theme & { + color: $code-info-color-dark; + background: darken($code-background-color-dark, 3%); } } @each $sign, $text in $code-type-list { - &.#{$sign} table::after { + &.#{$sign}::after { content: $text; } } @@ -77,20 +63,10 @@ p > code { &:first-child { width: 10px; - - pre { - margin: 0; - padding: 38px 7px 8px; - } } &:last-child { vertical-align: top; - - pre { - margin: 0; - padding: 38px 10px 8px; - } } } @@ -106,10 +82,14 @@ p > code { } } - /* LineNumbersTable */ .lnt { color: $code-info-color; } - /* LineHighlight */ .hl { + /* LineNumbersTable */ + .lnt { + color: $code-info-color; + } + + /* LineHighlight */ + .hl { display: block; - width: 100%; background-color: darken($code-background-color, 5%); .dark-theme & { diff --git a/assets/css/_variables.scss b/assets/css/_variables.scss index ac180f73..b1c76b60 100644 --- a/assets/css/_variables.scss +++ b/assets/css/_variables.scss @@ -11,7 +11,7 @@ $global-font-family: Lato, -apple-system, BlinkMacSystemFont, PingFang-SC-Regula $global-background-color: #fff !default; $global-background-color-dark: #292a2d !default; -$navbar-background-color: #FAFAFA !default; +$navbar-background-color: #fafafa !default; $navbar-background-color-dark: #252627 !default; // Text color of the body. @@ -29,6 +29,12 @@ $global-link-hover-color-dark: #fff !default; $global-border-color: #dcdcdc !default; $global-border-color-dark: #4a4b50 !default; +$scrollbar-color: #87878d !default; +$scrollbar-hover-color: #a9a9b3 !default; + +$selection-color: rgba(38, 139, 211, 0.2) !default; +$selection-color-dark: rgba(38, 139, 211, 0.3) !default; + $navbar-hover-color: #161209 !default; $navbar-hover-color-dark: #fff !default; @@ -47,7 +53,7 @@ $table-background-color: #fff !default; $table-background-color-dark: #272c34 !default; // Color of the table thead. -$table-thead-color: #EDEDED !default; +$table-thead-color: #ededed !default; $table-thead-color-dark: #20252b !default; // ========== Code ========== // @@ -59,13 +65,16 @@ $code-color-dark: #E5BF78 !default; $code-background-color: #f5f5f5 !default; $code-background-color-dark: #272C34 !default; -$code-info-color: #cacaca !default; +$code-info-color: #b1b0b0 !default; +$code-info-color-dark: #b1b0b0 !default; // Font size of code. $code-font-size: 13px !default; +@import url('https://fonts.googleapis.com/css?family=Fira+Mono:400,700&display=swap&subset=latin-ext'); + // Font family of the code. -$code-font-family: Source Code Pro, Consolas, Liberation Mono, Menlo, Courier, monospace !default; +$code-font-family: Fira Mono, Source Code Pro, Menlo, monospace !default; // Code type list. $code-type-list: ( diff --git a/assets/css/style.scss b/assets/css/style.scss index d3f4d0a8..99701cd0 100644 --- a/assets/css/style.scss +++ b/assets/css/style.scss @@ -1,4 +1,5 @@ @import "_variables"; +@import "_custom"; @import "_core/normalize"; @import "_core/base"; @@ -11,5 +12,3 @@ @import "_partial/pagination"; @import "_core/media"; - -@import "_custom"; diff --git a/exampleSite/content/posts/LoveIt-Preview.md b/exampleSite/content/posts/LoveIt-Preview.md deleted file mode 100644 index 30d44aca..00000000 --- a/exampleSite/content/posts/LoveIt-Preview.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: "LoveIt Theme Preview and Documentation" -date: 2019-08-25T16:22:42+08:00 -lastmod: 2019-08-25T16:22:42+08:00 -draft: false -description: "This is a LoveIt theme preview and documentation page." -show_in_homepage: true -show_description: false -license: "" - -tags: ["Hugo", "Theme"] -categories: ["Documentation"] - -featured_image: "" -featured_image_preview: "" - -comment: true -toc: true -auto_collapse_toc: true -math: true ---- - -This is a [LoveIt](https://github.com/dillonzq/LoveIt) theme preview and documentation page. - - \ No newline at end of file diff --git a/exampleSite/content/posts/emoji-support.md b/exampleSite/content/posts/emoji-support.md new file mode 100644 index 00000000..008871b7 --- /dev/null +++ b/exampleSite/content/posts/emoji-support.md @@ -0,0 +1,66 @@ +--- +author: "Hugo Authors" +author_link: "https://gohugo.io/" +title: "Emoji Support" +date: 2019-10-01T17:55:28+08:00 +lastmod: 2019-10-01T17:55:28+08:00 +draft: false +description: "Guide to emoji usage in Hugo" +show_in_homepage: true +show_description: false +license: "" + +tags: [ + "emoji", +] +categories: [ + "theme", +] + +featured_image: /images/emoji.jpg +featured_image_preview: "" + +comment: true +toc: false +auto_collapse_toc: true +math: false +--- + +Emoji can be enabled in a Hugo project in a number of ways. + + + +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). + +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. + +

πŸ™ˆ :see_no_evil: πŸ™‰ :hear_no_evil: πŸ™Š :speak_no_evil:

+
+ +The [Emoji cheat sheet](http://www.emoji-cheat-sheet.com/) is a useful reference for emoji shorthand codes. + +*** + +**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. + +{{< highlight html >}} +.emoji { + font-family: Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols; +} +{{< /highlight >}} + +{{< css.inline >}} + +{{< /css.inline >}} diff --git a/exampleSite/content/posts/markdown-syntax.md b/exampleSite/content/posts/markdown-syntax.md index 5724066c..45025764 100644 --- a/exampleSite/content/posts/markdown-syntax.md +++ b/exampleSite/content/posts/markdown-syntax.md @@ -2,8 +2,8 @@ author: "Hugo Authors" author_link: "https://gohugo.io/" title: "Markdown Syntax Guide" -date: 2020-01-30T21:57:40+08:00 -lastmod: 2020-01-30T21:57:40+08:00 +date: 2019-12-01T21:57:40+08:00 +lastmod: 2020-01-01T16:45:40+08:00 draft: false description: "Sample article showcasing basic Markdown syntax and formatting for HTML elements." show_in_homepage: true @@ -14,10 +14,9 @@ tags: [ "markdown", "css", "html", - "themes", ] categories: [ - "themes", + "theme", ] featured_image: /images/markdown.png @@ -26,7 +25,7 @@ featured_image_preview: "" comment: true toc: true auto_collapse_toc: true -math: false +math: true --- 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. @@ -73,6 +72,8 @@ in-line changes such as annotations and abbreviations. > Don't communicate by sharing memory, share memory by communicating.

> β€” Rob Pike[^1] +[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. + ## Tables Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box. @@ -88,11 +89,15 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou | ---------- | --------- | ----------------- | ---------- | | *italics* | **bold** | ~~strikethrough~~    | `code` | -## Code Blocks +## Code + +### Inline code + +Inline code: `print` ### Code block with backticks -```html +```html {hl_lines=["8-9"],linenostart=10} @@ -120,7 +125,7 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou ### Code block with Hugo's internal highlight shortcode -{{< highlight html >}} +{{< highlight html "linenos=false" >}} @@ -155,15 +160,35 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou ## Other Elements β€” abbr, sub, sup, kbd, mark -GIF is a bitmap image format. +* `abbr` -H2O + GIF is a bitmap image format. -Xn + Yn = Zn +* Or ruby annotation -Press CTRL+ALT+Delete to end the session. + [GIF]^(Graphics Interchange Format) is a bitmap image format. -Most salamanders are nocturnal, and hunt for insects, worms, -and other small creatures. +* `sub`/`sup` -[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. + H2O + + Xn + Yn = Zn + +* Or `LaTex` formula + + * Block + + $$ H_2O $$ + + $$ X^n+Y^n=Z^n $$ + + * Inline: \\( H_2O \\) \\( X^n+Y^n=Z^n \\) + +* `kbd` + + Press CTRL+ALT+Delete to end the session. + +* `mark` + + Most salamanders are nocturnal, and hunt for insects, worms, + and other small creatures. diff --git a/exampleSite/content/posts/placeholder-text.md b/exampleSite/content/posts/placeholder-text.md new file mode 100644 index 00000000..059273c0 --- /dev/null +++ b/exampleSite/content/posts/placeholder-text.md @@ -0,0 +1,76 @@ +--- +author: "Hugo Authors" +author_link: "https://gohugo.io/" +title: "Placeholder Text" +date: 2019-08-01T18:02:41+08:00 +lastmod: 2019-08-01T18:02:41+08:00 +draft: false +description: "Lorem Ipsum Dolor Si Amet" +show_in_homepage: true +show_description: false +license: "" + +tags: [ + "markdown", + "text", +] +categories: [ + "theme", +] + +featured_image: "" +featured_image_preview: "" + +comment: true +toc: false +auto_collapse_toc: true +math: false +--- + +Lorem est tota propiore conpellat pectoribus de +pectora summo. Redit teque digerit hominumque toris verebor lumina non cervice +subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc +caluere tempus inhospita parcite confusaque translucet patri vestro qui optatis +lumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum. + +1. Exierant elisi ambit vivere dedere +2. Duce pollice +3. Eris modo +4. Spargitque ferrea quos palude + +Rursus nulli murmur; hastile inridet ut ab gravi sententia! Nomine potitus +silentia flumen, sustinet placuit petis in dilapsa erat sunt. Atria +tractus malis. + +1. Comas hunc haec pietate fetum procerum dixit +2. Post torum vates letum Tiresia +3. Flumen querellas +4. Arcanaque montibus omnes +5. Quidem et + +## Vagus elidunt + + + +[The Van de Graaf Canon](https://en.wikipedia.org/wiki/Canons_of_page_construction#Van_de_Graaf_canon) + +### Mane refeci capiebant unda mulcebat + +Victa caducifer, malo vulnere contra +dicere aurato, ludit regale, voca! Retorsit colit est profanae esse virescere +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. + +Iubar proles corpore raptos vero auctor imperium; sed et huic: manus caeli +Lelegas tu lux. Verbis obstitit intus oblectamina fixis linguisque ausus sperare +Echionides cornuaque tenent clausit possit. Omnia putatur. Praeteritae refert +ausus; ferebant e primus lora nutat, vici quae mea ipse. Et iter nil spectatae +vulnus haerentia iuste et exercebat, sui et. + +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 +Propoetides **parte**. + +{{< css.inline >}} + +{{< /css.inline >}} diff --git a/exampleSite/content/posts/rich-content.md b/exampleSite/content/posts/rich-content.md new file mode 100644 index 00000000..770b7c3e --- /dev/null +++ b/exampleSite/content/posts/rich-content.md @@ -0,0 +1,61 @@ +--- +author: "Hugo Authors" +author_link: "https://gohugo.io/" +title: "Rich Content" +date: 2019-09-01T18:06:32+08:00 +lastmod: 2019-09-01T18:06:32+08:00 +draft: false +description: "A brief description of Hugo Shortcodes" +show_in_homepage: true +show_description: false +license: "" + +tags: [ + "shortcodes", + "privacy", +] +categories: [ + "theme", +] + +featured_image: /images/hugo.png +featured_image_preview: "" + +comment: true +toc: false +auto_collapse_toc: true +math: false +--- + +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. + + +--- + +## Instagram Simple Shortcode + +{{< instagram_simple BGvuInzyFAe hidecaption >}} + +
+ +--- + +## YouTube Privacy Enhanced Shortcode + +{{< youtube ZJthWmvUzzc >}} + +
+ +--- + +## Twitter Simple Shortcode + +{{< twitter_simple 1085870671291310081 >}} + +
+ +--- + +## Vimeo Simple Shortcode + +{{< vimeo_simple 48912912 >}} diff --git a/exampleSite/static/images/emoji.jpg b/exampleSite/static/images/emoji.jpg new file mode 100644 index 00000000..5758440e Binary files /dev/null and b/exampleSite/static/images/emoji.jpg differ diff --git a/exampleSite/static/images/hugo.png b/exampleSite/static/images/hugo.png new file mode 100644 index 00000000..10265e45 Binary files /dev/null and b/exampleSite/static/images/hugo.png differ diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index cb9f027b..d3224c2e 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -6,5 +6,5 @@ target="_blank" {{ end -}} > - {{- .Text -}} + {{- .Text | safeHTML -}} \ No newline at end of file diff --git a/layouts/_default/section.html b/layouts/_default/section.html index 78a693ea..a6f7aacb 100644 --- a/layouts/_default/section.html +++ b/layouts/_default/section.html @@ -4,7 +4,7 @@ {{- define "content" -}} {{- $data := .Data -}} -
+

{{- T "all" | humanize}}{{ T .Section | default .Section | humanize -}}

diff --git a/layouts/_default/single.html b/layouts/_default/single.html index cdc44ca2..4eebf85e 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,7 +1,7 @@ {{- define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end -}} {{- define "content" -}} -
+

{{- .Title -}}

diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index c67a5dad..a5df4e51 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -28,7 +28,7 @@ {{- $name := . -}} {{- with $.Site.GetPage "taxonomy" (printf "categories/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "categories/%s" ($name | urlize))) -}} - {{ $name }} + {{ $name | humanize }} {{- end -}} {{- end -}} diff --git a/layouts/index.html b/layouts/index.html index ad261919..20bef9da 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,6 +1,6 @@ {{- define "content" -}} {{- if eq .Site.Params.home_mode "post" -}} -
+
{{- partial "home/profile.html" . -}} {{- $paginator := where .Site.RegularPages "Type" "posts" -}} diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 38fe8fb5..93799aff 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -5,7 +5,7 @@ {{- $author := .Params.author | default .Site.Author.name -}} {{- $author_link := .Params.author_link | default .Site.Author.link | default .Site.BaseURL -}} -
+

{{ .Title }}