Skip to content

Commit

Permalink
🔖 Release v2.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jpanther committed Nov 22, 2022
2 parents 6c14222 + cd507ce commit 572885c
Show file tree
Hide file tree
Showing 13 changed files with 174 additions and 83 deletions.
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [2.4.2] - 2022-11-22

### Added

- Dutch translation ([#371](https://github.com/jpanther/congo/pull/371))
- HTML `theme-color` meta tag to adjust browser colours according to the active Congo colour scheme ([#379](https://github.com/jpanther/congo/pull/379))

### Changed

- Extended head and footer partials are no longer cached during builds
- Upgrade to Chart.js v4.0.1 ([#373](https://github.com/jpanther/congo/pull/373))

### Fixed

- Code highlight background cut off when overflowing content area ([#374](https://github.com/jpanther/congo/issues/374))
- 'Description' HTML meta tag not set from article description ([#378](https://github.com/jpanther/congo/issues/378))

## [2.4.1] - 2022-11-14

### Changed
Expand Down Expand Up @@ -553,7 +570,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.4.1...HEAD
[unreleased]: https://github.com/jpanther/congo/compare/v2.4.2...HEAD
[2.4.2]: https://github.com/jpanther/congo/compare/v2.4.1...v2.4.2
[2.4.1]: https://github.com/jpanther/congo/compare/v2.4.0...v2.4.1
[2.4.0]: https://github.com/jpanther/congo/compare/v2.3.1...v2.4.0
[2.3.1]: https://github.com/jpanther/congo/compare/v2.3.0...v2.3.1
Expand Down
22 changes: 9 additions & 13 deletions assets/css/compiled/main.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Congo v2.4.1 | MIT License | https://github.com/jpanther/congo */
/*! Congo v2.4.2 | MIT License | https://github.com/jpanther/congo */

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

Expand Down Expand Up @@ -1194,6 +1194,7 @@ body:has(#menu-controller:checked) {
.chroma .lntd,
.chroma .lntd pre {
margin: 0px;
overflow: hidden;
border-style: none;
padding: 0px;
vertical-align: top;
Expand All @@ -1204,39 +1205,34 @@ body:has(#menu-controller:checked) {
.chroma .lntable {
display: block;
width: auto;
overflow: hidden;
padding-left: 1rem;
padding-right: 1rem;
overflow-x: auto;
padding-top: 0.75rem;
padding-bottom: 0.75rem;
font-size: 1rem;
line-height: 1.5rem;
border-spacing: 0;
}

/* LineTable Line */

.chroma .lntable .line {
padding-right: 1rem;
}

/* LineHighlight */

.chroma .hl {
margin-left: -1rem;
margin-right: -1rem;
display: block;
width: auto;
--tw-bg-opacity: 1;
background-color: rgba(var(--color-primary-100), var(--tw-bg-opacity));
padding-left: 1rem;
padding-right: 1rem;
}

.dark .chroma .hl {
--tw-bg-opacity: 1;
background-color: rgba(var(--color-primary-900), var(--tw-bg-opacity));
}

.chroma .lntd .hl {
margin: 0px;
padding: 0px;
}

/* LineNumbersTable */

/* LineNumbers */
Expand Down
27 changes: 14 additions & 13 deletions assets/css/main.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Congo v2.4.1 | MIT License | https://github.com/jpanther/congo */
/*! Congo v2.4.2 | MIT License | https://github.com/jpanther/congo */

@tailwind base;
@tailwind components;
Expand Down Expand Up @@ -34,11 +34,11 @@ body:has(#menu-controller:checked) {

/* RTL support */
.prose blockquote {
@apply rtl:pr-4 rtl:border-l-0 rtl:border-r-4;
@apply rtl:border-l-0 rtl:border-r-4 rtl:pr-4;
}
.prose ul > li,
.prose ol > li {
@apply rtl:pl-0 rtl:pr-2 rtl:mr-7;
@apply rtl:mr-7 rtl:pl-0 rtl:pr-2;
}
.prose ol > li:before,
.prose ul > li:before {
Expand Down Expand Up @@ -84,7 +84,7 @@ body:has(#menu-controller:checked) {
@apply visible;
}
.copy-button {
@apply absolute top-0 right-0 z-10 invisible w-20 py-1 font-mono text-sm cursor-pointer opacity-90 bg-neutral-200 whitespace-nowrap rounded-bl-md rounded-tr-md text-neutral-700 dark:bg-neutral-600 dark:text-neutral-200;
@apply absolute top-0 right-0 z-10 invisible w-20 py-1 font-mono text-sm cursor-pointer whitespace-nowrap rounded-bl-md rounded-tr-md bg-neutral-200 text-neutral-700 opacity-90 dark:bg-neutral-600 dark:text-neutral-200;
}
.copy-button:hover,
.copy-button:focus,
Expand All @@ -93,36 +93,37 @@ body:has(#menu-controller:checked) {
@apply bg-primary-100 dark:bg-primary-600;
}
.copy-textarea {
@apply absolute opacity-5 -z-10;
@apply absolute -z-10 opacity-5;
}

/* -- Chroma Highlight -- */
/* Background */
.prose .chroma {
@apply static rounded-md text-neutral-700 bg-neutral-50 dark:bg-neutral-700 dark:text-neutral-200;
@apply static rounded-md bg-neutral-50 text-neutral-700 dark:bg-neutral-700 dark:text-neutral-200;
}
/* LineTableTD */
.chroma .lntd,
.chroma .lntd pre {
@apply p-0 m-0 align-top border-none;
@apply p-0 m-0 overflow-hidden align-top border-none;
}
/* LineTable */
.chroma .lntable {
@apply block w-auto px-4 py-3 overflow-hidden text-base;
@apply block w-auto py-3 overflow-x-auto text-base;
border-spacing: 0;
}
/* LineTable Line */
.chroma .lntable .line {
@apply pr-4;
}
/* LineHighlight */
.chroma .hl {
@apply block w-auto px-4 -mx-4 bg-primary-100 dark:bg-primary-900;
}
.chroma .lntd .hl {
@apply p-0 m-0;
@apply block w-auto bg-primary-100 dark:bg-primary-900;
}
/* LineNumbersTable */
/* LineNumbers */
.chroma .lnt,
.chroma .ln {
@apply text-neutral-600 dark:text-neutral-300 mr-[0.4em] px-[0.4em] py-0;
@apply mr-[0.4em] px-[0.4em] py-0 text-neutral-600 dark:text-neutral-300;
}
/* Keyword */
/* KeywordDeclaration */
Expand Down
17 changes: 17 additions & 0 deletions assets/js/appearance.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
const sitePreference = document.documentElement.getAttribute("data-default-appearance");
const userPreference = localStorage.getItem("appearance");

function getCSSValue(varName) {
var cssValue = window.getComputedStyle(document.documentElement).getPropertyValue(varName);
return "rgb(" + cssValue.replace(/\s+/g, "") + ")";
}

function setThemeColor() {
var metaThemeColor = document.querySelector("meta[name=theme-color]");
document.documentElement.classList.contains("dark")
? metaThemeColor.setAttribute("content", getCSSValue("--color-neutral-800"))
: metaThemeColor.setAttribute("content", getCSSValue("--color-neutral"));
return true;
}

if ((sitePreference === "dark" && userPreference === null) || userPreference === "dark") {
document.documentElement.classList.add("dark");
setThemeColor();
}

if (document.documentElement.getAttribute("data-auto-appearance") === "true") {
Expand All @@ -12,13 +26,15 @@ if (document.documentElement.getAttribute("data-auto-appearance") === "true") {
userPreference !== "light"
) {
document.documentElement.classList.add("dark");
setThemeColor();
}
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (event) => {
if (event.matches) {
document.documentElement.classList.add("dark");
} else {
document.documentElement.classList.remove("dark");
}
setThemeColor();
});
}

Expand All @@ -27,6 +43,7 @@ window.addEventListener("DOMContentLoaded", (event) => {
if (switcher) {
switcher.addEventListener("click", () => {
document.documentElement.classList.toggle("dark");
setThemeColor();
localStorage.setItem(
"appearance",
document.documentElement.classList.contains("dark") ? "dark" : "light"
Expand Down
13 changes: 0 additions & 13 deletions assets/lib/chart/chart.min.js

This file was deleted.

14 changes: 14 additions & 0 deletions assets/lib/chart/chart.umd.js

Large diffs are not rendered by default.

41 changes: 21 additions & 20 deletions exampleSite/content/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,27 @@ Note that the variable names provided in this table use dot notation to simplify

Congo is optimised for full multilingual websites and theme assets are translated into several languages out of the box. The language configuration allows you to generate multiple versions of your content to provide a customised experience to your visitors in their native language.

The theme currently supports the following languages by default:

| Language | Code |
| ------------------------------------- | ------- |
| :gb: English | `en` |
| :bangladesh: Bengali | `bn` |
| :cn: Simplified Chinese (China) | `zh-cn` |
| :taiwan: Traditional Chinese (Taiwan) | `zh-tw` |
| :finland: Finnish | `fi` |
| :fr: French | `fr` |
| :de: German | `de` |
| :israel: Hebrew | `he` |
| :hungary: Hungarian | `hu` |
| :it: Italian | `it` |
| :jp: Japanese | `ja` |
| :brazil: Portuguese (Brazil) | `pt-br` |
| :portugal: Portuguese (Portugal) | `pt-pt` |
| :romania: Romanian | `ro` |
| :es: Spanish (Spain) | `es` |
| :tr: Turkish | `tr` |
The theme currently supports the following languages out of the box:

| Language | Code |
| --------------------------------------- | ------- |
| :gb: **English (default)** | `en` |
| :bangladesh: Bengali | `bn` |
| :cn: Chinese - Simplified (China) | `zh-cn` |
| :taiwan: Chinese - Traditional (Taiwan) | `zh-tw` |
| :netherlands: Dutch | `nl` |
| :finland: Finnish | `fi` |
| :fr: French | `fr` |
| :de: German | `de` |
| :israel: Hebrew | `he` |
| :hungary: Hungarian | `hu` |
| :it: Italian | `it` |
| :jp: Japanese | `ja` |
| :brazil: Portuguese (Brazil) | `pt-br` |
| :portugal: Portuguese (Portugal) | `pt-pt` |
| :romania: Romanian | `ro` |
| :es: Spanish (Spain) | `es` |
| :tr: Turkish | `tr` |

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).

Expand Down
55 changes: 55 additions & 0 deletions i18n/nl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
article:
anchor_label: "Anker"
date: "{{ .Date }}"
date_updated: "Bijgwerkt: {{ .Date }}"
draft: "Concept"
edit_title: "Bewerk inhoud"
reading_time:
one: "{{ .Count }} minuut"
other: "{{ .Count }} minuten"
reading_time_title: "Leestijd"
table_of_contents: "Inhoudsopgave"
word_count:
one: "{{ .Count }} woord"
other: "{{ .Count }} woorden"

author:
byline_title: "Auteur"

code:
copy: "Kopieer"
copied: "Gekopieerd"

error:
404_title: "Pagina niet gevonden :confused:"
404_error: "Fout 404"
404_description: "Het lijkt er op dat de opgevraagde pagina niet bestaat."

footer:
dark_appearance: "Omschakelen naar donker uiterlijk"
light_appearance: "Omschakelen naar licht uiterlijk"
powered_by: "Aangedreven door {{ .Hugo }} & {{ .Congo }}"

list:
externalurl_title: "Link naar externe site"
no_articles: "Er zijn nog geen artikelen om hier weer te geven."

nav:
scroll_to_top_title: "Scroll naar toven"
skip_to_main: "Spring naar inhoud"

search:
open_button_title: "Zoeken (/)"
close_button_title: "Sluiten (Esc)"
input_placeholder: "Zoeken"

sharing:
email: "Verstuur via email"
facebook: "Deel op Facebook"
linkedin: "Deel op LinkedIn"
pinterest: "Pin op Pinterest"
reddit: "Verzend naar Reddit"
twitter: "Tweet op Twitter"

shortcode:
recent_articles: "Recent"
2 changes: 1 addition & 1 deletion layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@
</div>
{{/* Extend footer - eg. for extra scripts, etc. */}}
{{ if templates.Exists "partials/extend-footer.html" }}
{{ partialCached "extend-footer.html" . }}
{{ partial "extend-footer.html" . }}
{{ end }}
</footer>
7 changes: 3 additions & 4 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta http-equiv="content-language" content="{{ . }}" />
{{ end }}
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="rgb(255,255,255)" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
{{/* Title */}}
{{ if .IsHome -}}
Expand All @@ -14,9 +15,7 @@
<meta name="title" content="{{ .Title | emojify }} &middot; {{ .Site.Title | emojify }}" />
{{- end }}
{{/* Metadata */}}
{{ with .Site.Params.description -}}
<meta name="description" content="{{ . }}" />
{{- end }}
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ if .IsPage }}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
{{ with .Site.Params.keywords -}}
<meta name="keywords" content="{{ . }}" />
{{- end }}
Expand Down Expand Up @@ -110,6 +109,6 @@
{{ partialCached "analytics.html" .Site }}
{{/* Extend head - eg. for custom analytics scripts, etc. */}}
{{ if templates.Exists "partials/extend-head.html" }}
{{ partialCached "extend-head.html" .Site }}
{{ partial "extend-head.html" .Site }}
{{ end }}
</head>
4 changes: 2 additions & 2 deletions layouts/partials/vendor.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{ end }}
{{/* Chart */}}
{{ if .Page.HasShortcode "chart" }}
{{ $chartLib := resources.Get "lib/chart/chart.min.js" }}
{{ $chartLib := resources.Get "lib/chart/chart.umd.js" }}
{{ $chartConfig := resources.Get "js/chart.js" }}
{{ $chartConfig := $chartConfig | resources.Minify }}
{{ $chartJS := slice $chartLib $chartConfig | resources.Concat "js/chart.bundle.js" | resources.Fingerprint "sha512" }}
Expand All @@ -31,6 +31,6 @@
<script defer src="{{ $katexRenderJS.RelPermalink }}" integrity="{{ $katexRenderJS.Data.Integrity }}" onload="renderMathInElement(document.body);"></script>
{{ $katexFonts := resources.Match "lib/katex/fonts/*" }}
{{ range $katexFonts }}
<!-- {{ .RelPermalink }} -->
{{ .Publish }}
{{ end }}
{{ end }}
Loading

0 comments on commit 572885c

Please sign in to comment.