From 962a4875ee5b888e1352975c3c1ee5bfe712fe91 Mon Sep 17 00:00:00 2001 From: canstand Date: Mon, 20 Sep 2021 11:24:28 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E2=9C=A8Add=20i18n=20chinese=20translati?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- i18n/en.yaml | 2 +- i18n/zh.yaml | 33 ++++++++++++++++++++++++++++++ layouts/partials/article-link.html | 2 +- layouts/partials/footer.html | 24 ++++++++-------------- 4 files changed, 43 insertions(+), 18 deletions(-) create mode 100644 i18n/zh.yaml diff --git a/i18n/en.yaml b/i18n/en.yaml index ffda4d4a..6052261f 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -16,7 +16,7 @@ error: 404_description: "It seems that the page you've requested does not exist." footer: - powered_by: "Powered by" + powered_by: "Powered by {{ .Hugo }}" list: externalurl_title: "Link to external site" diff --git a/i18n/zh.yaml b/i18n/zh.yaml new file mode 100644 index 00000000..4d48f9b5 --- /dev/null +++ b/i18n/zh.yaml @@ -0,0 +1,33 @@ +article: + anchor_label: "锚点" + draft: "草稿" + edit_title: "编辑内容" + reading_time: + other: "{{ .Count }} 分钟" + reading_time_title: "预计阅读" + +author: + byline_title: "作者" + +error: + 404_title: "找不到网页 :confused:" + 404_error: "404 错误" + 404_description: "您请求的页面似乎不存在。" + +footer: + powered_by: "由 {{ .Hugo }} 强力驱动" + +list: + externalurl_title: "链接到外部网站" + no_articles: "这里还没有任何文章可以列出。" + +sharing: + email: "通过电子邮件发送" + facebook: "分享到 Facebook" + linkedin: "分享到 LinkedIn" + reddit: "提交到 Reddit" + twitter: "分享到 Twitter" + +shortcode: + recent_articles: "最近的文章" + icon_none: "未找到图标。" diff --git a/layouts/partials/article-link.html b/layouts/partials/article-link.html index dd752aee..0b576b14 100644 --- a/layouts/partials/article-link.html +++ b/layouts/partials/article-link.html @@ -23,7 +23,7 @@ {{ end }} {{ if and .Draft .Site.Params.article.showDraftLabel }}
- {{ partial "badge.html" "Draft" }} + {{ partial "badge.html" (i18n "article.draft" | emojify) }}
{{ end }} {{ if templates.Exists "partials/extend-article-link.html" }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 51559f75..278dfbd2 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -12,22 +12,14 @@ {{/* Theme attribution */}} {{ if .Site.Params.attribution | default true }}

- {{ i18n "footer.powered_by" }} - Hugo - & - Congo + {{ $hugo := printf `Hugo + & + Congo` + }} + + {{ i18n "footer.powered_by" (dict "Hugo" $hugo) | safeHTML }}

{{ end }} {{/* Extend footer - eg. for extra scripts, etc. */}} From 661016d3beef68fa0df8ca9bfe012d685ed34361 Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Mon, 20 Sep 2021 15:01:41 +1000 Subject: [PATCH 02/11] =?UTF-8?q?=F0=9F=93=9D=20Fix=20minor=20typos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- exampleSite/content/users.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exampleSite/content/users.md b/exampleSite/content/users.md index 1c0a3afd..02a16cd0 100644 --- a/exampleSite/content/users.md +++ b/exampleSite/content/users.md @@ -2,7 +2,7 @@ title: "Users" date: 2020-08-14 draft: false -description: "Some real life Congo examples." +description: "Some real-life Congo examples." slug: "users" tags: ["users"] showDate: false @@ -15,8 +15,8 @@ showEdit: false Real websites that are built with Congo. {{< /lead >}} -| Website | Details | -| ------------------------------------------------ | ---------------------------- | -| [jamespanther.com](https://www.jamespanther.com) | Personal site - Theme author | +| Website | Details | +| -------------------------------------------- | ---------------------------- | +| [jamespanther.com](https://jamespanther.com) | Personal site - Theme author | **Congo user?** To add your site to this list, [submit a pull request](https://github.com/jpanther/congo/blob/dev/exampleSite/content/users.md). From 9c5e624bb61ff186e3554991e53d7506f9ac3c7f Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Mon, 20 Sep 2021 15:02:10 +1000 Subject: [PATCH 03/11] =?UTF-8?q?=F0=9F=91=B7=20Add=20pull=20request=20lab?= =?UTF-8?q?elling=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/labeller.yml | 5 +++++ .github/workflows/label.yml | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 .github/labeller.yml create mode 100644 .github/workflows/label.yml diff --git a/.github/labeller.yml b/.github/labeller.yml new file mode 100644 index 00000000..4287b874 --- /dev/null +++ b/.github/labeller.yml @@ -0,0 +1,5 @@ +i18n: + - i18n/* + +documentation: + - exampleSite/content/* diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml new file mode 100644 index 00000000..a1c9cdea --- /dev/null +++ b/.github/workflows/label.yml @@ -0,0 +1,17 @@ +name: Labeller + +on: [pull_request] + +jobs: + label: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + + steps: + - name: Label + uses: actions/labeler@v2 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: .github/labeller.yml From 3cd30d9a80d15afa2159b4055adb70bdc7ab11bd Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Mon, 20 Sep 2021 15:17:43 +1000 Subject: [PATCH 04/11] =?UTF-8?q?=F0=9F=93=9D=20Update=20changelog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9af42982..f1b6bae5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Added + +- Chinese translation ([#2](https://github.com/jpanther/congo/pull/2)) + ## [1.2.1] - 2021-08-26 ### Added From 94b690258af352efbeaadbf870ba959b43738e37 Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Wed, 22 Sep 2021 09:10:22 +1000 Subject: [PATCH 05/11] =?UTF-8?q?=F0=9F=91=B7=20Fix=20labeller=20secrets?= =?UTF-8?q?=20issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/label.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index a1c9cdea..98790acc 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -1,6 +1,6 @@ name: Labeller -on: [pull_request] +on: [pull_request_target] jobs: label: From ef05cd07cc1342d86ea413c02bfc25971a265ee7 Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Wed, 22 Sep 2021 09:14:33 +1000 Subject: [PATCH 06/11] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Bump=20labeler=20ver?= =?UTF-8?q?sion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/label.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index 98790acc..21ec6d56 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -11,7 +11,7 @@ jobs: steps: - name: Label - uses: actions/labeler@v2 + uses: actions/labeler@v3 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: .github/labeller.yml From 4528e36a821413703f10e8498552f47c00767de7 Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Wed, 22 Sep 2021 12:24:46 +1000 Subject: [PATCH 07/11] =?UTF-8?q?=E2=9C=A8=20Add=20option=20to=20add=20a?= =?UTF-8?q?=20site=20logo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + assets/css/compiled/main.css | 4 ++++ config/_default/params.toml | 1 + exampleSite/content/docs/configuration.md | 1 + layouts/partials/header.html | 28 +++++++++++++++++------ 5 files changed, 28 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1b6bae5..8049881f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Added +- Site logo support - Chinese translation ([#2](https://github.com/jpanther/congo/pull/2)) ## [1.2.1] - 2021-08-26 diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index 2a4889f2..d848dadf 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -2701,6 +2701,10 @@ body a, body button { flex-direction: row; } + .sm\:items-center { + align-items: center; + } + .sm\:px-14 { padding-left: 3.5rem; padding-right: 3.5rem; diff --git a/config/_default/params.toml b/config/_default/params.toml index e660ba28..e5ad4f4d 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -6,6 +6,7 @@ # https://jpanther.github.io/congo/docs/configuration/#theme-parameters colorScheme = "congo" +# logo = "img/logo.jpg" # description = "My awesome website" # mainSections = ["section1", "section2"] # robots = "" diff --git a/exampleSite/content/docs/configuration.md b/exampleSite/content/docs/configuration.md index 38c16468..f52c1df6 100644 --- a/exampleSite/content/docs/configuration.md +++ b/exampleSite/content/docs/configuration.md @@ -55,6 +55,7 @@ Many of the article defaults here can be overridden on a per article basis by sp |Name|Type|Default|Description| | --- | --- | --- | --- | |`colorScheme`|string|`"congo"`|The theme colour scheme to use. Valid values are `congo` (default), `avocado`, `ocean` and `fire`.| +|`logo`|string|_Not set_|The relative path to the site logo file within the Hugo assets folder. The logo file should be provided at 2x resolution and supports any image dimensions.| |`description`|string|_Not set_|The description of the website for metadata purposes.| |`mainSections`|array of strings|_Not set_|The sections that should be displayed in the recent articles list. If not provided the section with the greatest number of articles is used.| |`robots`|string|_Not set_|String that indicates how robots should handle your site. If set, it will be output in the page head. Refer to [Google's docs](https://developers.google.com/search/docs/advanced/robots/robots_meta_tag#directives) for valid values.| diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 9b480e7f..3616b597 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,11 +1,25 @@ -
+
- {{ .Site.Title }} + {{ if .Site.Params.Logo -}} + {{ $logo := resources.Get .Site.Params.Logo }} + {{ if $logo }} + {{ .Site.Title }} + {{ end }} + {{ else }} + {{ .Site.Title }} + {{- end }}