Compare commits

...

27 Commits

Author SHA1 Message Date
stereobooster a8b660c73b
Merge a6fde7cba9 into cd675cfc55 2023-11-25 15:23:33 +11:00
James Panther cd675cfc55
Merge branch 'dev' of github.com:jpanther/congo into dev 2023-11-25 15:22:53 +11:00
James Panther 088b21795c
📝 Update changelog 2023-11-25 15:22:50 +11:00
James Panther ed0408da33
🔀 Merge pull request #699 from tomy0000000/dev
🛠 fix: Empty block when locale switcher is hidden (#678)
2023-11-25 14:47:02 +11:00
James Panther e9a69ec8e0
🔀 Merge pull request #714 from sorairolake/remove-execute-permission
Remove unnecessary execute permissions
2023-11-25 14:43:16 +11:00
James Panther 090de56037
📝 Update translation docs 2023-11-25 14:42:37 +11:00
James Panther b6a532c22f
🚚 Remove sub-variant from Bulgarian translation 2023-11-25 14:37:35 +11:00
James Panther 7c9fe0ef6f
🔀 Merge pull request #718 from MrEddX/MrEddX-bulgarian
🌐 Added Bulgarian Language
2023-11-25 14:36:43 +11:00
James Panther a968a781df
🔀 Merge pull request #703 from archdron/dev
Add Ukrainian Localization
2023-11-25 14:31:10 +11:00
James Panther 515d7bcad2
🔀 Merge pull request #696 from metbril/fix-nl
Fix typo in Dutch translation
2023-11-25 14:29:06 +11:00
James Panther e92f8e55fb
🔀 Merge pull request #697 from jpanther/dependabot/npm_and_yarn/mermaid-10.6.1
📌 Bump mermaid from 10.6.0 to 10.6.1
2023-11-25 14:27:02 +11:00
dependabot[bot] ca67e579a9 📦 Update packaged Mermaid 2023-11-25 03:25:03 +00:00
dependabot[bot] 99c45443cf
📌 Bump mermaid from 10.6.0 to 10.6.1
Bumps [mermaid](https://github.com/mermaid-js/mermaid) from 10.6.0 to 10.6.1.
- [Release notes](https://github.com/mermaid-js/mermaid/releases)
- [Changelog](https://github.com/mermaid-js/mermaid/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/mermaid-js/mermaid/compare/v10.6.0...v10.6.1)

---
updated-dependencies:
- dependency-name: mermaid
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-25 03:24:44 +00:00
MrEddX 56c7c9a466
Create bg-BG.yaml
Added: Bulgarian Language
2023-11-24 22:36:33 +02:00
James Panther 18e1edcf59
🔀 Merge pull request #709 from andreamortaro/add-my-blog
Add my blog to users list
2023-11-22 12:09:17 +11:00
James Panther 4aa68dd954
🔀 Merge pull request #708 from jpanther/dependabot/npm_and_yarn/prettier-3.1.0
📌 Bump prettier from 3.0.3 to 3.1.0
2023-11-22 12:07:57 +11:00
dependabot[bot] 69633d15b8
📌 Bump prettier from 3.0.3 to 3.1.0
Bumps [prettier](https://github.com/prettier/prettier) from 3.0.3 to 3.1.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.0.3...3.1.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-22 01:00:31 +00:00
James Panther 47f58668bb
🔀 Merge pull request #700 from jpanther/dependabot/npm_and_yarn/prettier-plugin-tailwindcss-0.5.7
📌 Bump prettier-plugin-tailwindcss from 0.5.6 to 0.5.7
2023-11-22 11:59:55 +11:00
Shun Sakai ef51b7c6de Remove unnecessary execute permissions 2023-11-21 11:07:11 +09:00
Andrea @nb-andrea a6bfb51437 updated users section (also .es and .ja) 2023-11-17 19:30:59 +01:00
Andrea @nb-andrea 365de08a37 added my blog in users section 2023-11-17 19:27:23 +01:00
Andrii Serbovets 1e5a789156 Add Ukrainian Localization
- initial Ukrainian localization
- the “few” and “many” forms added as appropriate
2023-11-10 20:06:26 +02:00
dependabot[bot] d1bf113a17
📌 Bump prettier-plugin-tailwindcss from 0.5.6 to 0.5.7
Bumps [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) from 0.5.6 to 0.5.7.
- [Release notes](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/compare/v0.5.6...v0.5.7)

---
updated-dependencies:
- dependency-name: prettier-plugin-tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-08 22:16:51 +00:00
Tomy Hsieh 0109db6173
🛠 fix: Empty block when locale switcher is hidden (#678) 2023-11-08 16:49:08 -05:00
Robert van Bregt 0cfab5dabb Fix typo 2023-11-06 19:17:06 +01:00
stereobooster a6fde7cba9 integrate in single.html 2023-10-31 18:14:03 +01:00
stereobooster fade430e88 Example of integration of picture partial 2023-10-31 17:53:15 +01:00
56 changed files with 304 additions and 154 deletions

View File

@ -6,6 +6,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [Unreleased] ## [Unreleased]
### Added
- Ukrainian translation ([#703](https://github.com/jpanther/congo/pull/703))
- Bulgarian translation ([#718](https://github.com/jpanther/congo/pull/718))
### Changed
- Updated Dutch translation ([#696](https://github.com/jpanther/congo/pull/696))
- Upgrade to Mermaid v10.6.1 ([#697](https://github.com/jpanther/congo/pull/697))
### Fixed
- Some files have unnecessary execute permissions ([#714](https://github.com/jpanther/congo/pull/714))
- Empty block is output when locale switcher is hidden ([#699](https://github.com/jpanther/congo/pull/699))
## [2.7.4] - 2023-11-05 ## [2.7.4] - 2023-11-05
### Fixed ### Fixed

File diff suppressed because one or more lines are too long

View File

@ -12,6 +12,7 @@ autoSwitchAppearance = true
enableSearch = false enableSearch = false
enableCodeCopy = false enableCodeCopy = false
enableImageLazyLoading = true enableImageLazyLoading = true
enableImageWebp = true
# robots = "" # robots = ""
fingerprintAlgorithm = "sha256" fingerprintAlgorithm = "sha256"

View File

@ -12,6 +12,7 @@ autoSwitchAppearance = true
enableSearch = true enableSearch = true
enableCodeCopy = true enableCodeCopy = true
enableImageLazyLoading = true enableImageLazyLoading = true
enableImageWebp = true
# robots = "" # robots = ""
fingerprintAlgorithm = "sha256" fingerprintAlgorithm = "sha256"

0
exampleSite/content/_index.es.md 100755 → 100644
View File

0
exampleSite/content/_index.md 100755 → 100644
View File

View File

View File

@ -53,6 +53,7 @@ Congoは現在、以下の言語に対応しています:
| :gb: **English (default)** | `en` | | :gb: **English (default)** | `en` |
| :egypt: Arabic | `ar` | | :egypt: Arabic | `ar` |
| :bangladesh: Bengali | `bn` | | :bangladesh: Bengali | `bn` |
| :bulgaria: Bulgarian | `bg` |
| :cn: Chinese - Simplified (China) | `zh-cn` | | :cn: Chinese - Simplified (China) | `zh-cn` |
| :taiwan: Chinese - Traditional (Taiwan) | `zh-tw` | | :taiwan: Chinese - Traditional (Taiwan) | `zh-tw` |
| :flag-cz: Czech | `cs` | | :flag-cz: Czech | `cs` |
@ -73,6 +74,7 @@ Congoは現在、以下の言語に対応しています:
| :slovakia: Slovak | `sk` | | :slovakia: Slovak | `sk` |
| :es: Spanish (Spain) | `es` | | :es: Spanish (Spain) | `es` |
| :tr: Turkish | `tr` | | :tr: Turkish | `tr` |
| :ukraine: Ukrainian | `uk` |
翻訳文字列を含むカスタムファイルを `i18n/[code].yaml` に作成することでデフォルトの翻訳をオーバーライドできます。このメソッドを使って新しい言語を追加することもできます。新しい翻訳をコミュニティと共有したい場合、[Pull Request](https://github.com/jpanther/congo/pulls)を作ってください。 翻訳文字列を含むカスタムファイルを `i18n/[code].yaml` に作成することでデフォルトの翻訳をオーバーライドできます。このメソッドを使って新しい言語を追加することもできます。新しい翻訳をコミュニティと共有したい場合、[Pull Request](https://github.com/jpanther/congo/pulls)を作ってください。

View File

@ -53,6 +53,7 @@ The theme currently supports the following languages out of the box:
| :gb: **English (default)** | `en` | | :gb: **English (default)** | `en` |
| :egypt: Arabic | `ar` | | :egypt: Arabic | `ar` |
| :bangladesh: Bengali | `bn` | | :bangladesh: Bengali | `bn` |
| :bulgaria: Bulgarian | `bg` |
| :cn: Chinese - Simplified (China) | `zh-cn` | | :cn: Chinese - Simplified (China) | `zh-cn` |
| :taiwan: Chinese - Traditional (Taiwan) | `zh-tw` | | :taiwan: Chinese - Traditional (Taiwan) | `zh-tw` |
| :flag-cz: Czech | `cs` | | :flag-cz: Czech | `cs` |
@ -73,6 +74,7 @@ The theme currently supports the following languages out of the box:
| :slovakia: Slovak | `sk` | | :slovakia: Slovak | `sk` |
| :es: Spanish (Spain) | `es` | | :es: Spanish (Spain) | `es` |
| :tr: Turkish | `tr` | | :tr: Turkish | `tr` |
| :ukraine: Ukrainian | `uk` |
The default translations can be overridden by creating a custom file in `i18n/[code].yaml` that contains the translation strings. You can also use this method to add new languages. If you'd like to share a new translation with the community, please [open a pull request](https://github.com/jpanther/congo/pulls). The default translations can be overridden by creating a custom file in `i18n/[code].yaml` that contains the translation strings. You can also use this method to add new languages. If you'd like to share a new translation with the community, please [open a pull request](https://github.com/jpanther/congo/pulls).

View File

View File

View File

View File

View File

View File

View File

View File

View File

0
exampleSite/content/samples/external/index.md vendored 100755 → 100644
View File

View File

View File

View File

View File

View File

@ -44,7 +44,7 @@ La lista a continuación es solo un puñado de sitios web creados con el tema Co
| [medical-humanities](https://medical-humanities.org) | Academic site | | [medical-humanities](https://medical-humanities.org) | Academic site |
| [boyersnet.com](https://boyersnet.com) | Personal site and Blog | | [boyersnet.com](https://boyersnet.com) | Personal site and Blog |
| [major.io](https://major.io) | Personal site and Blog | | [major.io](https://major.io) | Personal site and Blog |
| [顾宇的博客](https://www.guyu.me/) | Personal Blog (in Chinese) | | [顾宇的博客](https://www.guyu.me/) | Personal Blog (in Chinese) |
| [cgutierr-zgz.github.io](https://cgutierr-zgz.github.io/) | Personal site and Tech blog | | [cgutierr-zgz.github.io](https://cgutierr-zgz.github.io/) | Personal site and Tech blog |
| [adam.sr](https://adam.sr) | Personal site and Blog | | [adam.sr](https://adam.sr) | Personal site and Blog |
| [kpavlov.me](https://kpavlov.me) | Personal site and Blog | | [kpavlov.me](https://kpavlov.me) | Personal site and Blog |
@ -63,5 +63,6 @@ La lista a continuación es solo un puñado de sitios web creados con el tema Co
| [Beerjoa Blog](https://blog.beerjoa.dev) | Personal site and Blog | | [Beerjoa Blog](https://blog.beerjoa.dev) | Personal site and Blog |
| [simaosilva.com](https://simaosilva.com) | Personal Site | | [simaosilva.com](https://simaosilva.com) | Personal Site |
| [kom.al](https://kom.al) | Personal Site | | [kom.al](https://kom.al) | Personal Site |
| [andrea.mortaro.it](https://andrea.mortaro.it) | Personal Site and Blog |
**¿Usuaria de congo?** Para agregar tu sitio a esta lista, [haz un pull request](https://github.com/jpanther/congo/blob/dev/exampleSite/content/users/index.md). **¿Usuaria de congo?** Para agregar tu sitio a esta lista, [haz un pull request](https://github.com/jpanther/congo/blob/dev/exampleSite/content/users/index.md).

View File

@ -44,7 +44,7 @@ Congoを使用して構築された実際のウェブサイト。
| [medical-humanities](https://medical-humanities.org) | Academic site | | [medical-humanities](https://medical-humanities.org) | Academic site |
| [boyersnet.com](https://boyersnet.com) | Personal site and Blog | | [boyersnet.com](https://boyersnet.com) | Personal site and Blog |
| [major.io](https://major.io) | Personal site and Blog | | [major.io](https://major.io) | Personal site and Blog |
| [顾宇的博客](https://www.guyu.me/) | Personal Blog (in Chinese) | | [顾宇的博客](https://www.guyu.me/) | Personal Blog (in Chinese) |
| [cgutierr-zgz.github.io](https://cgutierr-zgz.github.io/) | Personal site and Tech blog | | [cgutierr-zgz.github.io](https://cgutierr-zgz.github.io/) | Personal site and Tech blog |
| [adam.sr](https://adam.sr) | Personal site and Blog | | [adam.sr](https://adam.sr) | Personal site and Blog |
| [kpavlov.me](https://kpavlov.me) | Personal site and Blog | | [kpavlov.me](https://kpavlov.me) | Personal site and Blog |
@ -63,5 +63,6 @@ Congoを使用して構築された実際のウェブサイト。
| [Beerjoa Blog](https://blog.beerjoa.dev) | Personal site and Blog | | [Beerjoa Blog](https://blog.beerjoa.dev) | Personal site and Blog |
| [simaosilva.com](https://simaosilva.com) | Personal Site | | [simaosilva.com](https://simaosilva.com) | Personal Site |
| [kom.al](https://kom.al) | Personal Site | | [kom.al](https://kom.al) | Personal Site |
| [andrea.mortaro.it](https://andrea.mortaro.it) | Personal Site and Blog |
**Congoを使っていますか** あなたのウェブサイトを加えるために[Pull Request](https://github.com/jpanther/congo/blob/dev/exampleSite/content/users/index.md)を投げてください。 **Congoを使っていますか** あなたのウェブサイトを加えるために[Pull Request](https://github.com/jpanther/congo/blob/dev/exampleSite/content/users/index.md)を投げてください。

View File

@ -44,7 +44,7 @@ The list below is just a handful of the websites that are built using the Congo
| [medical-humanities](https://medical-humanities.org) | Academic site | | [medical-humanities](https://medical-humanities.org) | Academic site |
| [boyersnet.com](https://boyersnet.com) | Personal site and Blog | | [boyersnet.com](https://boyersnet.com) | Personal site and Blog |
| [major.io](https://major.io) | Personal site and Blog | | [major.io](https://major.io) | Personal site and Blog |
| [顾宇的博客](https://www.guyu.me/) | Personal Blog (in Chinese) | | [顾宇的博客](https://www.guyu.me/) | Personal Blog (in Chinese) |
| [cgutierr-zgz.github.io](https://cgutierr-zgz.github.io/) | Personal site and Tech blog | | [cgutierr-zgz.github.io](https://cgutierr-zgz.github.io/) | Personal site and Tech blog |
| [adam.sr](https://adam.sr) | Personal site and Blog | | [adam.sr](https://adam.sr) | Personal site and Blog |
| [kpavlov.me](https://kpavlov.me) | Personal site and Blog | | [kpavlov.me](https://kpavlov.me) | Personal site and Blog |
@ -63,5 +63,6 @@ The list below is just a handful of the websites that are built using the Congo
| [Beerjoa Blog](https://blog.beerjoa.dev) | Personal site and Blog | | [Beerjoa Blog](https://blog.beerjoa.dev) | Personal site and Blog |
| [simaosilva.com](https://simaosilva.com) | Personal Site | | [simaosilva.com](https://simaosilva.com) | Personal Site |
| [kom.al](https://kom.al) | Personal Site | | [kom.al](https://kom.al) | Personal Site |
| [andrea.mortaro.it](https://andrea.mortaro.it) | Personal Site and Blog |
**Congo user?** To add your site to this list, [submit a pull request](https://github.com/jpanther/congo/blob/dev/exampleSite/content/users/index.md). **Congo user?** To add your site to this list, [submit a pull request](https://github.com/jpanther/congo/blob/dev/exampleSite/content/users/index.md).

56
i18n/bg.yaml 100644
View File

@ -0,0 +1,56 @@
article:
anchor_label: "Котва"
date: "{{ .Date }}"
date_updated: "Обновено: {{ .Date }}"
draft: "Чернова"
edit_title: "Редактиране на съдържание"
reading_time:
one: "{{ .Count }} минута"
other: "{{ .Count }} минути"
reading_time_title: "Време за четене"
table_of_contents: "Съдържание"
word_count:
one: "{{ .Count }} дума"
other: "{{ .Count }} думи"
author:
byline_title: "Автор"
code:
copy: "Копирай"
copied: "Копирано"
error:
404_title: "Страницата не е намерена :confused:"
404_error: "Грешка 404"
404_description: "Изглежда, че страницата, която търсите не съществува."
footer:
dark_appearance: "Превключи към тъмна тема"
light_appearance: "Превключи към светла тема"
powered_by: "Осъществено чрез {{ .Hugo }} &amp; {{ .Congo }}"
list:
externalurl_title: "Връзка към външен сайт"
no_articles: "Тук няма статии за прелистване."
nav:
scroll_to_top_title: "Превърти до началото"
skip_to_main: "Преминаване към основното съдържание"
search:
open_button_title: "Търсене (/)"
close_button_title: "Затвори (Esc)"
input_placeholder: "Търси"
sharing:
email: "Изпращане по имейл"
facebook: "Споделяне във Facebook"
linkedin: "Споделяне в LinkedIn"
mastodon: "Публикуване в Mastodon"
pinterest: "Пин в Pinterest"
reddit: "Публикуване в Reddit"
twitter: "Туит в Twitter"
shortcode:
recent_articles: "Последни"

View File

@ -1,7 +1,7 @@
article: article:
anchor_label: "Anker" anchor_label: "Anker"
date: "{{ .Date }}" date: "{{ .Date }}"
date_updated: "Bijgwerkt: {{ .Date }}" date_updated: "Bijgewerkt: {{ .Date }}"
draft: "Concept" draft: "Concept"
edit_title: "Bewerk inhoud" edit_title: "Bewerk inhoud"
reading_time: reading_time:

60
i18n/uk.yaml 100644
View File

@ -0,0 +1,60 @@
article:
anchor_label: "Закладка"
date: "{{ .Date }}"
date_updated: "Оновлено {{ .Date }}"
draft: "Чернетка"
edit_title: "Редагувати"
reading_time:
one: "{{ .Count }} хвилину"
few: "{{ .Count }} хвилини"
many: "{{ .Count }} хвилин"
other: "{{ .Count }} хвилини"
reading_time_title: "Прочитаєте за"
table_of_contents: "Зміст"
word_count:
one: "{{ .Count }} слово"
few: "{{ .Count }} слова"
many: "{{ .Count }} слів"
other: "{{ .Count }} слова"
author:
byline_title: "Автор"
code:
copy: "Копіювати"
copied: "Скопійовано"
error:
404_title: "Немає такої сторінки :confused:"
404_error: "Помилка 404"
404_description: "Здається, сторінки, яка вам потрібна, не існує."
footer:
dark_appearance: "Увімкнути темний режим"
light_appearance: "Увімкнути світлий режим"
powered_by: "Сайт працює на рушії {{ .Hugo }} зі стилем {{ .Congo }}"
list:
externalurl_title: "Зовнішнє посилання"
no_articles: "Дописів поки що немає"
nav:
scroll_to_top_title: "Повернутися на початок сторінки"
skip_to_main: "До тексту"
search:
open_button_title: "Шукати (/)"
close_button_title: "Закрити (Esc)"
input_placeholder: "Введіть запит тут"
sharing:
email: "Надіслати електронною поштою"
facebook: "Поширити на Facebook"
linkedin: "Поширити на LinkedIn"
mastodon: "Поширити на Mastodon"
pinterest: "Зберегти на Pinterest"
reddit: "Опублікувати на Reddit"
twitter: "Поширити на Twitter"
shortcode:
recent_articles: "Недавні дописи"

View File

@ -1,64 +1,20 @@
{{ $url := urls.Parse .Destination }} {{ $url := urls.Parse .Destination }}
{{ $altText := .Text }} {{ $altText := .Text }}
{{ $caption := .Title }} {{ $caption := .Title }}
{{ $lazyLoad := $.Page.Site.Params.enableImageLazyLoading | default true }} {{ $class := "mx-auto my-0 rounded-md" }}
{{ if findRE "^https?" $url.Scheme }}
<figure> {{ $file := $url.Path }}
<img {{ $img := .Page.Resources.GetMatch $file }}
class="mx-auto my-0 rounded-md" {{- if and (not $img) .Page.File }}
src="{{ $url.String }}" {{ $path := path.Join .Page.File.Dir $file }}
alt="{{ $altText }}" {{ $img = resources.Get $path }}
{{ if $lazyLoad }} {{ end -}}
loading="lazy"
{{ end }} <figure>
/> {{- with $img -}}
{{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }} {{ partial "pictureDefaults.html" (dict "img" . "alt" $altText "class" $class) }}
</figure> {{- else -}}
{{ else }} <img src="{{ .Destination | safeURL }}" alt="{{ $altText }}" class="{{ $class }}"/>
{{ $resource := "" }} {{- end -}}
{{ if $.Page.Resources.GetMatch ($url.String) }} {{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }}
{{ $resource = $.Page.Resources.GetMatch ($url.String) }} </figure>
{{ else if resources.GetMatch ($url.String) }}
{{ $resource = resources.Get ($url.String) }}
{{ end }}
{{ with $resource }}
<figure>
<img
class="mx-auto my-0 rounded-md"
{{ if eq .MediaType.SubType "svg" }}
src="{{ .RelPermalink }}"
{{ else }}
width="{{ .Width }}"
height="{{ .Height }}"
{{ if lt .Width 660 }}
src="{{ .RelPermalink }}"
{{ else }}
srcset="
{{- (.Resize "330x").RelPermalink }} 330w,
{{- (.Resize "660x").RelPermalink }} 660w,
{{- (.Resize "1024x").RelPermalink }} 1024w,
{{- (.Resize "1320x").RelPermalink }} 2x"
src="{{ (.Resize "660x").RelPermalink }}"
{{ 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 }}"
{{ if $lazyLoad }}
loading="lazy"
{{ end }}
/>
{{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }}
</figure>
{{ end }}
{{ end }}

View File

@ -15,25 +15,9 @@
</div> </div>
{{ with $feature }} {{ with $feature }}
<div class="prose"> <div class="prose">
<img {{ $altText := $.Params.featureAlt | default $.Params.coverAlt | default "" }}
class="mb-6 -mt-4 rounded-md" {{ $class := "mb-6 -mt-4 rounded-md" }}
{{ if eq .MediaType.SubType "svg" }} {{ partial "pictureDefaults.html" (dict "img" . "alt" $altText "class" $class) }}
src="{{ .RelPermalink }}"
{{ else }}
width="{{ .Width }}"
height="{{ .Height }}"
{{ if lt .Width 660 }}
src="{{ .RelPermalink }}"
{{ else }}
srcset="
{{- (.Resize "330x").RelPermalink }} 330w,
{{- (.Resize "660x").RelPermalink }} 660w,
{{- (.Resize "1024x").RelPermalink }} 1024w,
{{- (.Resize "1320x").RelPermalink }} 2x"
{{ end }}
{{ end }}
alt="{{ $.Params.featureAlt | default $.Params.coverAlt | default "" }}"
/>
{{ with $.Params.coverCaption }} {{ with $.Params.coverCaption }}
<figcaption class="mb-6 -mt-3 text-center">{{ . | markdownify }}</figcaption> <figcaption class="mb-6 -mt-3 text-center">{{ . | markdownify }}</figcaption>
{{ end }} {{ end }}

View File

@ -4,7 +4,7 @@
<nav class="pb-4 text-base font-medium text-neutral-500 dark:text-neutral-400"> <nav class="pb-4 text-base font-medium text-neutral-500 dark:text-neutral-400">
<ul class="flex flex-col list-none sm:flex-row"> <ul class="flex flex-col list-none sm:flex-row">
{{ range .Site.Menus.footer }} {{ range .Site.Menus.footer }}
{{ if and (eq .Params.action "locale") (and (not page.IsTranslated) (not site.IsMultiLingual)) }} {{ if and (eq .Params.action "locale") (or (not page.IsTranslated) (not site.IsMultiLingual)) }}
{{ continue }} {{ continue }}
{{ end }} {{ end }}
<li class="mb-1 group text-end sm:mb-0 sm:me-7 sm:last:me-0"> <li class="mb-1 group text-end sm:mb-0 sm:me-7 sm:last:me-0">

View File

@ -9,7 +9,7 @@
<ul class="flex flex-col list-none text-end sm:flex-row"> <ul class="flex flex-col list-none text-end sm:flex-row">
{{ if .Site.Menus.main }} {{ if .Site.Menus.main }}
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
{{ if and (eq .Params.action "locale") (and (not page.IsTranslated) (not site.IsMultiLingual)) }} {{ if and (eq .Params.action "locale") (or (not page.IsTranslated) (not site.IsMultiLingual)) }}
{{ continue }} {{ continue }}
{{ end }} {{ end }}
<li class="group mb-1 sm:mb-0 sm:me-7 sm:last:me-0.5"> <li class="group mb-1 sm:mb-0 sm:me-7 sm:last:me-0.5">

View File

@ -25,7 +25,7 @@
</li> </li>
{{ if .Site.Menus.main }} {{ if .Site.Menus.main }}
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
{{ if and (eq .Params.action "locale") (and (not page.IsTranslated) (not site.IsMultiLingual)) }} {{ if and (eq .Params.action "locale") (or (not page.IsTranslated) (not site.IsMultiLingual)) }}
{{ continue }} {{ continue }}
{{ end }} {{ end }}
<li class="mb-1 group"> <li class="mb-1 group">

View File

@ -25,7 +25,7 @@
</li> </li>
{{ if .Site.Menus.main }} {{ if .Site.Menus.main }}
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
{{ if and (eq .Params.action "locale") (and (not page.IsTranslated) (not site.IsMultiLingual)) }} {{ if and (eq .Params.action "locale") (or (not page.IsTranslated) (not site.IsMultiLingual)) }}
{{ continue }} {{ continue }}
{{ end }} {{ end }}
<li class="mb-1 group"> <li class="mb-1 group">
@ -129,7 +129,7 @@
<ul class="flex-row hidden list-none text-end sm:flex"> <ul class="flex-row hidden list-none text-end sm:flex">
{{ if .Site.Menus.main }} {{ if .Site.Menus.main }}
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
{{ if and (eq .Params.action "locale") (and (not page.IsTranslated) (not site.IsMultiLingual)) }} {{ if and (eq .Params.action "locale") (or (not page.IsTranslated) (not site.IsMultiLingual)) }}
{{ continue }} {{ continue }}
{{ end }} {{ end }}
<li class="mb-1 group sm:mb-0 sm:me-7 sm:last:me-0"> <li class="mb-1 group sm:mb-0 sm:me-7 sm:last:me-0">

View File

@ -0,0 +1,85 @@
{{ $img := .img }}
{{ $alt := .alt }}
{{ $class := .class }}
{{ $lazy := .lazy }}
{{ $webp := .webp }}
{{ $lqip := .lqip }}
{{ with $img }}
{{ if (eq .MediaType.SubType "svg") }}
{{ $width := ""}}
{{ $height := ""}}
{{ $svgContent := .Content }}
{{ range (findRESubmatch `<svg[^>]*width=["']([.0-9]*)["'a-zA-Z]` $svgContent 1) }}
{{ $width = index . 1 }}
{{ end }}
{{ range (findRESubmatch `<svg[^>]*height=["']([.0-9]*)["'a-zA-Z]` $svgContent 1) }}
{{ $height = index . 1 }}
{{ end }}
{{ if (eq "" $width $height) }}
{{ range (findRESubmatch `<svg[^>]*viewBox=["']?([.0-9]*) ([.0-9]*) ([.0-9]*) ([.0-9]*)` $svgContent 1) }}
{{ $width = index . 3 }}
{{ $height = index . 4 }}
{{ end }}
{{ end }}
{{ if (eq "" $width $height) }}
{{ warnf "Can't detect width and height for SVG %s" .RelPermalink }}
{{/* do not use lazy without dimensions */}}
{{ $lazy = false }}
{{ end }}
<picture {{ with $class }} class="{{ . }}" {{ end }}>
<img
src="{{ .RelPermalink }}"
{{ with $width }} width="{{ . }}" {{ end }}
{{ with $height }} height="{{ . }}" {{ end }}
{{ with $class }} class="{{ . }}" {{ end }}
{{ with $alt }} alt="{{ . }}" {{ end }}
{{ with $lazy }} loading="lazy" decoding="async" {{ end }}
>
</picture>
{{ else }}
<picture
{{ with $class }} class="{{ . }}" {{ end }}
{{ if $lqip }}
{{ $bg := (.Resize "20x webp q20").Content | base64Encode }}
style="background-image:url(data:image/webp;base64,{{ $bg }});background-size:cover"
{{ end }}
>
{{ if $webp }}
<source
{{ if lt .Width 660 }}
{{ with .Resize (printf "%dx%d webp" .Width .Height) }}
src="{{ .RelPermalink }}"
{{ end }}
{{ else }}
srcset="
{{- (.Resize "330x webp").RelPermalink }} 330w,
{{- (.Resize "660x webp").RelPermalink }} 660w,
{{- (.Resize "1024x webp").RelPermalink }} 1024w,
{{- (.Resize "1320x webp").RelPermalink }} 2x"
src="{{ (.Resize "660x webp").RelPermalink }}"
{{ end }}
type="image/webp"
/>
{{ end }}
<img
src="{{ .RelPermalink }}"
width="{{ .Width }}"
height="{{ .Height }}"
{{ with $class }} class="{{ . }}" {{ end }}
{{ with $alt }} alt="{{ . }}" {{ end }}
{{ with $lazy }} loading="lazy" decoding="async" {{ end }}
{{ if lt .Width 660 }}
src="{{ .RelPermalink }}"
{{ else }}
srcset="
{{- (.Resize "330x").RelPermalink }} 330w,
{{- (.Resize "660x").RelPermalink }} 660w,
{{- (.Resize "1024x").RelPermalink }} 1024w,
{{- (.Resize "1320x").RelPermalink }} 2x"
src="{{ (.Resize "660x").RelPermalink }}"
{{ end }}
>
</picture>
{{ end }}
{{ end }}

View File

@ -0,0 +1,7 @@
{{ $img := .img }}
{{ $alt := .alt }}
{{ $class := .class }}
{{ $lazy := $.Page.Site.Params.enableImageLazyLoading | default true }}
{{ $webp := $.Page.Site.Params.enableImageWebp | default true }}
{{ $lqip := false }}
{{ partial "picture.html" (dict "img" $img "alt" $alt "class" $class "lazy" $lazy "webp" $webp "lqip" $lqip) }}

View File

@ -6,45 +6,23 @@
{{ $caption := .Get "caption" }} {{ $caption := .Get "caption" }}
{{ $href := .Get "href" }} {{ $href := .Get "href" }}
{{ $class := .Get "class" }} {{ $class := .Get "class" }}
{{ $file := $url.Path }}
{{ $img := .Page.Resources.GetMatch $file }}
{{- if and (not $img) .Page.File }}
{{ $path := path.Join .Page.File.Dir $file }}
{{ $img = resources.Get $path }}
{{ end -}}
<figure{{ with $class }} class="{{ . }}"{{ end }}> <figure{{ with $class }} class="{{ . }}"{{ end }}>
{{ with $href }}<a href="{{ . }}">{{ end }} {{ with $href }}<a href="{{ . }}">{{ end }}
<img
class="mx-auto my-0 rounded-md" {{- with $img -}}
alt="{{ $altText }}" {{ partial "pictureDefaults.html" (dict "img" . "alt" $altText "class" $class) }}
{{ if .Site.Params.enableImageLazyLoading | default true }} {{- else -}}
loading="lazy" <img src="{{ $url.String }}" alt="{{ $altText }}" class="{{ $class }}"/>
{{ end }} {{- end -}}
{{ if findRE "^https?" $url.Scheme }}
src="{{ $url.String }}"
{{ else }}
{{ $resource := "" }}
{{ if $.Page.Resources.GetMatch ($url.String) }}
{{ $resource = $.Page.Resources.GetMatch ($url.String) }}
{{ else if resources.GetMatch ($url.String) }}
{{ $resource = resources.Get ($url.String) }}
{{ end }}
{{ with $resource }}
{{ if eq .MediaType.SubType "svg" }}
src="{{ .RelPermalink }}"
{{ else }}
width="{{ .Width }}"
height="{{ .Height }}"
{{ if lt .Width 660 }}
src="{{ .RelPermalink }}"
{{ else }}
srcset="
{{- (.Resize "330x").RelPermalink }} 330w,
{{- (.Resize "660x").RelPermalink }} 660w,
{{- (.Resize "1024x").RelPermalink }} 1024w,
{{- (.Resize "1320x").RelPermalink }} 2x"
src="{{ (.Resize "660x").RelPermalink }}"
{{ end }}
{{ end }}
{{ else }}
src="{{ $url.String }}"
{{ end }}
{{ end }}
/>
{{ with $href }}</a>{{ end }} {{ with $href }}</a>{{ end }}
{{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }} {{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }}
</figure> </figure>

46
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "hugo-congo-theme", "name": "hugo-congo-theme",
"version": "2.7.1", "version": "2.7.4",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "hugo-congo-theme", "name": "hugo-congo-theme",
"version": "2.7.1", "version": "2.7.4",
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
@ -14,10 +14,10 @@
"chart.js": "^4.4.0", "chart.js": "^4.4.0",
"fuse.js": "^7.0.0", "fuse.js": "^7.0.0",
"katex": "^0.16.9", "katex": "^0.16.9",
"mermaid": "^10.6.0", "mermaid": "^10.6.1",
"prettier": "^3.0.3", "prettier": "^3.1.0",
"prettier-plugin-go-template": "^0.0.15", "prettier-plugin-go-template": "^0.0.15",
"prettier-plugin-tailwindcss": "^0.5.6", "prettier-plugin-tailwindcss": "^0.5.7",
"rimraf": "^5.0.5", "rimraf": "^5.0.5",
"tailwindcss": "^3.3.5", "tailwindcss": "^3.3.5",
"vendor-copy": "^3.0.1" "vendor-copy": "^3.0.1"
@ -1489,9 +1489,9 @@
} }
}, },
"node_modules/mermaid": { "node_modules/mermaid": {
"version": "10.6.0", "version": "10.6.1",
"resolved": "https://registry.npmjs.org/mermaid/-/mermaid-10.6.0.tgz", "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-10.6.1.tgz",
"integrity": "sha512-Hcti+Q2NiWnb2ZCijSX89Bn2i7TCUwosBdIn/d+u63Sz7y40XU6EKMctT4UX4qZuZGfKGZpfOeim2/KTrdR7aQ==", "integrity": "sha512-Hky0/RpOw/1il9X8AvzOEChfJtVvmXm+y7JML5C//ePYMy0/9jCEmW1E1g86x9oDfW9+iVEdTV/i+M6KWRNs4A==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@braintree/sanitize-url": "^6.0.1", "@braintree/sanitize-url": "^6.0.1",
@ -2312,9 +2312,9 @@
"dev": true "dev": true
}, },
"node_modules/prettier": { "node_modules/prettier": {
"version": "3.0.3", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.0.tgz",
"integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", "integrity": "sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==",
"dev": true, "dev": true,
"bin": { "bin": {
"prettier": "bin/prettier.cjs" "prettier": "bin/prettier.cjs"
@ -2342,9 +2342,9 @@
} }
}, },
"node_modules/prettier-plugin-tailwindcss": { "node_modules/prettier-plugin-tailwindcss": {
"version": "0.5.6", "version": "0.5.7",
"resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.5.6.tgz", "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.5.7.tgz",
"integrity": "sha512-2Xgb+GQlkPAUCFi3sV+NOYcSI5XgduvDBL2Zt/hwJudeKXkyvRS65c38SB0yb9UB40+1rL83I6m0RtlOQ8eHdg==", "integrity": "sha512-4v6uESAgwCni6YF6DwJlRaDjg9Z+al5zM4JfngcazMy4WEf/XkPS5TEQjbD+DZ5iNuG6RrKQLa/HuX2SYzC3kQ==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">=14.21.3" "node": ">=14.21.3"
@ -4221,9 +4221,9 @@
"dev": true "dev": true
}, },
"mermaid": { "mermaid": {
"version": "10.6.0", "version": "10.6.1",
"resolved": "https://registry.npmjs.org/mermaid/-/mermaid-10.6.0.tgz", "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-10.6.1.tgz",
"integrity": "sha512-Hcti+Q2NiWnb2ZCijSX89Bn2i7TCUwosBdIn/d+u63Sz7y40XU6EKMctT4UX4qZuZGfKGZpfOeim2/KTrdR7aQ==", "integrity": "sha512-Hky0/RpOw/1il9X8AvzOEChfJtVvmXm+y7JML5C//ePYMy0/9jCEmW1E1g86x9oDfW9+iVEdTV/i+M6KWRNs4A==",
"dev": true, "dev": true,
"requires": { "requires": {
"@braintree/sanitize-url": "^6.0.1", "@braintree/sanitize-url": "^6.0.1",
@ -4705,9 +4705,9 @@
"dev": true "dev": true
}, },
"prettier": { "prettier": {
"version": "3.0.3", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.0.tgz",
"integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", "integrity": "sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==",
"dev": true "dev": true
}, },
"prettier-plugin-go-template": { "prettier-plugin-go-template": {
@ -4720,9 +4720,9 @@
} }
}, },
"prettier-plugin-tailwindcss": { "prettier-plugin-tailwindcss": {
"version": "0.5.6", "version": "0.5.7",
"resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.5.6.tgz", "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.5.7.tgz",
"integrity": "sha512-2Xgb+GQlkPAUCFi3sV+NOYcSI5XgduvDBL2Zt/hwJudeKXkyvRS65c38SB0yb9UB40+1rL83I6m0RtlOQ8eHdg==", "integrity": "sha512-4v6uESAgwCni6YF6DwJlRaDjg9Z+al5zM4JfngcazMy4WEf/XkPS5TEQjbD+DZ5iNuG6RrKQLa/HuX2SYzC3kQ==",
"dev": true, "dev": true,
"requires": {} "requires": {}
}, },

View File

@ -33,10 +33,10 @@
"chart.js": "^4.4.0", "chart.js": "^4.4.0",
"fuse.js": "^7.0.0", "fuse.js": "^7.0.0",
"katex": "^0.16.9", "katex": "^0.16.9",
"mermaid": "^10.6.0", "mermaid": "^10.6.1",
"prettier": "^3.0.3", "prettier": "^3.1.0",
"prettier-plugin-go-template": "^0.0.15", "prettier-plugin-go-template": "^0.0.15",
"prettier-plugin-tailwindcss": "^0.5.6", "prettier-plugin-tailwindcss": "^0.5.7",
"rimraf": "^5.0.5", "rimraf": "^5.0.5",
"tailwindcss": "^3.3.5", "tailwindcss": "^3.3.5",
"vendor-copy": "^3.0.1" "vendor-copy": "^3.0.1"

0
static/android-chrome-192x192.png 100755 → 100644
View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

0
static/android-chrome-512x512.png 100755 → 100644
View File

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

0
static/apple-touch-icon.png 100755 → 100644
View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

0
static/favicon-16x16.png 100755 → 100644
View File

Before

Width:  |  Height:  |  Size: 229 B

After

Width:  |  Height:  |  Size: 229 B

0
static/favicon-32x32.png 100755 → 100644
View File

Before

Width:  |  Height:  |  Size: 307 B

After

Width:  |  Height:  |  Size: 307 B

0
static/favicon.ico 100755 → 100644
View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

0
static/site.webmanifest 100755 → 100644
View File