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..21ec6d56 --- /dev/null +++ b/.github/workflows/label.yml @@ -0,0 +1,17 @@ +name: Labeller + +on: [pull_request_target] + +jobs: + label: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + + steps: + - name: Label + uses: actions/labeler@v3 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: .github/labeller.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 9af42982..d33f3d8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +## [1.3.0] - 2021-09-29 + +### Added + +- Site logo support +- Chinese translation ([#2](https://github.com/jpanther/congo/pull/2)) + +### Changed + +- Upgrade to Tailwind v2.2.16 + ## [1.2.1] - 2021-08-26 ### Added @@ -95,7 +106,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Advanced customisation using simple Tailwind colour definitions and styles - Fully documented -[unreleased]: https://github.com/jpanther/Congo/compare/v1.2.1...HEAD +[unreleased]: https://github.com/jpanther/Congo/compare/v1.3.0...HEAD +[1.3.0]: https://github.com/jpanther/Congo/compare/v1.2.1...v1.3.0 [1.2.1]: https://github.com/jpanther/Congo/compare/v1.2.0...v1.2.1 [1.2.0]: https://github.com/jpanther/Congo/compare/v1.1.1...v1.2.0 [1.1.1]: https://github.com/jpanther/congo/compare/v1.1.0...v1.1.1 diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index 2a4889f2..ebcd58fb 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -1,6 +1,6 @@ -/*! Congo v1.2.1 | MIT License | https://github.com/jpanther/congo */ +/*! Congo v1.3.0 | MIT License | https://github.com/jpanther/congo */ -/*! tailwindcss v2.2.7 | MIT License | https://tailwindcss.com */ +/*! tailwindcss v2.2.16 | MIT License | https://tailwindcss.com */ /*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */ @@ -477,6 +477,18 @@ button, cursor: pointer; } +/** + * Override legacy focus reset from Normalize with modern Firefox focus styles. + * + * This is actually an improvement over the new defaults in Firefox in our testing, + * as it triggers the better focus styles even for links, which still use a dotted + * outline in Firefox by default. + */ + +:-moz-focusring { + outline: auto; +} + table { border-collapse: collapse; } @@ -2701,6 +2713,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/assets/css/main.css b/assets/css/main.css index 0d4a7c28..deccc633 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -1,4 +1,4 @@ -/*! Congo v1.2.1 | MIT License | https://github.com/jpanther/congo */ +/*! Congo v1.3.0 | MIT License | https://github.com/jpanther/congo */ @tailwind base; @tailwind components; 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/advanced-customisation.md b/exampleSite/content/docs/advanced-customisation.md index f76ad9ad..f1cd88ec 100644 --- a/exampleSite/content/docs/advanced-customisation.md +++ b/exampleSite/content/docs/advanced-customisation.md @@ -21,7 +21,7 @@ Use one of the existing theme stylesheets as a template. You are free to define ## Overriding the stylesheet -Sometimes you need to add a custom style to style your own HTML elements. Congo provides for this scenario by allowing you to overrid the default styles in your own CSS stylesheet. Simply create a `custom.css` file in your project's `assets/css/` folder. +Sometimes you need to add a custom style to style your own HTML elements. Congo provides for this scenario by allowing you to override the default styles in your own CSS stylesheet. Simply create a `custom.css` file in your project's `assets/css/` folder. The `custom.css` file will be minified by Hugo and loaded automatically after all the other theme styles which means anything in your custom file will take precedence over the defaults. @@ -54,7 +54,7 @@ npm run dev This will automatically output a CSS file to `/themes/congo/assets/css/compiled/main.css`. {{< alert >}} -**Note:** You should make manual edits to the compiled CSS file. +**Note:** You should not make manual edits to the compiled CSS file. {{< /alert >}} Now whenever you make a change, the CSS files will be rebuilt automatically. This mode is useful to run when using `hugo server` to preview your site during development. Asset files will be minified by Hugo at site build time. diff --git a/exampleSite/content/docs/configuration.md b/exampleSite/content/docs/configuration.md index 38c16468..1e6bd5cb 100644 --- a/exampleSite/content/docs/configuration.md +++ b/exampleSite/content/docs/configuration.md @@ -54,7 +54,8 @@ 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`.| +|`colorScheme`|string|`"congo"`|The theme colour scheme to use. Valid values are `congo` (default), `avocado`, `ocean` and `fire`. Refer to [Advanced Customisation]({{< ref "advanced-customisation#colour-schemes" >}}) for more details.| +|`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/exampleSite/content/users.md b/exampleSite/content/users.md index 1c0a3afd..eae73fed 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,9 @@ 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 | +| [zekeriyaay.com](https://zekeriyaay.com) | Personal cheat sheets site | **Congo user?** To add your site to this list, [submit a pull request](https://github.com/jpanther/congo/blob/dev/exampleSite/content/users.md). 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. */}} 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 }}