🔖 Release v2.0.3

pull/155/head v2.0.3
James Panther 2022-02-07 09:12:16 +11:00
commit 56ec1bf578
No known key found for this signature in database
GPG Key ID: D36F789E45745D17
11 changed files with 92 additions and 63 deletions

View File

@ -6,6 +6,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [Unreleased]
## [2.0.3] - 2022-02-07
### Changed
- Updated Turkish translation ([#105](https://github.com/jpanther/congo/pull/105))
- Updated Spanish translation ([#106](https://github.com/jpanther/congo/pull/106))
### Fixed
- Markdown images and `figure` shortcode fail to load resource when providing an external URL source
- HTML `figcaption` tags are output for Markdown images even when a caption is not provided
- Light appearance briefly appears on page load before switching to dark appearance ([#102](https://github.com/jpanther/congo/issues/102))
## [2.0.2] - 2022-02-05
### Changed
@ -299,7 +312,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.0.2...HEAD
[unreleased]: https://github.com/jpanther/congo/compare/v2.0.3...HEAD
[2.0.3]: https://github.com/jpanther/congo/compare/v2.0.2...v2.0.3
[2.0.2]: https://github.com/jpanther/congo/compare/v2.0.1...v2.0.2
[2.0.1]: https://github.com/jpanther/congo/compare/v2.0.0...v2.0.1
[2.0.0]: https://github.com/jpanther/congo/compare/v1.6.4...v2.0.0

View File

@ -1,4 +1,4 @@
/*! Congo v2.0.2 | MIT License | https://github.com/jpanther/congo */
/*! Congo v2.0.3 | MIT License | https://github.com/jpanther/congo */
/*! tailwindcss v3.0.18 | MIT License | https://tailwindcss.com */

View File

@ -1,4 +1,4 @@
/*! Congo v2.0.2 | MIT License | https://github.com/jpanther/congo */
/*! Congo v2.0.3 | MIT License | https://github.com/jpanther/congo */
@tailwind base;
@tailwind components;

View File

@ -2,7 +2,6 @@ const browserIsDark =
window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
const sitePreference = document.documentElement.getAttribute("data-default-appearance");
const userPreference = localStorage.getItem("appearance");
const switcher = document.getElementById("appearance-switcher");
if (
(browserIsDark && userPreference === null) ||
@ -25,6 +24,7 @@ if (document.documentElement.getAttribute("data-auto-appearance") === "true") {
}
window.addEventListener("DOMContentLoaded", (event) => {
const switcher = document.getElementById("appearance-switcher");
if (switcher) {
switcher.addEventListener("click", () => {
document.documentElement.classList.toggle("dark");

View File

@ -99,14 +99,14 @@ You can see some additional Chart.js examples on the [charts samples]({{< ref "c
Congo includes a `figure` shortcode for adding images to content. The shortcode replaces the base Hugo functionality in order to provide additional performance benefits.
Images included using `figure` will be optimised using Hugo Pipes and scaled in order to provide images appropriate to different device resolutions.
When a provided image is a page resource, it will be optimised using Hugo Pipes and scaled in order to provide images appropriate to different device resolutions. If a URL to an external image is provided, it will be included as-is without any image processing by Hugo.
The `figure` shortcode accepts six parameters:
<!-- prettier-ignore-start -->
|Parameter|Description|
|---|---|
|`src`|**Required.** The filename of the image. This image must be a [page resource](https://gohugo.io/content-management/page-resources/) bundled with the page.|
|`src`|**Required.** The filename or URL of the image. When providing a filename, this image must be a [page resource](https://gohugo.io/content-management/page-resources/) bundled with the page.|
|`alt`|[Alternative text description](https://moz.com/learn/seo/alt-text) for the image.|
|`caption`|Markdown for the image caption, which will be displayed below the image.|
|`class`|Additional CSS classes to apply to the image.|

View File

@ -8,7 +8,7 @@ article:
one: "{{ .Count }} min"
other: "{{ .Count }} mins"
reading_time_title: "Tiempo de lectura"
# table_of_contents: "Table of Contents"
table_of_contents: "Tabla de contenido"
word_count:
one: "{{ .Count }} palabra"
other: "{{ .Count }} palabras"
@ -16,9 +16,9 @@ article:
author:
byline_title: "Autor"
# code:
# copy: "Copy"
# copied: "Copied"
code:
copy: "Copiar"
copied: "Copiado"
error:
404_title: "Página no encontrada :confused:"
@ -34,14 +34,14 @@ list:
externalurl_title: "Link a página externa"
no_articles: "Aún no hay artículos para listar aquí."
# nav:
# scroll_to_top_title: "Scroll to top"
# skip_to_main: "Skip to main content"
nav:
scroll_to_top_title: "Ir arriba"
skip_to_main: "Ir al contenido"
# search:
# open_button_title: "Search (/)"
# close_button_title: "Close (Esc)"
# input_placeholder: "Search"
search:
open_button_title: "Buscar (/)"
close_button_title: "Cerrar (Esc)"
input_placeholder: "Buscar"
sharing:
email: "Enviar vía email"

View File

@ -1,7 +1,7 @@
article:
anchor_label: "Anchor"
# anchor_label: "Anchor"
date: "{{ .Date }}"
# date_updated: "Updated: {{ .Date }}"
date_updated: "Güncellendi: {{ .Date }}"
draft: "Taslak"
edit_title: "İçeriği düzenle"
reading_time:
@ -15,9 +15,9 @@ article:
author:
byline_title: "Yazar"
# code:
# copy: "Copy"
# copied: "Copied"
code:
copy: "Kopyala"
copied: "Kopyalandı"
error:
404_title: "Sayfa Bulunamadı :confused:"
@ -27,20 +27,20 @@ error:
footer:
dark_appearance: "Koyu görünüme geç"
light_appearance: "Açık görünüme geç"
powered_by: "{{ .Hugo }} &amp; {{ .Congo }} tarafından desteklenmektedir"
powered_by: "{{ .Hugo }} &amp; {{ .Congo }} tarafından desteklenmektedir."
list:
externalurl_title: "Harici siteye bağlantı"
no_articles: "Henüz burada listelenecek bir makale yok."
# nav:
# scroll_to_top_title: "Scroll to top"
# skip_to_main: "Skip to main content"
nav:
scroll_to_top_title: "Yukarı çık"
skip_to_main: "Ana içeriğe geç"
# search:
# open_button_title: "Search (/)"
# close_button_title: "Close (Esc)"
# input_placeholder: "Search"
search:
open_button_title: "Ara (/)"
close_button_title: "Kapat (Esc)"
input_placeholder: "Ara"
sharing:
email: "Email ile gönder"

View File

@ -1,6 +1,13 @@
{{ $url := urls.Parse .Destination }}
{{ $altText := .Text }}
{{ $caption := .Title }}
{{ with $.Page.Resources.GetMatch (.Destination) }}
{{ if findRE "^https?" $url.Scheme }}
<figure>
<img class="my-0 rounded-md" src="{{ $url.String }}" alt="{{ $altText }}" />
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
</figure>
{{ else }}
{{ with $.Page.Resources.GetMatch ($url.String) }}
<figure>
<img
class="my-0 rounded-md"
@ -12,8 +19,9 @@
src="{{ (.Resize "660x").RelPermalink }}"
alt="{{ $altText }}"
/>
<figcaption>{{ $caption | markdownify }}</figcaption>
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
</figure>
{{ else }}
{{ errorf `[CONGO] Markdown image error in "%s": Resource "%s" not found. Check the path is correct or remove the image from the content.` .Page.Path .Destination }}
{{ else }}
{{ errorf `[CONGO] Markdown image error in "%s": Resource "%s" not found. Check the path is correct or remove the image from the content.` .Page.Path $url.String }}
{{ end }}
{{ end }}

View File

@ -50,10 +50,9 @@
href="{{ $bundleCSS.RelPermalink }}"
integrity="{{ $bundleCSS.Data.Integrity }}"
/>
{{ if .Site.Params.enableAppearanceSwitching | default true }}
{{ $jsAppearance := resources.Get "js/appearance.js" }}
{{ $assets.Add "js" (slice $jsAppearance) }}
{{ end }}
{{ $jsAppearance = $jsAppearance | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsAppearance.RelPermalink }}" integrity="{{ $jsAppearance.Data.Integrity }}"></script>
{{ if .Site.Params.enableSearch | default false }}
{{ $jsFuse := resources.Get "lib/fuse/fuse.min.js" }}
{{ $jsSearch := resources.Get "js/search.js" }}

View File

@ -1,11 +1,18 @@
{{ if .Get "default" }}
{{ template "_internal/shortcodes/figure.html" . }}
{{ else }}
{{ $url := urls.Parse (.Get "src") }}
{{ $altText := .Get "alt" }}
{{ $caption := .Get "caption" }}
{{ $href := .Get "href" }}
{{ $class := .Get "class" }}
{{ with $.Page.Resources.GetMatch (.Get "src") }}
{{ if findRE "^https?" $url.Scheme }}
<figure>
<img class="my-0 rounded-md" src="{{ $url.String }}" alt="{{ $altText }}" />
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
</figure>
{{ else }}
{{ with $.Page.Resources.GetMatch ($url.String) }}
<figure {{ with $class }}class="{{ . }}"{{ end }}>
{{ with $href }}<a href="{{ . }}">{{ end }}
<img
@ -22,6 +29,7 @@
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
</figure>
{{ else }}
{{ errorf `[CONGO] Shortcode "figure" error in "%s": Resource "%s" not found. Check the path is correct or remove the shortcode.` .Page.Path (.Get "src") }}
{{ errorf `[CONGO] Shortcode "figure" error in "%s": Resource "%s" not found. Check the path is correct or remove the shortcode.` .Page.Path ($url.String) }}
{{ end }}
{{ end }}
{{ end }}

View File

@ -1,6 +1,6 @@
{
"name": "hugo-congo-theme",
"version": "2.0.2",
"version": "2.0.3",
"description": "Congo theme for Hugo",
"main": "index.js",
"scripts": {