Skip to content

Commit

Permalink
Make page title & description dynamic
Browse files Browse the repository at this point in the history
Previously they had to be duplicated from the page
frontmatter but that's not necessary and also makes
it possible to have correct OpenGraph title and
descriptions.
  • Loading branch information
olivierlacan committed Feb 5, 2024
1 parent b033095 commit bee0534
Show file tree
Hide file tree
Showing 63 changed files with 257 additions and 263 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- v1.1 Polish translation.
- v1.1 Ukrainian translation.

### Changed

- Use frontmatter title & description in each language version template
- Replace broken OpenGraph image with an appropriately-sized Keep a Changelog
image that will render properly (although in English for all languages)
- Fix OpenGraph title & description for all languages so the title and
description when links are shared are language-appropriate

### Removed

- Trademark sign previously shown after the project description in version
0.3.0

## [1.1.1] - 2023-03-05

### Added
Expand Down
22 changes: 1 addition & 21 deletions config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -263,24 +263,4 @@ def available_translation_for(language)
activate :autoprefixer do |config|
config.browsers = ["last 2 versions", "Explorer >= 10"]
config.cascade = false
end

# Haml doesn't pick up on Markdown configuration so we have to remove the
# default Markdown Haml filter and reconfigure one that follows our
# global configuration.

# module Haml::Filters
# remove_filter("Markdown") #remove the existing Markdown filter

# module Markdown
# include Haml::Filters::Base

# def renderer
# $markdown_config[:renderer]
# end

# def render(text)
# Redcarpet::Markdown.new(renderer.new($markdown_config)).render(text)
# end
# end
# end
end
8 changes: 3 additions & 5 deletions source/ar/1.0.0/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: احتفظ بسجل التغيير
description: لا تدع أصدقائك يخلطون سجلات git مع سجلات التغيير
title: احتفظ بسجل التغيير
language: ar
version: 1.0.0
Expand All @@ -15,10 +15,8 @@ p.yanked {direction:ltr;text-align:right}

.header
.title
%h1 احتفظ بسجل التغيير
%h2 لا تدع أصدقائك يخلطون سجلات |
git |
مع سجلات التغيير |
%h1= current_page.data.title
%h2= current_page.data.description

= link_to data.links.changelog do
Version
Expand Down
13 changes: 7 additions & 6 deletions source/cs/0.3.0/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
---
description: Udržuj Changelog
title: Udržuj Changelog
description: Nenech své kamarády házet do CHANGELOGů™ git logy.
language: cs
version: 0.3.0
---

:markdown
# Udržuj CHANGELOG
%h1= current_page.data.title

## Nenech své kamarády házet do CHANGELOGů™ git logy.
%h2= current_page.data.description

Version **#{current_page.metadata[:page][:version]}**
Version <strong>#{current_page.metadata[:page][:version]}</strong>

:markdown
### Co je to changelog?
Changelog je soubor, který obsahuje organizovaný, chronologicky seřazený
seznam podstatných změn pro každou verzi daného projektu.

<pre class="changelog">#{File.read("CHANGELOG.md")}</pre>
<pre class="changelog">#{File.read("CHANGELOG.md")}</pre>

:markdown
### Co je smyslem changelogu?
Usnadnit uživatelům a přispěvatelům přesné zobrazení podstatných změn, které
byly provedeny mezi jednotlivými vydáními (verzemi) daného projektu.
Expand Down
6 changes: 3 additions & 3 deletions source/cs/1.0.0/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
description: Udržuj Changelog
title: Udržuj Changelog
description: Nenech své kamarády sypat git logy do changelogů.
language: cs
version: 1.0.0
---
.header
.title
%h1 Udržuj Changelog
%h2 Nenech své kamarády sypat git logy do changelogů.
%h1= current_page.data.title
%h2= current_page.data.description

= link_to data.links.changelog do
Verze
Expand Down
6 changes: 3 additions & 3 deletions source/cs/1.1.0/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
description: Udržuj Changelog
title: Udržuj Changelog
description: Nenech své kamarády sypat git logy do changelogů.
language: cs
version: 1.1.0
---
.header
.title
%h1 Udržuj Changelog
%h2 Nenech své kamarády sypat git logy do changelogů.
%h1= current_page.data.title
%h2= current_page.data.description

= link_to data.links.changelog do
Verze
Expand Down
6 changes: 3 additions & 3 deletions source/da/1.1.0/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
description: Hold en changelog
title: Hold en changelog
description: Du skal ikke lade dine venner smide git logs i changelogs.
language: da
version: 1.1.0
---
.header
.title
%h1 Hold en changelog
%h2 Du skal ikke lade dine venner smide git logs i changelogs.
%h1= current_page.data.title
%h2= current_page.data.description

= link_to data.links.changelog do
Version
Expand Down
16 changes: 8 additions & 8 deletions source/de/0.3.0/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
---
description: Keep a Changelog
title: Keep a Changelog
title: Führe ein CHANGELOG
description: Lass Deine Freunde nicht CHANGELOGs mit git logs füllen
language: de
version: 0.3.0
---

:markdown
# Führe ein CHANGELOG

## Lass Deine Freunde nicht CHANGELOGs mit git logs füllen™
%h1= current_page.data.title
%h2= current_page.data.description

Version **#{current_page.metadata[:page][:version]}**
Version <strong>#{current_page.metadata[:page][:version]}</strong>

:markdown
### Was ist ein Changelog?
Ein Changelog ist eine Datei, welche eine handgepflegte, chronologisch sortierte
Liste aller erheblichen Änderungen enthält, die zwischen Veröffentlichungen (oder Versionen)
des Projekts umgesetzt wurden.

<pre class="changelog">#{File.read("CHANGELOG.md")}</pre>
<pre class="changelog">#{File.read("CHANGELOG.md")}</pre>

:markdown
### Was ist der Zweck eines Changelogs?
Es Benutzern und Entwicklern einfacher zu machen, gerade die beachtenswerten Änderungen, welche
zwischen Veröffentlichungen (oder Versionen) des Projekts gemacht wurden, zu sehen.
Expand Down
8 changes: 4 additions & 4 deletions source/de/1.0.0/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
description: Keep a Changelog
title: Keep a Changelog
title: Führe ein CHANGELOG
description: Lass Deine Freunde nicht CHANGELOGs mit git logs füllen.
language: de
version: 1.0.0
---
.header
.title
%h1 Führe ein CHANGELOG
%h2 Lass Deine Freunde nicht CHANGELOGs mit git logs füllen.
%h1= current_page.data.title
%h2= current_page.data.description

= link_to data.links.changelog do
Version
Expand Down
8 changes: 4 additions & 4 deletions source/de/1.1.0/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
description: Keep a Changelog
title: Keep a Changelog
title: Führe ein CHANGELOG
description: Lass Deine Freunde nicht CHANGELOGs mit git logs füllen.
language: de
version: 1.1.0
---
.header
.title
%h1 Führe ein CHANGELOG
%h2 Lass Deine Freunde nicht CHANGELOGs mit git logs füllen.
%h1= current_page.data.title
%h2= current_page.data.description

= link_to data.links.changelog do
Version
Expand Down
14 changes: 7 additions & 7 deletions source/en/0.3.0/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
---
description: Keep a Changelog
title: Keep a Changelog
description: Don’t let your friends dump git logs into changelogs.
language: en
version: 0.3.0
---

:markdown
# Keep a CHANGELOG

## Don’t let your friends dump git logs into CHANGELOGs™
%h1= current_page.data.title
%h2= current_page.data.description

Version **#{current_page.metadata[:page][:version]}**
Version <strong>#{current_page.metadata[:page][:version]}</strong>

:markdown
### What’s a change log?
A change log is a file which contains a curated, chronologically ordered
list of notable changes for each version of a project.

<pre class="changelog">#{File.read("CHANGELOG.md")}</pre>
<pre class="changelog">#{File.read("CHANGELOG.md")}</pre>

:markdown
### What’s the point of a change log?
To make it easier for users and contributors to see precisely what
notable changes have been made between each release (or version) of the project.
Expand Down
6 changes: 3 additions & 3 deletions source/en/1.0.0/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
description: Keep a Changelog
title: Keep a Changelog
description: Don’t let your friends dump git logs into changelogs.
language: en
version: 1.0.0
---
.header
.title
%h1 Keep a Changelog
%h2 Don’t let your friends dump git logs into changelogs.
%h1= current_page.data.title
%h2= current_page.data.description

= link_to data.links.changelog do
Version
Expand Down
6 changes: 3 additions & 3 deletions source/en/1.1.0/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
description: Keep a Changelog
title: Keep a Changelog
description: Don’t let your friends dump git logs into changelogs.
language: en
version: 1.1.0
---
.header
.title
%h1 Keep a Changelog
%h2 Don’t let your friends dump git logs into changelogs.
%h1= current_page.data.title
%h2= current_page.data.description

= link_to data.links.changelog do
Version
Expand Down
14 changes: 7 additions & 7 deletions source/es-ES/0.3.0/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
---
description: Mantenga un Changelog
title: Mantenga un Changelog
description: No dejes que tus amigos copien y peguen git logs en los CHANGELOGs
language: es-ES
version: 0.3.0
---

:markdown
# Mantener un CHANGELOG

## No dejes que tus amigos copien y peguen git logs en los CHANGELOGs™
%h1= current_page.data.title
%h2= current_page.data.description

Version **#{current_page.metadata[:page][:version]}**
Version <strong>#{current_page.metadata[:page][:version]}</strong>

:markdown
### Qué es un registro de cambios (change log)?

Un registro de cambios o “change log” de ahora en adelante, es un archivo que contiene una lista en orden cronológico sobre los cambios que vamos haciendo en cada reléase (o versión) de nuestro proyecto.

<pre class="changelog">#{File.read("CHANGELOG.md")}</pre>
<pre class="changelog">#{File.read("CHANGELOG.md")}</pre>

:markdown
### Cuál es el propósito del change log?

Para que les sea más fácil a los usuarios y contribuyentes, ver exactamente los cambios notables que se han hecho entre cada versión (o versiones) del proyecto.
Expand Down
4 changes: 2 additions & 2 deletions source/es-ES/1.0.0/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
description: Mantenga un changelog
title: Mantenga un changelog
description: No dejes que tus amigos usen el registro de git en los changelogs.
language: es-ES
version: 1.0.0
---
.header
.title
%h1 Mantenga un changelog
%h1= current_page.data.title
%h2
No dejes que tus amigos usen el registro de git en los changelogs.

Expand Down
4 changes: 2 additions & 2 deletions source/es-ES/1.1.0/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
description: Mantenga un changelog
title: Mantenga un changelog
description: No dejes que tus amigos usen el registro de git en los changelogs.
language: es-ES
version: 1.1.0
---
.header
.title
%h1 Mantenga un changelog
%h1= current_page.data.title
%h2
No dejes que tus amigos usen el registro de git en los changelogs.

Expand Down
6 changes: 3 additions & 3 deletions source/fa/1.0.0/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: تاریخچهٔ تغییرات را نگه دارید
title: تاریخچهٔ تغییرات را نگه دارید
description: خروجی git log را به اسم تاریخچهٔ تغییرات پروژه منتشر نکنید.
language: fa
version: 1.0.0
---
Expand All @@ -14,8 +14,8 @@ pre {direction:ltr;text-align:left}

.header
.title
%h1 تاریخچهٔ تغییرات را نگه دارید
%h2 خروجی git log را به اسم تاریخچهٔ تغییرات پروژه منتشر نکنید.
%h1= current_page.data.title
%h2= current_page.data.description

= link_to data.links.changelog do
Version
Expand Down
6 changes: 3 additions & 3 deletions source/fa/1.1.0/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: تاریخچهٔ تغییرات را نگه دارید
title: تاریخچهٔ تغییرات را نگه دارید
description: خروجی git log را به اسم تاریخچهٔ تغییرات پروژه منتشر نکنید
language: fa
version: 1.1.0
---
Expand All @@ -14,8 +14,8 @@ pre {direction:ltr;text-align:left}

.header
.title
%h1 تاریخچهٔ تغییرات را نگه دارید
%h2 خروجی git log را به اسم تاریخچهٔ تغییرات پروژه منتشر نکنید.
%h1= current_page.data.title
%h2= current_page.data.description

= link_to data.links.changelog do
Version
Expand Down
Loading

0 comments on commit bee0534

Please sign in to comment.