diff --git a/themes/hugo-theme-stack/README.md b/themes/hugo-theme-stack/README.md index 121ea55..b071761 100644 --- a/themes/hugo-theme-stack/README.md +++ b/themes/hugo-theme-stack/README.md @@ -12,7 +12,7 @@ Use this template: [CaiJimmy/hugo-theme-stack-starter](https://github.com/CaiJim ## Demo -* Stater template demo: [demo.stack.jimmycai.com](https://demo.stack.jimmycai.com) +* Starter template demo: [demo.stack.jimmycai.com](https://demo.stack.jimmycai.com) * Dev build: [dev.stack.jimmycai.com](https://dev.stack.jimmycai.com) ## Documentation diff --git a/themes/hugo-theme-stack/assets/jsconfig.json b/themes/hugo-theme-stack/assets/jsconfig.json index 377218c..040177a 100644 --- a/themes/hugo-theme-stack/assets/jsconfig.json +++ b/themes/hugo-theme-stack/assets/jsconfig.json @@ -1,10 +1,12 @@ { - "compilerOptions": { - "baseUrl": ".", - "paths": { - "*": [ - "*" - ] - } - } + "compilerOptions": { + "baseUrl": ".", + "paths": { + "*": [ + "*" + ] + }, + "lib": ["es2020", "dom"], + "jsx": "preserve" + } } \ No newline at end of file diff --git a/themes/hugo-theme-stack/assets/scss/grid.scss b/themes/hugo-theme-stack/assets/scss/grid.scss index 84967ef..9284da9 100644 --- a/themes/hugo-theme-stack/assets/scss/grid.scss +++ b/themes/hugo-theme-stack/assets/scss/grid.scss @@ -3,10 +3,12 @@ margin-right: auto; .left-sidebar { + order: -3; max-width: var(--left-sidebar-max-width); } .right-sidebar { + order: -1; max-width: var(--right-sidebar-max-width); /// Display right sidebar when min-width: lg @@ -73,6 +75,7 @@ } main.main { + order: -2; min-width: 0; max-width: 100%; flex-grow: 1; diff --git a/themes/hugo-theme-stack/assets/scss/partials/article.scss b/themes/hugo-theme-stack/assets/scss/partials/article.scss index f085ff0..e2c05a4 100644 --- a/themes/hugo-theme-stack/assets/scss/partials/article.scss +++ b/themes/hugo-theme-stack/assets/scss/partials/article.scss @@ -54,6 +54,7 @@ } .article-title { + font-family: var(--article-font-family); font-weight: 600; margin: 0; color: var(--card-text-color-main); @@ -92,16 +93,15 @@ .article-time, .article-translations { display: flex; - align-items: center; color: var(--card-text-color-tertiary); gap: 15px; - flex-wrap: wrap; svg { vertical-align: middle; width: 20px; height: 20px; stroke-width: 1.33; + flex-shrink: 0; } time, @@ -117,6 +117,16 @@ } } +.article-time { + flex-wrap: wrap; +} + +.article-translations { + & > div { + flex-wrap: wrap; + } +} + .article-category, .article-tags { display: flex; diff --git a/themes/hugo-theme-stack/assets/scss/partials/highlight/common.scss b/themes/hugo-theme-stack/assets/scss/partials/highlight/common.scss new file mode 100644 index 0000000..c680fa4 --- /dev/null +++ b/themes/hugo-theme-stack/assets/scss/partials/highlight/common.scss @@ -0,0 +1,428 @@ +/* Background */ +.chroma { + color: $color; + background-color: $background-color; +} + +/* Other */ +.chroma .x { +} + +/* Error */ +.chroma .err { + color: $error-color; +} + +/* LineTableTD */ +.chroma .lntd { + vertical-align: top; + padding: 0; + margin: 0; + border: 0; +} + +/* LineTable */ +.chroma .lntable { + border-spacing: 0; + padding: 0; + margin: 0; + border: 0; + width: 100%; + display: block; + + > tbody { + display: block; + width: 100%; + > tr { + display: flex; + width: 100%; + > td:last-child { + overflow-x: auto; + } + } + } +} + +/* LineHighlight */ +.chroma .hl { + display: block; + width: 100%; + background-color: #ffffcc; +} + +/* LineNumbersTable */ +.chroma .lnt { + margin-right: 0.4em; + padding: 0 0.4em 0 0.4em; + color: #7f7f7f; + display: block; +} + +/* LineNumbers */ +.chroma .ln { + margin-right: 0.4em; + padding: 0 0.4em 0 0.4em; + color: #7f7f7f; +} + +/* Keyword */ +.chroma .k { + color: $keyword-color; +} + +/* KeywordConstant */ +.chroma .kc { + color: $keyword-color; +} + +/* KeywordDeclaration */ +.chroma .kd { + color: $keyword-color; +} + +/* KeywordNamespace */ +.chroma .kn { + color: #f92672; +} + +/* KeywordPseudo */ +.chroma .kp { + color: $keyword-color; +} + +/* KeywordReserved */ +.chroma .kr { + color: $keyword-color; +} + +/* KeywordType */ +.chroma .kt { + color: $keyword-color; +} + +/* Name */ +.chroma .n { + color: $text-color; +} + +/* NameAttribute */ +.chroma .na { + color: $name-color; +} + +/* NameBuiltin */ +.chroma .nb { + color: $text-color; +} + +/* NameBuiltinPseudo */ +.chroma .bp { + color: $text-color; +} + +/* NameClass */ +.chroma .nc { + color: $name-color; +} + +/* NameConstant */ +.chroma .no { + color: $keyword-color; +} + +/* NameDecorator */ +.chroma .nd { + color: $name-color; +} + +/* NameEntity */ +.chroma .ni { + color: $text-color; +} + +/* NameException */ +.chroma .ne { + color: $name-color; +} + +/* NameFunction */ +.chroma .nf { + color: $name-color; +} + +/* NameFunctionMagic */ +.chroma .fm { + color: $text-color; +} + +/* NameLabel */ +.chroma .nl { + color: $text-color; +} + +/* NameNamespace */ +.chroma .nn { + color: $text-color; +} + +/* NameOther */ +.chroma .nx { + color: $name-color; +} + +/* NameProperty */ +.chroma .py { + color: $text-color; +} + +/* NameTag */ +.chroma .nt { + color: #f92672; +} + +/* NameVariable */ +.chroma .nv { + color: $text-color; +} + +/* NameVariableClass */ +.chroma .vc { + color: $text-color; +} + +/* NameVariableGlobal */ +.chroma .vg { + color: $text-color; +} + +/* NameVariableInstance */ +.chroma .vi { + color: $text-color; +} + +/* NameVariableMagic */ +.chroma .vm { + color: $text-color; +} + +/* Literal */ +.chroma .l { + color: #ae81ff; +} + +/* LiteralDate */ +.chroma .ld { + color: $literal-color; +} + +/* LiteralString */ +.chroma .s { + color: $literal-color; +} + +/* LiteralStringAffix */ +.chroma .sa { + color: $literal-color; +} + +/* LiteralStringBacktick */ +.chroma .sb { + color: $literal-color; +} + +/* LiteralStringChar */ +.chroma .sc { + color: $literal-color; +} + +/* LiteralStringDelimiter */ +.chroma .dl { + color: $literal-color; +} + +/* LiteralStringDoc */ +.chroma .sd { + color: $literal-color; +} + +/* LiteralStringDouble */ +.chroma .s2 { + color: $literal-color; +} + +/* LiteralStringEscape */ +.chroma .se { + color: #ae81ff; +} + +/* LiteralStringHeredoc */ +.chroma .sh { + color: $literal-color; +} + +/* LiteralStringInterpol */ +.chroma .si { + color: $literal-color; +} + +/* LiteralStringOther */ +.chroma .sx { + color: $literal-color; +} + +/* LiteralStringRegex */ +.chroma .sr { + color: $literal-color; +} + +/* LiteralStringSingle */ +.chroma .s1 { + color: $literal-color; +} + +/* LiteralStringSymbol */ +.chroma .ss { + color: $literal-color; +} + +/* LiteralNumber */ +.chroma .m { + color: #ae81ff; +} + +/* LiteralNumberBin */ +.chroma .mb { + color: #ae81ff; +} + +/* LiteralNumberFloat */ +.chroma .mf { + color: #ae81ff; +} + +/* LiteralNumberHex */ +.chroma .mh { + color: #ae81ff; +} + +/* LiteralNumberInteger */ +.chroma .mi { + color: #ae81ff; +} + +/* LiteralNumberIntegerLong */ +.chroma .il { + color: #ae81ff; +} + +/* LiteralNumberOct */ +.chroma .mo { + color: #ae81ff; +} + +/* Operator */ +.chroma .o { + color: #f92672; +} + +/* OperatorWord */ +.chroma .ow { + color: #f92672; +} + +/* Punctuation */ +.chroma .p { + color: $text-color; +} + +/* Comment */ +.chroma .c { + color: #75715e; +} + +/* CommentHashbang */ +.chroma .ch { + color: #75715e; +} + +/* CommentMultiline */ +.chroma .cm { + color: #75715e; +} + +/* CommentSingle */ +.chroma .c1 { + color: #75715e; +} + +/* CommentSpecial */ +.chroma .cs { + color: #75715e; +} + +/* CommentPreproc */ +.chroma .cp { + color: #75715e; +} + +/* CommentPreprocFile */ +.chroma .cpf { + color: #75715e; +} + +/* Generic */ +.chroma .g { +} + +/* GenericDeleted */ +.chroma .gd { + color: #f92672; +} + +/* GenericEmph */ +.chroma .ge { + font-style: italic; +} + +/* GenericError */ +.chroma .gr { +} + +/* GenericHeading */ +.chroma .gh { +} + +/* GenericInserted */ +.chroma .gi { + color: $name-color; +} + +/* GenericOutput */ +.chroma .go { +} + +/* GenericPrompt */ +.chroma .gp { +} + +/* GenericStrong */ +.chroma .gs { + font-weight: bold; +} + +/* GenericSubheading */ +.chroma .gu { + color: #75715e; +} + +/* GenericTraceback */ +.chroma .gt { +} + +/* GenericUnderline */ +.chroma .gl { +} + +/* TextWhitespace */ +.chroma .w { +} diff --git a/themes/hugo-theme-stack/assets/scss/partials/highlight/dark.scss b/themes/hugo-theme-stack/assets/scss/partials/highlight/dark.scss index 2c13946..0d3f330 100644 --- a/themes/hugo-theme-stack/assets/scss/partials/highlight/dark.scss +++ b/themes/hugo-theme-stack/assets/scss/partials/highlight/dark.scss @@ -3,382 +3,12 @@ * https://xyproto.github.io/splash/docs/monokai.html */ -/* Background */ -.chroma { - color: #f8f8f2; - background-color: #272822 -} - -/* Other */ -.chroma .x {} - -/* Error */ -.chroma .err { - color: #bb0064; -} - -/* LineTableTD */ -.chroma .lntd { - vertical-align: top; - padding: 0; - margin: 0; - border: 0; -} - -/* LineTable */ -.chroma .lntable { - border-spacing: 0; - padding: 0; - margin: 0; - border: 0; - width: auto; - overflow: auto; - display: block; -} - -/* LineHighlight */ -.chroma .hl { - display: block; - width: 100%; - background-color: #ffffcc -} - -/* LineNumbersTable */ -.chroma .lnt { - margin-right: 0.4em; - padding: 0 0.4em 0 0.4em; - color: #7f7f7f -} - -/* LineNumbers */ -.chroma .ln { - margin-right: 0.4em; - padding: 0 0.4em 0 0.4em; - color: #7f7f7f -} - -/* Keyword */ -.chroma .k { - color: #66d9ef -} - -/* KeywordConstant */ -.chroma .kc { - color: #66d9ef -} - -/* KeywordDeclaration */ -.chroma .kd { - color: #66d9ef -} - -/* KeywordNamespace */ -.chroma .kn { - color: #f92672 -} - -/* KeywordPseudo */ -.chroma .kp { - color: #66d9ef -} - -/* KeywordReserved */ -.chroma .kr { - color: #66d9ef -} - -/* KeywordType */ -.chroma .kt { - color: #66d9ef -} - -/* Name */ -.chroma .n {} - -/* NameAttribute */ -.chroma .na { - color: #a6e22e -} - -/* NameBuiltin */ -.chroma .nb {} - -/* NameBuiltinPseudo */ -.chroma .bp {} - -/* NameClass */ -.chroma .nc { - color: #a6e22e -} - -/* NameConstant */ -.chroma .no { - color: #66d9ef -} - -/* NameDecorator */ -.chroma .nd { - color: #a6e22e -} - -/* NameEntity */ -.chroma .ni {} - -/* NameException */ -.chroma .ne { - color: #a6e22e -} - -/* NameFunction */ -.chroma .nf { - color: #a6e22e -} - -/* NameFunctionMagic */ -.chroma .fm {} - -/* NameLabel */ -.chroma .nl {} - -/* NameNamespace */ -.chroma .nn {} - -/* NameOther */ -.chroma .nx { - color: #a6e22e -} - -/* NameProperty */ -.chroma .py {} - -/* NameTag */ -.chroma .nt { - color: #f92672 -} - -/* NameVariable */ -.chroma .nv {} - -/* NameVariableClass */ -.chroma .vc {} - -/* NameVariableGlobal */ -.chroma .vg {} - -/* NameVariableInstance */ -.chroma .vi {} - -/* NameVariableMagic */ -.chroma .vm {} - -/* Literal */ -.chroma .l { - color: #ae81ff -} - -/* LiteralDate */ -.chroma .ld { - color: #e6db74 -} - -/* LiteralString */ -.chroma .s { - color: #e6db74 -} - -/* LiteralStringAffix */ -.chroma .sa { - color: #e6db74 -} - -/* LiteralStringBacktick */ -.chroma .sb { - color: #e6db74 -} - -/* LiteralStringChar */ -.chroma .sc { - color: #e6db74 -} - -/* LiteralStringDelimiter */ -.chroma .dl { - color: #e6db74 -} - -/* LiteralStringDoc */ -.chroma .sd { - color: #e6db74 -} - -/* LiteralStringDouble */ -.chroma .s2 { - color: #e6db74 -} - -/* LiteralStringEscape */ -.chroma .se { - color: #ae81ff -} - -/* LiteralStringHeredoc */ -.chroma .sh { - color: #e6db74 -} - -/* LiteralStringInterpol */ -.chroma .si { - color: #e6db74 -} - -/* LiteralStringOther */ -.chroma .sx { - color: #e6db74 -} - -/* LiteralStringRegex */ -.chroma .sr { - color: #e6db74 -} - -/* LiteralStringSingle */ -.chroma .s1 { - color: #e6db74 -} - -/* LiteralStringSymbol */ -.chroma .ss { - color: #e6db74 -} - -/* LiteralNumber */ -.chroma .m { - color: #ae81ff -} - -/* LiteralNumberBin */ -.chroma .mb { - color: #ae81ff -} - -/* LiteralNumberFloat */ -.chroma .mf { - color: #ae81ff -} - -/* LiteralNumberHex */ -.chroma .mh { - color: #ae81ff -} - -/* LiteralNumberInteger */ -.chroma .mi { - color: #ae81ff -} - -/* LiteralNumberIntegerLong */ -.chroma .il { - color: #ae81ff -} - -/* LiteralNumberOct */ -.chroma .mo { - color: #ae81ff -} - -/* Operator */ -.chroma .o { - color: #f92672 -} - -/* OperatorWord */ -.chroma .ow { - color: #f92672 -} - -/* Punctuation */ -.chroma .p {} - -/* Comment */ -.chroma .c { - color: #75715e -} - -/* CommentHashbang */ -.chroma .ch { - color: #75715e -} - -/* CommentMultiline */ -.chroma .cm { - color: #75715e -} - -/* CommentSingle */ -.chroma .c1 { - color: #75715e -} - -/* CommentSpecial */ -.chroma .cs { - color: #75715e -} - -/* CommentPreproc */ -.chroma .cp { - color: #75715e -} - -/* CommentPreprocFile */ -.chroma .cpf { - color: #75715e -} - -/* Generic */ -.chroma .g {} - -/* GenericDeleted */ -.chroma .gd { - color: #f92672 -} - -/* GenericEmph */ -.chroma .ge { - font-style: italic -} - -/* GenericError */ -.chroma .gr {} - -/* GenericHeading */ -.chroma .gh {} - -/* GenericInserted */ -.chroma .gi { - color: #a6e22e -} - -/* GenericOutput */ -.chroma .go {} - -/* GenericPrompt */ -.chroma .gp {} - -/* GenericStrong */ -.chroma .gs { - font-weight: bold -} - -/* GenericSubheading */ -.chroma .gu { - color: #75715e -} - -/* GenericTraceback */ -.chroma .gt {} - -/* GenericUnderline */ -.chroma .gl {} - -/* TextWhitespace */ -.chroma .w {} \ No newline at end of file +$color: #f8f8f2; +$background-color: #272822; +$error-color: #bb0064; +$keyword-color: #66d9ef; +$text-color: $color; +$name-color: #a6e22e; +$literal-color: #e6db74; + +@import "common.scss"; diff --git a/themes/hugo-theme-stack/assets/scss/partials/highlight/light.scss b/themes/hugo-theme-stack/assets/scss/partials/highlight/light.scss index 1798218..174b649 100644 --- a/themes/hugo-theme-stack/assets/scss/partials/highlight/light.scss +++ b/themes/hugo-theme-stack/assets/scss/partials/highlight/light.scss @@ -3,407 +3,12 @@ * https://xyproto.github.io/splash/docs/monokailight.html */ -/* Background */ -.chroma { - color: #272822; - background-color: #fafafa; -} - -/* Other */ -.chroma .x { -} - -/* Error */ -.chroma .err { - color: #960050; -} - -/* LineTableTD */ -.chroma .lntd { - vertical-align: top; - padding: 0; - margin: 0; - border: 0; -} - -/* LineTable */ -.chroma .lntable { - border-spacing: 0; - padding: 0; - margin: 0; - border: 0; - width: auto; - overflow: auto; - display: block; -} - -/* LineHighlight */ -.chroma .hl { - display: block; - width: 100%; - background-color: #ffffcc; -} - -/* LineNumbersTable */ -.chroma .lnt { - margin-right: 0.4em; - padding: 0 0.4em 0 0.4em; - color: #7f7f7f; -} - -/* LineNumbers */ -.chroma .ln { - margin-right: 0.4em; - padding: 0 0.4em 0 0.4em; - color: #7f7f7f; -} - -/* Keyword */ -.chroma .k { - color: #00a8c8; -} - -/* KeywordConstant */ -.chroma .kc { - color: #00a8c8; -} - -/* KeywordDeclaration */ -.chroma .kd { - color: #00a8c8; -} - -/* KeywordNamespace */ -.chroma .kn { - color: #f92672; -} - -/* KeywordPseudo */ -.chroma .kp { - color: #00a8c8; -} - -/* KeywordReserved */ -.chroma .kr { - color: #00a8c8; -} - -/* KeywordType */ -.chroma .kt { - color: #00a8c8; -} - -/* Name */ -.chroma .n { - color: #111111; -} - -/* NameAttribute */ -.chroma .na { - color: #75af00; -} - -/* NameBuiltin */ -.chroma .nb { - color: #111111; -} - -/* NameBuiltinPseudo */ -.chroma .bp { - color: #111111; -} - -/* NameClass */ -.chroma .nc { - color: #75af00; -} - -/* NameConstant */ -.chroma .no { - color: #00a8c8; -} - -/* NameDecorator */ -.chroma .nd { - color: #75af00; -} - -/* NameEntity */ -.chroma .ni { - color: #111111; -} - -/* NameException */ -.chroma .ne { - color: #75af00; -} - -/* NameFunction */ -.chroma .nf { - color: #75af00; -} - -/* NameFunctionMagic */ -.chroma .fm { - color: #111111; -} - -/* NameLabel */ -.chroma .nl { - color: #111111; -} - -/* NameNamespace */ -.chroma .nn { - color: #111111; -} - -/* NameOther */ -.chroma .nx { - color: #75af00; -} - -/* NameProperty */ -.chroma .py { - color: #111111; -} - -/* NameTag */ -.chroma .nt { - color: #f92672; -} - -/* NameVariable */ -.chroma .nv { - color: #111111; -} - -/* NameVariableClass */ -.chroma .vc { - color: #111111; -} - -/* NameVariableGlobal */ -.chroma .vg { - color: #111111; -} - -/* NameVariableInstance */ -.chroma .vi { - color: #111111; -} - -/* NameVariableMagic */ -.chroma .vm { - color: #111111; -} - -/* Literal */ -.chroma .l { - color: #ae81ff; -} - -/* LiteralDate */ -.chroma .ld { - color: #d88200; -} - -/* LiteralString */ -.chroma .s { - color: #d88200; -} - -/* LiteralStringAffix */ -.chroma .sa { - color: #d88200; -} - -/* LiteralStringBacktick */ -.chroma .sb { - color: #d88200; -} - -/* LiteralStringChar */ -.chroma .sc { - color: #d88200; -} - -/* LiteralStringDelimiter */ -.chroma .dl { - color: #d88200; -} - -/* LiteralStringDoc */ -.chroma .sd { - color: #d88200; -} - -/* LiteralStringDouble */ -.chroma .s2 { - color: #d88200; -} - -/* LiteralStringEscape */ -.chroma .se { - color: #8045ff; -} - -/* LiteralStringHeredoc */ -.chroma .sh { - color: #d88200; -} - -/* LiteralStringInterpol */ -.chroma .si { - color: #d88200; -} - -/* LiteralStringOther */ -.chroma .sx { - color: #d88200; -} - -/* LiteralStringRegex */ -.chroma .sr { - color: #d88200; -} - -/* LiteralStringSingle */ -.chroma .s1 { - color: #d88200; -} - -/* LiteralStringSymbol */ -.chroma .ss { - color: #d88200; -} - -/* LiteralNumber */ -.chroma .m { - color: #ae81ff; -} - -/* LiteralNumberBin */ -.chroma .mb { - color: #ae81ff; -} - -/* LiteralNumberFloat */ -.chroma .mf { - color: #ae81ff; -} - -/* LiteralNumberHex */ -.chroma .mh { - color: #ae81ff; -} - -/* LiteralNumberInteger */ -.chroma .mi { - color: #ae81ff; -} - -/* LiteralNumberIntegerLong */ -.chroma .il { - color: #ae81ff; -} - -/* LiteralNumberOct */ -.chroma .mo { - color: #ae81ff; -} - -/* Operator */ -.chroma .o { - color: #f92672; -} - -/* OperatorWord */ -.chroma .ow { - color: #f92672; -} - -/* Punctuation */ -.chroma .p { - color: #111111; -} - -/* Comment */ -.chroma .c { - color: #75715e; -} - -/* CommentHashbang */ -.chroma .ch { - color: #75715e; -} - -/* CommentMultiline */ -.chroma .cm { - color: #75715e; -} - -/* CommentSingle */ -.chroma .c1 { - color: #75715e; -} - -/* CommentSpecial */ -.chroma .cs { - color: #75715e; -} - -/* CommentPreproc */ -.chroma .cp { - color: #75715e; -} - -/* CommentPreprocFile */ -.chroma .cpf { - color: #75715e; -} - -/* Generic */ -.chroma .g { -} -/* GenericDeleted */ -.chroma .gd { - color: #f92672; -} -/* GenericEmph */ -.chroma .ge { - font-style: italic; -} -/* GenericError */ -.chroma .gr { -} -/* GenericHeading */ -.chroma .gh { -} -/* GenericInserted */ -.chroma .gi { - color: #7ca727; -} -/* GenericOutput */ -.chroma .go { -} -/* GenericPrompt */ -.chroma .gp { -} -/* GenericStrong */ -.chroma .gs { - font-weight: bold; -} -/* GenericSubheading */ -.chroma .gu { - color: #75715e; -} -/* GenericTraceback */ -.chroma .gt { -} -/* GenericUnderline */ -.chroma .gl { -} -/* TextWhitespace */ -.chroma .w { -} +$color: #272822; +$background-color: #fafafa; +$error-color: #960050; +$keyword-color: #00a8c8; +$text-color: #111111; +$name-color: #75af00; +$literal-color: #d88200; + +@import "common.scss"; diff --git a/themes/hugo-theme-stack/assets/scss/partials/layout/article.scss b/themes/hugo-theme-stack/assets/scss/partials/layout/article.scss index 6199118..2a61423 100644 --- a/themes/hugo-theme-stack/assets/scss/partials/layout/article.scss +++ b/themes/hugo-theme-stack/assets/scss/partials/layout/article.scss @@ -33,6 +33,10 @@ margin: var(--card-padding) 0; color: var(--card-text-color-main); + .footnotes { + font-family: var(--base-font-family); + } + img { max-width: 100%; height: auto; @@ -218,6 +222,28 @@ margin-inline-start: calc((var(--card-padding)) * -1); padding-inline-start: calc(var(--card-padding) - var(--heading-border-size)); border-inline-start: var(--heading-border-size) solid var(--accent-color); + position: relative; + + a.header-anchor { + transition: opacity 0.3s ease; + opacity: 0; + position: absolute; + left: 0; + width: var(--card-padding); + text-align: center; + color: var(--accent-color); + + &:before { + content: "#"; + } + } + + &:hover, + &:focus { + a.header-anchor { + opacity: 1; + } + } } figure { @@ -264,6 +290,11 @@ font-family: var(--code-font-family); } + a, + code { + word-break: break-word; + } + .gallery { position: relative; display: flex; @@ -412,4 +443,20 @@ margin-right: calc((var(--card-padding)) * -1); width: calc(100% + var(--card-padding) * 2); } + + /// Make long KaTeX equations scrollable in the x-axis + .katex-display > .katex { + overflow-x: auto; + overflow-y: hidden; + } + + kbd { + border: 1px solid var(--kbd-border-color); + font-weight: bold; + font-size: 0.9em; + line-height: 1; + padding: 2px 4px; + border-radius: 4px; + display: inline-block; + } } diff --git a/themes/hugo-theme-stack/assets/scss/partials/menu.scss b/themes/hugo-theme-stack/assets/scss/partials/menu.scss index 4f29c9f..5b6be17 100644 --- a/themes/hugo-theme-stack/assets/scss/partials/menu.scss +++ b/themes/hugo-theme-stack/assets/scss/partials/menu.scss @@ -127,10 +127,8 @@ } /* Menu style */ -.menu { - padding-left: 0; +#main-menu { list-style: none; - flex-direction: column; overflow-y: auto; flex-grow: 1; font-size: 1.4rem; @@ -141,13 +139,15 @@ margin: 0 calc(var(--container-padding) * -1); padding: 30px 30px; + @include respond(xl) { padding: 15px 0; } - &, - .menu-bottom-section { + &, .menu-bottom-section ol { + flex-direction: column; gap: 30px; + @include respond(xl) { gap: 25px; } @@ -176,8 +176,8 @@ } svg { + stroke: currentColor; stroke-width: 1.33; - width: 20px; height: 20px; } @@ -200,17 +200,19 @@ font-weight: bold; } } - } - .menu-bottom-section { - margin-top: auto; - display: flex; - flex-direction: column; - width: 100%; + &.menu-bottom-section { + margin-top: auto; + + ol { + display: flex; + padding-left: 0; + } + } } } -.social-menu { +.menu-social { list-style: none; padding: 0; margin: 0; diff --git a/themes/hugo-theme-stack/assets/scss/partials/sidebar.scss b/themes/hugo-theme-stack/assets/scss/partials/sidebar.scss index 95310ca..a6a77c5 100644 --- a/themes/hugo-theme-stack/assets/scss/partials/sidebar.scss +++ b/themes/hugo-theme-stack/assets/scss/partials/sidebar.scss @@ -79,6 +79,7 @@ @include respond(lg) { padding-top: var(--main-top-padding); + padding-bottom: var(--main-top-padding); } } diff --git a/themes/hugo-theme-stack/assets/scss/variables.scss b/themes/hugo-theme-stack/assets/scss/variables.scss index afddb80..97810a1 100644 --- a/themes/hugo-theme-stack/assets/scss/variables.scss +++ b/themes/hugo-theme-stack/assets/scss/variables.scss @@ -16,7 +16,7 @@ $defaultTagColors: #fff, #fff, #fff, #fff, #fff; --accent-color: #34495e; --accent-color-darker: #2c3e50; --accent-color-text: #fff; - --body-text-color: #bababa; + --body-text-color: #707070; --tag-border-radius: 4px; @@ -44,7 +44,7 @@ $defaultTagColors: #fff, #fff, #fff, #fff, #fff; --zh-font-family: "PingFang SC", "Hiragino Sans GB", "Droid Sans Fallback", "Microsoft YaHei"; --base-font-family: "Lato", var(--sys-font-family), var(--zh-font-family), sans-serif; - --code-font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + --code-font-family: Menlo, Monaco, Consolas, "Courier New", var(--zh-font-family), monospace; } /* @@ -56,7 +56,7 @@ $defaultTagColors: #fff, #fff, #fff, #fff, #fff; --card-text-color-main: #000; --card-text-color-secondary: #747474; - --card-text-color-tertiary: #bababa; + --card-text-color-tertiary: #767676; --card-separator-color: rgba(218, 218, 218, 0.5); --card-border-radius: 10px; @@ -123,6 +123,8 @@ $defaultTagColors: #fff, #fff, #fff, #fff, #fff; --table-border-color: #dadada; --tr-even-background-color: #efefee; + --kbd-border-color: #dadada; + &[data-scheme="dark"] { --code-background-color: #272822; --code-text-color: rgba(255, 255, 255, 0.9); diff --git a/themes/hugo-theme-stack/assets/ts/search.tsx b/themes/hugo-theme-stack/assets/ts/search.tsx index 68db7b3..856b48d 100644 --- a/themes/hugo-theme-stack/assets/ts/search.tsx +++ b/themes/hugo-theme-stack/assets/ts/search.tsx @@ -227,6 +227,7 @@ class Search { Search.updateQueryString(keywords, true); if (keywords === '') { + lastSearch = ''; return this.clear(); } diff --git a/themes/hugo-theme-stack/assets/ts/smoothAnchors.ts b/themes/hugo-theme-stack/assets/ts/smoothAnchors.ts index 46a4a03..16ab6a3 100644 --- a/themes/hugo-theme-stack/assets/ts/smoothAnchors.ts +++ b/themes/hugo-theme-stack/assets/ts/smoothAnchors.ts @@ -21,8 +21,8 @@ function setupSmoothAnchors() { aElement.addEventListener("click", clickEvent => { clickEvent.preventDefault(); - const targetId = aElement.getAttribute("href").substring(1), - target = document.getElementById(targetId) as HTMLElement, + const targetId = decodeURI(aElement.getAttribute("href").substring(1)), + target = document.getElementById(targetId) as HTMLElement, offset = target.getBoundingClientRect().top - document.documentElement.getBoundingClientRect().top; window.history.pushState({}, "", aElement.getAttribute("href")); diff --git a/themes/hugo-theme-stack/config.yaml b/themes/hugo-theme-stack/config.yaml index 1cffc12..e6c489a 100644 --- a/themes/hugo-theme-stack/config.yaml +++ b/themes/hugo-theme-stack/config.yaml @@ -28,6 +28,7 @@ params: src: img/avatar.jpeg article: + headingAnchor: false math: false toc: true readingTime: true @@ -51,6 +52,12 @@ params: issueTerm: pathname label: + beaudar: + repo: + issueTerm: pathname + label: + theme: + remark42: host: site: @@ -64,7 +71,7 @@ params: clientSecret: autoCreateIssue: false - # Waline client configuration see: https://waline.js.org/en/reference/client.html + # Waline client configuration see: https://waline.js.org/en/reference/client/props.html waline: serverURL: lang: @@ -73,12 +80,11 @@ params: emoji: - https://cdn.jsdelivr.net/gh/walinejs/emojis/weibo requiredMeta: - - name - - email - - url - placeholder: + - nick + - mail locale: admin: Admin + placeholder: twikoo: envId: @@ -112,19 +118,8 @@ params: id: widgets: - homepage: - - type: search - - type: archives - params: - limit: 10 - - type: categories - params: - limit: 20 - - type: tag-cloud - params: - limit: 10 - page: - - type: toc + homepage: [] + page: [] opengraph: twitter: diff --git a/themes/hugo-theme-stack/data/external.yaml b/themes/hugo-theme-stack/data/external.yaml index 777620d..4fc0bca 100644 --- a/themes/hugo-theme-stack/data/external.yaml +++ b/themes/hugo-theme-stack/data/external.yaml @@ -21,17 +21,17 @@ PhotoSwipe: type: style KaTeX: - - src: https://cdn.jsdelivr.net/npm/katex@0.15.6/dist/katex.min.css - integrity: sha256-J+iAE0sgH8QSz9hpcDxXIftnj65JEZgNhGcgReTTK9s= + - src: https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css + integrity: sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV type: style - - src: https://cdn.jsdelivr.net/npm/katex@0.15.6/dist/katex.min.js - integrity: sha256-InsNdER1b2xUewP+pKCUJpkhiqwHgqiPXDlIk7GzBu4= + - src: https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js + integrity: sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8 type: script defer: true - - src: https://cdn.jsdelivr.net/npm/katex@0.15.6/dist/contrib/auto-render.min.js - integrity: sha256-y39Mpg7V3D4lhBX4x6O0bUqTV4pSrfgwEfGKfxkOdgI= + - src: https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js + integrity: sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05 type: script defer: true diff --git a/themes/hugo-theme-stack/exampleSite/README.md b/themes/hugo-theme-stack/exampleSite/README.md index 1b6d403..dbaf5e5 100644 --- a/themes/hugo-theme-stack/exampleSite/README.md +++ b/themes/hugo-theme-stack/exampleSite/README.md @@ -1 +1,3 @@ -Example site modified from https://github.com/gohugoio/hugoBasicExample \ No newline at end of file +This is an example site used for solely for testing purposes. **It is not meant to be used as a template for your site**. + +To create a new site, please use the starter template: [CaiJimmy/hugo-theme-stack-starter](https://github.com/CaiJimmy/hugo-theme-stack-starter/) \ No newline at end of file diff --git a/themes/hugo-theme-stack/exampleSite/content/page/about/index.md b/themes/hugo-theme-stack/exampleSite/content/page/about/index.md index 494cb46..68911f9 100644 --- a/themes/hugo-theme-stack/exampleSite/content/page/about/index.md +++ b/themes/hugo-theme-stack/exampleSite/content/page/about/index.md @@ -15,7 +15,7 @@ menu: icon: user --- -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. +Written in Go, Hugo is an open source static site generator available under the [Apache License 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. Hugo makes use of a variety of open source projects including: @@ -29,6 +29,6 @@ Hugo is ideal for blogs, corporate websites, creative portfolios, online magazin Hugo is for people who want to hand code their own website without worrying about setting up complicated runtimes, dependencies and databases. -Websites built with Hugo are extremelly fast, secure and can be deployed anywhere including, AWS, GitHub Pages, Heroku, Netlify and any other hosting provider. +Websites built with Hugo are extremely fast, secure and can be deployed anywhere including, AWS, GitHub Pages, Heroku, Netlify and any other hosting provider. Learn more and contribute on [GitHub](https://github.com/gohugoio). diff --git a/themes/hugo-theme-stack/exampleSite/content/post/markdown-syntax/index.md b/themes/hugo-theme-stack/exampleSite/content/post/markdown-syntax/index.md index 0254cca..c584c4c 100644 --- a/themes/hugo-theme-stack/exampleSite/content/post/markdown-syntax/index.md +++ b/themes/hugo-theme-stack/exampleSite/content/post/markdown-syntax/index.md @@ -159,7 +159,7 @@ H2O Xn + Yn = Zn -Press CTRL+ALT+Delete to end the session. +Press CTRL + ALT + Delete to end the session. Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. diff --git a/themes/hugo-theme-stack/exampleSite/content/post/math-typesetting/index.md b/themes/hugo-theme-stack/exampleSite/content/post/math-typesetting/index.md index 48fdc79..060fd7f 100644 --- a/themes/hugo-theme-stack/exampleSite/content/post/math-typesetting/index.md +++ b/themes/hugo-theme-stack/exampleSite/content/post/math-typesetting/index.md @@ -21,27 +21,23 @@ In this example we will be using [KaTeX](https://katex.org/) {{ end }} ``` -- To enable KaTex globally set the parameter `math` to `true` in a project's configuration -- To enable KaTex on a per page basis include the parameter `math: true` in content files +- To enable KaTeX globally set the parameter `math` to `true` in a project's configuration +- To enable KaTeX on a per page basis include the parameter `math: true` in content files **Note:** Use the online reference of [Supported TeX Functions](https://katex.org/docs/supported.html) {{< math.inline >}} {{ if or .Page.Params.math .Site.Params.math }} - - - + + + {{ end }} {{}} ### Examples -{{< math.inline >}} -

-Inline math: \(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\) -

-{{}} +Inline math: $\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…$ Block math: $$ diff --git a/themes/hugo-theme-stack/exampleSite/config.yaml b/themes/hugo-theme-stack/exampleSite/hugo.yaml similarity index 87% rename from themes/hugo-theme-stack/exampleSite/config.yaml rename to themes/hugo-theme-stack/exampleSite/hugo.yaml index 18b6346..a1e3829 100644 --- a/themes/hugo-theme-stack/exampleSite/config.yaml +++ b/themes/hugo-theme-stack/exampleSite/hugo.yaml @@ -1,29 +1,9 @@ baseurl: https://example.com languageCode: en-us theme: hugo-theme-stack -paginate: 5 +paginate: 3 title: Example Site - -languages: - en: - languageName: English - title: Example Site - weight: 1 - zh-cn: - languageName: 中文 - title: 演示站点 - weight: 2 - ar: - languageName: عربي - languagedirection: rtl - title: موقع تجريبي - weight: 3 - -# Change it to your Disqus shortname before using -disqusShortname: hugo-theme-stack - -# GA Tracking ID -googleAnalytics: +copyright: Example Person # Theme i18n support # Available values: ar, bn, ca, de, el, en, es, fr, hu, id, it, ja, ko, nl, pt-br, th, uk, zh-cn, zh-hk, zh-tw @@ -33,6 +13,35 @@ DefaultContentLanguage: en # This will make .Summary and .WordCount behave correctly for CJK languages. hasCJKLanguage: false +languages: + en: + languageName: English + title: Example Site + weight: 1 + params: + description: Example description + zh-cn: + languageName: 中文 + title: 演示站点 + weight: 2 + params: + description: 演示说明 + ar: + languageName: عربي + languagedirection: rtl + title: موقع تجريبي + weight: 3 + params: + description: وصف تجريبي + +services: + # Change it to your Disqus shortname before using + disqus: + shortname: "hugo-theme-stack" + # GA Tracking ID + googleAnalytics: + id: + permalinks: post: /p/:slug/ page: /:slug/ @@ -42,7 +51,7 @@ params: - post featuredImageField: image rssFullContent: true - favicon: + favicon: # e.g.: favicon placed in `static/favicon.ico` of your site folder, then set this field to `/favicon.ico` (`/` is necessary) footer: since: 2020 @@ -84,6 +93,12 @@ params: issueTerm: pathname label: + beaudar: + repo: + issueTerm: pathname + label: + theme: + remark42: host: site: @@ -188,7 +203,7 @@ params: enabled: true ### Custom menu -### See https://docs.stack.jimmycai.com/configuration/custom-menu.html +### See https://stack.jimmycai.com/config/menu ### To remove about, archive and search page menu item, remove `menu` field from their FrontMatter menu: main: [] @@ -221,7 +236,7 @@ markup: goldmark: renderer: ## Set to true if you have HTML content inside Markdown - unsafe: false + unsafe: true tableOfContents: endLevel: 4 ordered: true diff --git a/themes/hugo-theme-stack/i18n/ar.yaml b/themes/hugo-theme-stack/i18n/ar.yaml index b2970b1..63101aa 100644 --- a/themes/hugo-theme-stack/i18n/ar.yaml +++ b/themes/hugo-theme-stack/i18n/ar.yaml @@ -51,6 +51,10 @@ widget: tagCloud: title: other: وسوم + + categoriesCloud: + title: + other: التصنيفات search: title: diff --git a/themes/hugo-theme-stack/i18n/be.yaml b/themes/hugo-theme-stack/i18n/be.yaml new file mode 100644 index 0000000..605cd08 --- /dev/null +++ b/themes/hugo-theme-stack/i18n/be.yaml @@ -0,0 +1,72 @@ +toggleMenu: + other: Паказаць/схаваць меню + +darkMode: + other: Цёмны рэжым + +list: + page: + one: "{{ .Count }} старонка" + few: "{{ .Count }} старонкі" + many: "{{ .Count }} старонак" + other: "{{ .Count }} старонкі" + + section: + other: Раздзел + + subsection: + one: Падраздзел + few: Падраздзелы + many: Падраздзелы + other: Падраздзелы + +article: + back: + other: Назад + + relatedContent: + other: Таксама рэкамендуем + + lastUpdatedOn: + other: Абноўлена + + tableOfContents: + other: Змест + + readingTime: + other: "Час чытання: {{ .Count }} хв." + +notFound: + title: + other: Не знойдзена + + subtitle: + other: Запытваемая старонка не існуе + +widget: + archives: + title: + other: Архівы + more: + other: Яшчэ + + tagCloud: + title: + other: Тэгі + +search: + title: + other: Пошук + + placeholder: + other: Увядзіце нешта... + + resultTitle: + other: "Знайдзена #PAGES_COUNT старонак (за #TIME_SECONDS с.)" + +footer: + builtWith: + other: Створана пры дапамозе {{ .Generator }} + + designedBy: + other: Тэма {{ .Theme }}, дызайн {{ .DesignedBy }} diff --git a/themes/hugo-theme-stack/i18n/bn.yaml b/themes/hugo-theme-stack/i18n/bn.yaml index 0e54cb9..36f25a3 100644 --- a/themes/hugo-theme-stack/i18n/bn.yaml +++ b/themes/hugo-theme-stack/i18n/bn.yaml @@ -6,19 +6,19 @@ darkMode: list: page: - one: "{{ .Count }} পৃষ্ঠা" - other: "{{ .Count }} পৃষ্ঠা" + one: "{{ .Count }} পাতা" + other: "{{ .Count }} পাতা" section: other: অনুচ্ছেদ subsection: - one: উপঅনুচ্ছেদ - other: উপঅনুচ্ছেদ + one: উপ-অনুচ্ছেদ + other: উপ-অনুচ্ছেদ article: back: - other: পেছনে যান + other: পেছনে tableOfContents: other: সূচিপত্র @@ -27,7 +27,7 @@ article: other: সম্পর্কিত বিষয়বস্তু lastUpdatedOn: - other: শেষ হালনাগাদ করা হয়েছে + other: সর্বশেষ আপডেট করা হয়েছে readingTime: one: "{{ .Count }} মিনিটে পড়া যাবে" @@ -38,7 +38,7 @@ notFound: other: পাওয়া যায়নি subtitle: - other: এই পৃষ্ঠাটি বিদ্যমান নেই + other: এই পাতাটি বিদ্যমান নেই widget: archives: @@ -63,7 +63,7 @@ search: other: কিছু টাইপ করুন... resultTitle: - other: "#PAGES_COUNT পৃষ্ঠা (#TIME_SECONDS সেকেন্ড)" + other: "#PAGES_COUNT পাতা (#TIME_SECONDS সেকেন্ড)" footer: builtWith: diff --git a/themes/hugo-theme-stack/i18n/cs.yaml b/themes/hugo-theme-stack/i18n/cs.yaml new file mode 100644 index 0000000..7b9b519 --- /dev/null +++ b/themes/hugo-theme-stack/i18n/cs.yaml @@ -0,0 +1,73 @@ +toggleMenu: + other: Skrýt menu + +darkMode: + other: Tmavý režim + +list: + page: + one: "{{ .Count }} stránka" + other: "{{ .Count }} stránek" + + section: + other: Kategorie + + subsection: + one: Podkategorie + other: Podkategorie + +article: + back: + other: Zpět + + tableOfContents: + other: Obsah + + relatedContent: + other: Související + + lastUpdatedOn: + other: Naposledy aktualizováno + + readingTime: + one: "{{ .Count }} minuta" + other: "{{ .Count }} minut" + +notFound: + title: + other: Nenalezeno + + subtitle: + other: Tato stránka neexistuje + +widget: + archives: + title: + other: Archivy + + more: + other: Více + + tagCloud: + title: + other: Štítky + categoriesCloud: + title: + other: Kategorie + +search: + title: + other: Hledat + + placeholder: + other: Zadejte něco... + + resultTitle: + other: "#PAGES_COUNT stránek (#TIME_SECONDS sekund)" + +footer: + builtWith: + other: Vytvořeno pomocí {{ .Generator }} + + designedBy: + other: Šablona {{ .Theme }} od {{ .DesignedBy }} diff --git a/themes/hugo-theme-stack/i18n/es.yaml b/themes/hugo-theme-stack/i18n/es.yaml index 76995da..6b4b3af 100644 --- a/themes/hugo-theme-stack/i18n/es.yaml +++ b/themes/hugo-theme-stack/i18n/es.yaml @@ -1,5 +1,5 @@ toggleMenu: - other: Toggle Menu + other: Ocultar menú darkMode: other: Modo oscuro @@ -27,11 +27,11 @@ article: other: Contenidos relacionados lastUpdatedOn: - other: Última vez actualizado + other: Última actualización readingTime: - one: "{{ .Count }} minuto a leer" - other: "{{ .Count }} minutos a leer" + one: "Tiempo de lectura {{ .Count }} minuto" + other: "Tiempo de lectura {{ .Count }} minutos" notFound: title: @@ -60,7 +60,7 @@ search: other: Búsqueda placeholder: - other: Teclea algo... + other: Escribe algo... resultTitle: other: "#PAGES_COUNT páginas en (#TIME_SECONDS segundos)" diff --git a/themes/hugo-theme-stack/i18n/hi.yaml b/themes/hugo-theme-stack/i18n/hi.yaml new file mode 100644 index 0000000..27316fe --- /dev/null +++ b/themes/hugo-theme-stack/i18n/hi.yaml @@ -0,0 +1,73 @@ +toggleMenu: + other: मेनू टॉगल करें + +darkMode: + other: डार्क मोड + +list: + page: + one: "{{ .Count }} पेज" + other: "{{ .Count }} पेज" + + section: + other: अनुभाग + + subsection: + one: उपधारा + other: उपखंड + +article: + back: + other: पीछे + + tableOfContents: + other: विषयसूची + + relatedContent: + other: संबंधित सामग्री + + lastUpdatedOn: + other: अंतिम बार अपडेट किया गया + + readingTime: + one: "{{ .Count }} मिनट पढ़ें" + other: "{{ .Count }} मिनट पढ़ें" + +notFound: + title: + other: 404 नहीं मिला। + + subtitle: + other: यह पृष्ठ मौजूद नहीं है। + +widget: + archives: + title: + other: अभिलेखागार + + more: + other: अधिक + + tagCloud: + title: + other: टैग + categoriesCloud: + title: + other: श्रेणियाँ + +search: + title: + other: खोज + + placeholder: + other: कुछ लिखें... + + resultTitle: + other: "#PAGES_COUNT पेज (#TIME_SECONDS सेकंड)" + +footer: + builtWith: + other: निर्मित {{ .Generator }} के साथ + + designedBy: + other: थीम {{ .Theme }} द्वारा डिज़ाइन किया गया {{ .DesignedBy }} diff --git a/themes/hugo-theme-stack/i18n/ja.yaml b/themes/hugo-theme-stack/i18n/ja.yaml index 40380fd..12352ee 100644 --- a/themes/hugo-theme-stack/i18n/ja.yaml +++ b/themes/hugo-theme-stack/i18n/ja.yaml @@ -4,6 +4,16 @@ toggleMenu: darkMode: other: ダークモード +list: + page: + other: "{{ .Count }} ページ目" + + section: + other: セクション + + subsection: + other: サブセクション + article: back: other: 前のページ @@ -54,7 +64,7 @@ search: footer: builtWith: - other: Built with {{ .Generator }} + other: "{{ .Generator }} で構築されています。" designedBy: other: テーマ {{ .Theme }} は {{ .DesignedBy }} によって設計されています。 diff --git a/themes/hugo-theme-stack/i18n/nl.yaml b/themes/hugo-theme-stack/i18n/nl.yaml index a814232..b5bf264 100644 --- a/themes/hugo-theme-stack/i18n/nl.yaml +++ b/themes/hugo-theme-stack/i18n/nl.yaml @@ -21,6 +21,8 @@ article: other: Gerelateerde inhoud lastUpdatedOn: other: Laatst bijgewerkt op + readingTime: + other: "{{ .Count }} leestijd" notFound: title: diff --git a/themes/hugo-theme-stack/i18n/pl.yaml b/themes/hugo-theme-stack/i18n/pl.yaml index e44a140..9f2982f 100644 --- a/themes/hugo-theme-stack/i18n/pl.yaml +++ b/themes/hugo-theme-stack/i18n/pl.yaml @@ -7,6 +7,8 @@ darkMode: list: page: one: "{{ .Count }} strona" + few: "{{ .Count }} strony" + many: "{{ .Count }} stron" other: "{{ .Count }} stron" section: @@ -14,7 +16,9 @@ list: subsection: one: Podsekcja - other: Podsekcje + few: Podsekcje + many: Podsekcji + other: Podsekcji article: back: @@ -28,9 +32,11 @@ article: lastUpdatedOn: other: Ostatnio zaktualizowany - + readingTime: one: "Przeczytasz w {{ .Count }} minutę" + few: "Przeczytasz w {{ .Count }} minuty" + many: "Przeczytasz w {{ .Count }} minut" other: "Przeczytasz w {{ .Count }} minut" notFound: @@ -50,7 +56,7 @@ widget: tagCloud: title: other: Tagi - + categoriesCloud: title: other: Kategorie @@ -63,6 +69,9 @@ search: other: Wpisz coś... resultTitle: + one: "#PAGES_COUNT strona (#TIME_SECONDS sekund)" + few: "#PAGES_COUNT strony (#TIME_SECONDS sekund)" + many: "#PAGES_COUNT stron (#TIME_SECONDS sekund)" other: "#PAGES_COUNT stron (#TIME_SECONDS sekund)" footer: diff --git a/themes/hugo-theme-stack/i18n/pt-br.yaml b/themes/hugo-theme-stack/i18n/pt-br.yaml index e3cf582..2784f3d 100644 --- a/themes/hugo-theme-stack/i18n/pt-br.yaml +++ b/themes/hugo-theme-stack/i18n/pt-br.yaml @@ -48,6 +48,9 @@ widget: tagCloud: title: other: Tags + categoriesCloud: + title: + other: Categorias search: title: diff --git a/themes/hugo-theme-stack/i18n/pt-pt.yaml b/themes/hugo-theme-stack/i18n/pt-pt.yaml new file mode 100644 index 0000000..f524969 --- /dev/null +++ b/themes/hugo-theme-stack/i18n/pt-pt.yaml @@ -0,0 +1,67 @@ +toggleMenu: + other: Alternar Menu + +darkMode: + other: Modo Escuro + +list: + page: + one: "{{ .Count }} página" + other: "{{ .Count }} páginas" + + section: + other: Secção + + subsection: + one: Subsecção + other: Subsecções + +article: + back: + other: Voltar + + tableOfContents: + other: Índice + + relatedContent: + other: Conteúdo relacionado + + lastUpdatedOn: + other: Última atualização a + + readingTime: + one: "{{ .Count }} minuto de leitura" + other: "{{ .Count }} minutos de leitura" + +notFound: + title: + other: Não Encontrado + subtitle: + other: Esta página não existe. + +widget: + archives: + title: + other: Arquivos + more: + other: Mais + tagCloud: + title: + other: Tags + categoriesCloud: + title: + other: Categorias + +search: + title: + other: Pesquisa + placeholder: + other: Escreva algo... + resultTitle: + other: "#PAGES_COUNT páginas (#TIME_SECONDS segundos)" + +footer: + builtWith: + other: Criado com {{ .Generator }} + designedBy: + other: Tema {{ .Theme }} desenvolvido por {{ .DesignedBy }} diff --git a/themes/hugo-theme-stack/i18n/sk.yaml b/themes/hugo-theme-stack/i18n/sk.yaml new file mode 100644 index 0000000..59c680e --- /dev/null +++ b/themes/hugo-theme-stack/i18n/sk.yaml @@ -0,0 +1,71 @@ +toggleMenu: + other: Skryť menu + +darkMode: + other: Tmavý režim + +list: + page: + one: "{{ .Count }} stránka" + other: "{{ .Count }} stránok" + + section: + other: Kategórie + + subsection: + one: Podkategória + other: Podkategórie + +article: + back: + other: Späť + + tableOfContents: + other: Obsah + + relatedContent: + other: Súvisiace + + lastUpdatedOn: + other: Naposledy aktualizované + + readingTime: + one: "{{ .Count }} minúta" + other: "{{ .Count }} minút" + +notFound: + title: + other: Nenájdené + + subtitle: + other: Tato stránka neexistuje + +widget: + archives: + title: + other: Archívy + more: + other: Viac + tagCloud: + title: + other: Štítky + categoriesCloud: + title: + other: Kategórie + +search: + title: + other: Hladať + + placeholder: + other: Zadajte niečo... + + resultTitle: + other: "#PAGES_COUNT stránok (#TIME_SECONDS sekúnd)" + +footer: + builtWith: + other: Vytvorené pomocou {{ .Generator }} + + designedBy: + other: Šablóna {{ .Theme }} od {{ .DesignedBy }} diff --git a/themes/hugo-theme-stack/i18n/vi.yaml b/themes/hugo-theme-stack/i18n/vi.yaml new file mode 100644 index 0000000..13dc624 --- /dev/null +++ b/themes/hugo-theme-stack/i18n/vi.yaml @@ -0,0 +1,74 @@ +toggleMenu: + other: Hiển thị Menu + +darkMode: + other: Chế độ nền tối + +list: + page: + one: "{{ .Count }} trang" + other: "{{ .Count }} trang" + + section: + other: Section + + subsection: + one: Subsection + other: Subsections + +article: + back: + other: Trở lại + + tableOfContents: + other: Mục lục + + relatedContent: + other: Bài viết liên quan + + lastUpdatedOn: + other: Cập nhật lần cuối + + readingTime: + one: "{{ .Count }} phút đọc" + other: "{{ .Count }} phút đọc" + +notFound: + title: + other: Không tìm thấy + + subtitle: + other: Trang này không tồn tại + +widget: + archives: + title: + other: Lưu trữ + + more: + other: Còn nữa + + tagCloud: + title: + other: Nhãn dán + + categoriesCloud: + title: + other: Chuỗi bài + +search: + title: + other: Tìm kiếm + + placeholder: + other: Nhập từ khoá ... + + resultTitle: + other: "#PAGES_COUNT trang (#TIME_SECONDS giây)" + +footer: + builtWith: + other: Built with {{ .Generator }} + + designedBy: + other: Theme {{ .Theme }} thiết kế bởi {{ .DesignedBy }} diff --git a/themes/hugo-theme-stack/i18n/zh-cn.yaml b/themes/hugo-theme-stack/i18n/zh-cn.yaml index ae074e6..39b187a 100644 --- a/themes/hugo-theme-stack/i18n/zh-cn.yaml +++ b/themes/hugo-theme-stack/i18n/zh-cn.yaml @@ -4,6 +4,13 @@ toggleMenu: darkMode: other: 暗色模式 +list: + page: "{{ .Count }} 个页面" + + section: 章节 + + subsection: 子章节 + article: back: other: 返回 @@ -54,7 +61,7 @@ search: footer: builtWith: - other: Built with {{ .Generator }} + other: 使用 {{ .Generator }} 构建 designedBy: other: 主题 {{ .Theme }} 由 {{ .DesignedBy }} 设计 diff --git a/themes/hugo-theme-stack/i18n/zh-tw.yaml b/themes/hugo-theme-stack/i18n/zh-tw.yaml index d9e124e..4b71572 100644 --- a/themes/hugo-theme-stack/i18n/zh-tw.yaml +++ b/themes/hugo-theme-stack/i18n/zh-tw.yaml @@ -4,6 +4,18 @@ toggleMenu: darkMode: other: 夜晚模式 +list: + page: + one: "第 {{ .Count }} 頁" + other: "第 {{ .Count }} 頁" + + section: + other: 段落 + + subsection: + one: 小節 + other: 小節 + article: back: other: 返回 @@ -18,11 +30,13 @@ article: other: 最後更新 readingTime: + one: "閱讀時間: {{ .Count }} 分鐘" other: "閱讀時間: {{ .Count }} 分鐘" notFound: title: other: 404 錯誤 + subtitle: other: 頁面不存在 @@ -37,6 +51,9 @@ widget: tagCloud: title: other: 標籤雲 + categoriesCloud: + title: + other: 分類 search: title: @@ -47,3 +64,10 @@ search: resultTitle: other: "#PAGES_COUNT 個結果 (用時 #TIME_SECONDS 秒)" + +footer: + builtWith: + other: 使用 {{ .Generator }} 建立 + + designedBy: + other: 主題 {{ .Theme }} 由 {{ .DesignedBy }} 設計 diff --git a/themes/hugo-theme-stack/layouts/_default/_markup/render-heading.html b/themes/hugo-theme-stack/layouts/_default/_markup/render-heading.html new file mode 100644 index 0000000..f79308a --- /dev/null +++ b/themes/hugo-theme-stack/layouts/_default/_markup/render-heading.html @@ -0,0 +1,6 @@ + + {{- if site.Params.Article.HeadingAnchor -}} + + {{- end -}} + {{ .Text | safeHTML }} + \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/_default/baseof.html b/themes/hugo-theme-stack/layouts/_default/baseof.html index 081277b..83fdaa3 100644 --- a/themes/hugo-theme-stack/layouts/_default/baseof.html +++ b/themes/hugo-theme-stack/layouts/_default/baseof.html @@ -18,10 +18,10 @@ {{- block "left-sidebar" . -}} {{ partial "sidebar/left.html" . }} {{- end -}} + {{- block "right-sidebar" . -}}{{ end }}
{{- block "main" . }}{{- end }}
- {{- block "right-sidebar" . -}}{{ end }} {{ partial "footer/include.html" . }} diff --git a/themes/hugo-theme-stack/layouts/_default/rss.xml b/themes/hugo-theme-stack/layouts/_default/rss.xml index e9f3f1a..5874559 100644 --- a/themes/hugo-theme-stack/layouts/_default/rss.xml +++ b/themes/hugo-theme-stack/layouts/_default/rss.xml @@ -18,9 +18,9 @@ {{ .Permalink }} Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} Hugo -- gohugo.io{{ with .Site.LanguageCode }} - {{.}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} + {{.}}{{end}}{{ with .Site.Params.Author.email }} + {{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Params.Author.email }} + {{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} {{.}}{{end}}{{ if not .Date.IsZero }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} {{- with .OutputFormats.Get "RSS" -}} @@ -35,7 +35,7 @@ {{ .Title }} {{ .Permalink }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{ with .Site.Params.Author.email }}{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}{{end}} {{ .Permalink }} {{- $image := partial "helper/image" (dict "Context" . "Type" "rss") -}} diff --git a/themes/hugo-theme-stack/layouts/page/search.html b/themes/hugo-theme-stack/layouts/page/search.html index 7c424a6..fbfb74d 100644 --- a/themes/hugo-theme-stack/layouts/page/search.html +++ b/themes/hugo-theme-stack/layouts/page/search.html @@ -1,11 +1,11 @@ {{ define "body-class" }}template-search{{ end }} {{ define "head" }} {{- with .OutputFormats.Get "json" -}} - + {{- end -}} {{ end }} {{ define "main" }} -
+

diff --git a/themes/hugo-theme-stack/layouts/partials/article/components/details.html b/themes/hugo-theme-stack/layouts/partials/article/components/details.html index 4cd26e3..cc0a0fc 100644 --- a/themes/hugo-theme-stack/layouts/partials/article/components/details.html +++ b/themes/hugo-theme-stack/layouts/partials/article/components/details.html @@ -23,9 +23,12 @@ {{ end }} - {{ if or (not .Date.IsZero) (.Site.Params.article.readingTime) }} + {{ $showReadingTime := .Params.readingTime | default (.Site.Params.article.readingTime) }} + {{ $showDate := not .Date.IsZero }} + {{ $showFooter := or $showDate $showReadingTime }} + {{ if $showFooter }}

- {{ if not .Date.IsZero }} + {{ if $showDate }}
{{ partial "helper/icon" "date" }}
{{ end }} - {{ if .Site.Params.article.readingTime }} + {{ if $showReadingTime }}
{{ partial "helper/icon" "clock" }}
{{ end }} - \ No newline at end of file + diff --git a/themes/hugo-theme-stack/layouts/partials/article/components/links.html b/themes/hugo-theme-stack/layouts/partials/article/components/links.html index 118dbb3..a2ac26c 100644 --- a/themes/hugo-theme-stack/layouts/partials/article/components/links.html +++ b/themes/hugo-theme-stack/layouts/partials/article/components/links.html @@ -16,8 +16,12 @@ {{ with $link.image }} + {{ $permalink := . }} + {{ with ($.Resources.GetMatch (printf "%s" (. | safeURL))) }} + {{ $permalink = .RelPermalink }} + {{ end }}
- +
{{ end }} diff --git a/themes/hugo-theme-stack/layouts/partials/article/components/math.html b/themes/hugo-theme-stack/layouts/partials/article/components/math.html index d05861c..bd1a7f8 100644 --- a/themes/hugo-theme-stack/layouts/partials/article/components/math.html +++ b/themes/hugo-theme-stack/layouts/partials/article/components/math.html @@ -1,12 +1,13 @@ {{- partial "helper/external" (dict "Context" . "Namespace" "KaTeX") -}} \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/comments/provider/beaudar.html b/themes/hugo-theme-stack/layouts/partials/comments/provider/beaudar.html new file mode 100644 index 0000000..761801f --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/comments/provider/beaudar.html @@ -0,0 +1,46 @@ + + + + + diff --git a/themes/hugo-theme-stack/layouts/partials/comments/provider/disqusjs.html b/themes/hugo-theme-stack/layouts/partials/comments/provider/disqusjs.html new file mode 100644 index 0000000..8dbcc13 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/comments/provider/disqusjs.html @@ -0,0 +1,61 @@ +{{- $pc := .Site.Config.Privacy.Disqus -}} +{{- $disqusjs := .Site.Params.Comments.disqusjs -}} +{{- if and (not $pc.Disable) (and $disqusjs.Shortname $disqusjs.ApiKey) -}} + +{{- $style := resources.Get "scss/partials/comments/disqusjs.scss" | resources.ToCSS | minify -}} + + +
+
+ + +
+{{- end -}} \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/comments/provider/remark42.html b/themes/hugo-theme-stack/layouts/partials/comments/provider/remark42.html index 97196c8..18acf1b 100644 --- a/themes/hugo-theme-stack/layouts/partials/comments/provider/remark42.html +++ b/themes/hugo-theme-stack/layouts/partials/comments/provider/remark42.html @@ -2,10 +2,10 @@
+
diff --git a/themes/hugo-theme-stack/layouts/partials/comments/provider/waline.html b/themes/hugo-theme-stack/layouts/partials/comments/provider/waline.html index 21b6507..9d1a2a0 100644 --- a/themes/hugo-theme-stack/layouts/partials/comments/provider/waline.html +++ b/themes/hugo-theme-stack/layouts/partials/comments/provider/waline.html @@ -19,7 +19,7 @@ {{- $replaceKeys := dict "serverurl" "serverURL" "requiredmeta" "requiredMeta" "wordlimit" "wordLimit" "pagesize" "pageSize" "imageuploader" "imageUploader" "texrenderer" "texRenderer" -}} {{- range $key, $val := . -}} - {{- if $val -}} + {{- if ne $val nil -}} {{- $replaceKey := index $replaceKeys $key -}} {{- $k := default $key $replaceKey -}} diff --git a/themes/hugo-theme-stack/layouts/partials/data/description.html b/themes/hugo-theme-stack/layouts/partials/data/description.html index f63d603..7f6cc32 100644 --- a/themes/hugo-theme-stack/layouts/partials/data/description.html +++ b/themes/hugo-theme-stack/layouts/partials/data/description.html @@ -1,6 +1,11 @@ {{ $description := .Site.Params.sidebar.subtitle }} + +{{ if .Site.Params.description }} + {{ $description = .Site.Params.description }} +{{ end }} + {{ if .Description }} {{ $description = .Description }} @@ -9,4 +14,4 @@ {{ $description = .Summary }} {{ end }} -{{ return ($description | plainify)}} \ No newline at end of file +{{ return (replaceRE "\n" " " $description | plainify) }} \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/footer/footer.html b/themes/hugo-theme-stack/layouts/partials/footer/footer.html index 255eba5..5193afa 100644 --- a/themes/hugo-theme-stack/layouts/partials/footer/footer.html +++ b/themes/hugo-theme-stack/layouts/partials/footer/footer.html @@ -1,11 +1,11 @@ -{{- $ThemeVersion := "3.13.0" -}} +{{- $ThemeVersion := "3.26.0" -}}