diff --git a/assets/icons/language.svg b/assets/icons/language.svg new file mode 100644 index 0000000..66ede1c --- /dev/null +++ b/assets/icons/language.svg @@ -0,0 +1,10 @@ + + + diff --git a/assets/scss/partials/article.scss b/assets/scss/partials/article.scss index 459c22f..0d3efba 100644 --- a/assets/scss/partials/article.scss +++ b/assets/scss/partials/article.scss @@ -91,7 +91,8 @@ } } -.article-time { +.article-time, +.article-translations { display: flex; align-items: center; color: var(--card-text-color-tertiary); @@ -101,19 +102,21 @@ svg { vertical-align: middle; - margin-right: 15px; width: 20px; height: 20px; stroke-width: 1.33; } - time { + time, + a { font-size: 1.4rem; + color: var(--card-text-color-tertiary); } & > div { display: inline-flex; align-items: center; + gap: 15px; } } diff --git a/assets/scss/partials/layout/article.scss b/assets/scss/partials/layout/article.scss index af5f7bb..92e1167 100644 --- a/assets/scss/partials/layout/article.scss +++ b/assets/scss/partials/layout/article.scss @@ -122,67 +122,6 @@ } } -.article-page.has-toc { - .left-sidebar { - display: none; - } - - .right-sidebar { - width: 100%; - padding: 0; - display: none; - - @include respond(xl) { - display: block; - top: var(--main-top-padding); - } - } - - #article-toolbar { - display: block; - - @include respond(md) { - padding: 0; - } - - @include respond(xl) { - margin-top: 0; - position: sticky; - top: var(--main-top-padding); - flex-shrink: 1; - - a { - background: transparent; - box-shadow: none; - border: 1px solid var(--body-text-color); - width: 100%; - margin-right: 0; - - svg { - flex-shrink: 0; - } - } - } - } - - .main-container { - align-items: start; - flex-direction: column; - - @include respond(xl) { - flex-direction: row; - } - } - - .main { - padding-top: 0; - - @include respond(xl) { - padding-top: var(--main-top-padding); - } - } -} - .widget--toc { background-color: var(--card-background); border-radius: var(--card-border-radius); diff --git a/assets/scss/partials/menu.scss b/assets/scss/partials/menu.scss index 1d612d1..257eedb 100644 --- a/assets/scss/partials/menu.scss +++ b/assets/scss/partials/menu.scss @@ -125,7 +125,6 @@ .menu { padding-left: 0; list-style: none; - display: flex; flex-direction: column; overflow-y: auto; flex-grow: 1; @@ -138,8 +137,17 @@ margin: 0 -15px; + &, + .menu-bottom-section { + gap: 15px; + @include respond(xl) { + margin-top: 30px; + gap: 20px; + } + } + &.show { - display: block; + display: flex; } @include respond(md) { @@ -161,14 +169,6 @@ vertical-align: middle; padding: 10px 30px; - &:not(:last-of-type) { - margin-bottom: 15px; - - @include respond(xl) { - margin-bottom: 20px; - } - } - @include respond(md) { width: 100%; padding: 10px 0; @@ -200,6 +200,13 @@ } } } + + .menu-bottom-section { + margin-top: auto; + display: flex; + flex-direction: column; + width: 100%; + } } .social-menu { diff --git a/assets/scss/partials/sidebar.scss b/assets/scss/partials/sidebar.scss index 462729d..4d320a8 100644 --- a/assets/scss/partials/sidebar.scss +++ b/assets/scss/partials/sidebar.scss @@ -37,7 +37,7 @@ } .right-sidebar { - flex-shrink: 0; + width: 100%; display: none; &.sticky { @@ -158,3 +158,20 @@ display: none; } } + +#i18n-switch { + color: var(--body-text-color); + display: inline-flex; + align-content: center; + + select { + border: 0; + background-color: transparent; + color: var(--body-text-color); + + option { + color: var(--card-text-color-main); + background-color: var(--card-background); + } + } +} diff --git a/config.yaml b/config.yaml index 0e5283c..c55a911 100644 --- a/config.yaml +++ b/config.yaml @@ -95,6 +95,7 @@ params: darkTheme: reactionsEnabled: 1 emitMetadata: 0 + lang: gitalk: owner: @@ -108,16 +109,8 @@ params: id: widgets: - enabled: - - search - - archives - - tag-cloud - - archives: - limit: 5 - - tagCloud: - limit: 10 + homepage: [] + page: [] opengraph: twitter: diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index d449fc9..b2fe1d3 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -4,6 +4,16 @@ theme: hugo-theme-stack paginate: 5 title: Example Site +languages: + en: + languageName: English + title: Example Site + weight: 1 + cn: + languageName: 中文 + title: 演示站点 + weight: 2 + # Change it to your Disqus shortname before using disqusShortname: hugo-theme-stack @@ -132,16 +142,16 @@ params: host: id: widgets: - enabled: - - search - - archives - - tag-cloud - - archives: - limit: 5 - - tagCloud: - limit: 10 + homepage: + - type: search + - type: archives + params: + limit: 5 + - type: tag-cloud + params: + limit: 10 + page: + - type: toc opengraph: twitter: diff --git a/exampleSite/content/page/about/index.cn.md b/exampleSite/content/page/about/index.cn.md new file mode 100644 index 0000000..060c006 --- /dev/null +++ b/exampleSite/content/page/about/index.cn.md @@ -0,0 +1,5 @@ +--- +title: 关于 +--- + +This is a test page for i18n support. \ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 8a5ff95..db1903e 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -6,7 +6,8 @@
{{- partial "head/colorScheme" . -}} -