Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [2.6.1] - 2023-06-04

### Changed

- Images are now marked for lazy loading by default ([#552](https://github.com/jpanther/congo/pull/552))
- Current language is no longer displayed in language selection ([#565](https://github.com/jpanther/congo/issues/565))
- Updated Simplified Chinese (China) translation ([#573](https://github.com/jpanther/congo/pull/573))

### Fixed

- Language selection repeats current language on multilingual sites instead of linking to translated content ([#565](https://github.com/jpanther/congo/issues/565))
- Icon padding inconsistent when using `--minify` option to build site ([#568](https://github.com/jpanther/congo/pull/568))
- Copyright string in the language configuration does not apply ([#572](https://github.com/jpanther/congo/issues/572))
- Upgrade to Mermaid v10.2.1 ([#569](https://github.com/jpanther/congo/pull/569))

## [2.6.0] - 2023-05-25

### Added
Expand Down Expand Up @@ -688,7 +703,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/v2.6.0...HEAD
[Unreleased]: https://github.com/jpanther/congo/compare/v2.6.1...HEAD
[2.6.1]: https://github.com/jpanther/congo/compare/v2.6.0...v2.6.1
[2.6.0]: https://github.com/jpanther/congo/compare/v2.5.4...v2.6.0
[2.5.4]: https://github.com/jpanther/congo/compare/v2.5.3...v2.5.4
[2.5.3]: https://github.com/jpanther/congo/compare/v2.5.2...v2.5.3
Expand Down
2 changes: 1 addition & 1 deletion assets/css/compiled/main.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Congo v2.6.0 | MIT License | https://github.com/jpanther/congo */
/*! Congo v2.6.1 | MIT License | https://github.com/jpanther/congo */

/*! tailwindcss v3.3.2 | MIT License | https://tailwindcss.com */

Expand Down
2 changes: 1 addition & 1 deletion assets/css/main.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Congo v2.6.0 | MIT License | https://github.com/jpanther/congo */
/*! Congo v2.6.1 | MIT License | https://github.com/jpanther/congo */

@tailwind base;
@tailwind components;
Expand Down
338 changes: 169 additions & 169 deletions assets/lib/mermaid/mermaid.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ autoSwitchAppearance = true

enableSearch = false
enableCodeCopy = false
enableImageLazyLoading = true

# robots = ""
fingerprintAlgorithm = "sha256"
Expand Down
1 change: 1 addition & 0 deletions exampleSite/config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ autoSwitchAppearance = true

enableSearch = true
enableCodeCopy = true
enableImageLazyLoading = true

# robots = ""
fingerprintAlgorithm = "sha256"
Expand Down
1 change: 1 addition & 0 deletions exampleSite/content/docs/configuration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ Many of the article defaults here can be overridden on a per article basis by sp
|`autoSwitchAppearance`|`true`|Whether the theme appearance automatically switches based upon the visitor's operating system preference. Set to `false` to force the site to always use the `defaultAppearance`.|
|`enableSearch`|`false`|Whether site search is enabled. Set to `true` to enable search functionality. Note that the search feature depends on the `outputs.home` setting in the [site configuration](#site-configuration) being set correctly.|
|`enableCodeCopy`|`false`|Whether copy-to-clipboard buttons are enabled for `<code>` blocks. The `highlight.noClasses` parameter must be set to `false` for code copy to function correctly. Read more about [other configuration files](#other-configuration-files) below.|
|`enableImageLazyLoading`|`true`|Whether images should be marked for lazy loading by the broswer.|
|`robots`|_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.|
|`fingerprintAlgorithm`|`"sha256"`|String that indicates which hashing algorithm is used when fingerprinting assets. Valid options include `md5`, `sha256`, `sha384` and `sha512`.|
|`header.layout`|`"basic"`|The layout of the page header and menu. Valid values are `basic`, `hamburger`, `hybrid` or `custom`. When set to `custom`, you must provide your own layout by creating a `/layouts/partials/header/custom.html` file.|
Expand Down
4 changes: 2 additions & 2 deletions exampleSite/content/docs/hosting-deployment/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ Then in the root of your site repository, create a `netlify.toml` file:
TZ = "UTC" # Set to preferred timezone

[context.production.environment]
HUGO_VERSION = "0.112.3"
HUGO_VERSION = "0.112.7"
HUGO_ENV = "production"

[context.deploy-preview.environment]
HUGO_VERSION = "0.112.3"
HUGO_VERSION = "0.112.7"
```

This configuration assumes you are deploying Congo as a Hugo module. If you have installed the theme using another method, change the build command to simply `hugo --gc --minify -b $URL`.
Expand Down
26 changes: 13 additions & 13 deletions i18n/zh-CN.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
article:
anchor_label: "锚点"
date: "{{ .Date }}"
# date_updated: "Updated: {{ .Date }}"
date_updated: "更新于 {{ .Date }}"
draft: "草稿"
edit_title: "编辑内容"
reading_time:
other: "{{ .Count }} 分钟"
reading_time_title: "预计阅读"
# table_of_contents: "Table of Contents"
table_of_contents: "目录"
word_count:
one: "{{ .Count }} 字"
other: "{{ .Count }} 字"

author:
byline_title: "作者"

# code:
# copy: "Copy"
# copied: "Copied"
code:
copy: "复制"
copied: "已复制"

error:
404_title: "找不到网页 :confused:"
Expand All @@ -33,20 +33,20 @@ list:
externalurl_title: "链接到外部网站"
no_articles: "这里还没有任何文章可以列出。"

# nav:
# scroll_to_top_title: "Scroll to top"
# skip_to_main: "Skip to main content"
nav:
scroll_to_top_title: "回到顶部"
skip_to_main: "跳到主要内容"

# search:
# open_button_title: "Search (/)"
# close_button_title: "Close (Esc)"
# input_placeholder: "Search"
search:
open_button_title: "搜索 (/)"
close_button_title: "关闭 (Esc)"
input_placeholder: "搜索"

sharing:
email: "通过电子邮件发送"
facebook: "分享到 Facebook"
linkedin: "分享到 LinkedIn"
# mastodon: "Toot on Mastodon"
mastodon: "嘟嘟到 Mastodon"
pinterest: "钉到 Pinterest"
reddit: "提交到 Reddit"
twitter: "分享到 Twitter"
Expand Down
22 changes: 20 additions & 2 deletions layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
{{ $url := urls.Parse .Destination }}
{{ $altText := .Text }}
{{ $caption := .Title }}
{{ $lazyLoad := $.Page.Site.Params.enableImageLazyLoading | default true }}
{{ if findRE "^https?" $url.Scheme }}
<figure>
<img class="mx-auto my-0 rounded-md" src="{{ $url.String }}" alt="{{ $altText }}" />
<img
class="mx-auto my-0 rounded-md"
src="{{ $url.String }}"
alt="{{ $altText }}"
{{ if $lazyLoad }}
loading="lazy"
{{ end }}
/>
{{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }}
</figure>
{{ else }}
Expand Down Expand Up @@ -32,12 +40,22 @@
{{ end }}
{{ end }}
alt="{{ $altText }}"
{{ if $lazyLoad }}
loading="lazy"
{{ end }}
/>
{{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }}
</figure>
{{ else }}
<figure>
<img class="mx-auto my-0 rounded-md" src="{{ $url.String }}" alt="{{ $altText }}" />
<img
class="mx-auto my-0 rounded-md"
src="{{ $url.String }}"
alt="{{ $altText }}"
{{ if $lazyLoad }}
loading="lazy"
{{ end }}
/>
{{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }}
</figure>
{{ end }}
Expand Down
3 changes: 3 additions & 0 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ <h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">
{{ end }}
{{ end }}
alt="{{ $.Params.featureAlt | default $.Params.coverAlt | default "" }}"
{{ if $.Site.Params.enableImageLazyLoading | default true }}
loading="lazy"
{{ end }}
/>
{{ with $.Params.coverCaption }}
<figcaption class="mb-6 -mt-3 text-center">{{ . | markdownify }}</figcaption>
Expand Down
3 changes: 3 additions & 0 deletions layouts/partials/article-link.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
160w, {{- (.Fill "320x240 smart").RelPermalink }} 2x"
src="{{ (.Fill "160x120 smart").RelPermalink }}"
{{ end }}
{{ if $.Site.Params.enableImageLazyLoading | default true }}
loading="lazy"
{{ end }}
/>
</a>
</div>
Expand Down
3 changes: 3 additions & 0 deletions layouts/partials/author.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
height="96"
alt="{{ $.Site.Author.name | default "Author" }}"
src="{{ $authorImage.RelPermalink }}"
{{ if $.Site.Params.enableImageLazyLoading | default true }}
loading="lazy"
{{ end }}
/>
{{ end }}
{{ end }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
{{/* Copyright */}}
{{ if .Site.Params.footer.showCopyright | default true }}
<p class="text-sm text-neutral-500 dark:text-neutral-400">
{{- with .Site.Params.copyright }}
{{- with site.Copyright }}
{{ . | emojify | markdownify }}
{{- else }}
&copy;
Expand Down
3 changes: 3 additions & 0 deletions layouts/partials/home/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
height="144"
alt="{{ $.Site.Author.name | default "Author" }}"
src="{{ $authorImage.RelPermalink }}"
{{ if $.Site.Params.enableImageLazyLoading | default true }}
loading="lazy"
{{ end }}
/>
{{ end }}
{{ end }}
Expand Down
6 changes: 6 additions & 0 deletions layouts/partials/logo.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
height="{{ div $logo.Height 2 }}"
class="max-h-[10rem] max-w-[10rem] object-scale-down object-left{{ if $logo_dark }} hidden dark:flex{{ end }}"
alt="{{ .Site.Title }}"
{{ if .Site.Params.enableImageLazyLoading | default true }}
loading="lazy"
{{ end }}
/>
{{- if $logo_dark }}
<img
Expand All @@ -17,6 +20,9 @@
height="{{ div $logo_dark.Height 2 }}"
class="max-h-[10rem] max-w-[10rem] object-scale-down object-left dark:hidden"
alt="{{ .Site.Title }}"
{{ if .Site.Params.enableImageLazyLoading | default true }}
loading="lazy"
{{ end }}
/>
{{- end}}
</a>
Expand Down
17 changes: 10 additions & 7 deletions layouts/partials/translations.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{{ if .IsTranslated }}
{{ $currentLang := .Page.Lang }}
<ul class="flex list-none flex-row">
{{ range .AllTranslations }}
<li class="ml-2">
<a
href="{{ .RelPermalink }}"
class="decoration-primary-500 hover:underline hover:decoration-2 hover:underline-offset-2"
>{{ site.Params.displayName | emojify }}</a
>
</li>
{{ if ne $currentLang .Lang }}
<li class="ml-2">
<a
href="{{ .RelPermalink }}"
class="decoration-primary-500 hover:underline hover:decoration-2 hover:underline-offset-2"
>{{ .Site.Params.displayName | emojify }}</a
>
</li>
{{ end }}
{{ end }}
</ul>
{{ end }}
3 changes: 3 additions & 0 deletions layouts/shortcodes/figure.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<img
class="mx-auto my-0 rounded-md"
alt="{{ $altText }}"
{{ if .Site.Params.enableImageLazyLoading | default true }}
loading="lazy"
{{ end }}
{{ if findRE "^https?" $url.Scheme }}
src="{{ $url.String }}"
{{ else }}
Expand Down
3 changes: 3 additions & 0 deletions layouts/shortcodes/screenshot.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
{{- if or (.Get "alt") (.Get "caption") }}
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify | plainify }}{{ end }}"
{{- end -}}
{{ if .Site.Params.enableImageLazyLoading | default true }}
loading="lazy"
{{ end }}
width="100%"
height="auto"
style="max-width:{{ div $image.Width 2 }}px; max-height:{{ div $image.Height 2 }}px;"
Expand Down
6 changes: 3 additions & 3 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ HUGO_THEME = "repo"
TZ = "Australia/Melbourne"

[context.production.environment]
HUGO_VERSION = "0.112.3"
HUGO_VERSION = "0.112.7"
HUGO_ENV = "production"

[context.deploy-preview]
command = "cd exampleSite && hugo --gc --minify -D -b $DEPLOY_PRIME_URL"

[context.deploy-preview.environment]
HUGO_VERSION = "0.112.3"
HUGO_VERSION = "0.112.7"

[context.branch-deploy]
command = "cd exampleSite && hugo --gc --minify -D -b $DEPLOY_PRIME_URL"

[context.branch-deploy.environment]
HUGO_VERSION = "0.112.3"
HUGO_VERSION = "0.112.7"
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hugo-congo-theme",
"version": "2.6.0",
"version": "2.6.1",
"description": "Congo theme for Hugo",
"scripts": {
"preinstall": "rimraf assets/lib",
Expand Down Expand Up @@ -33,7 +33,7 @@
"chart.js": "^4.3.0",
"fuse.js": "^6.6.2",
"katex": "^0.16.7",
"mermaid": "^10.2.0",
"mermaid": "^10.2.1",
"prettier": "^2.8.8",
"prettier-plugin-go-template": "^0.0.13",
"prettier-plugin-tailwindcss": "^0.3.0",
Expand Down