Repository navigation
fix typos across the site #833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # CLAUDE.md | ||
|
|
||
| Die Seite ist auf Deutsch. Texte folgen der deutschen Rechtschreibung und Typografie (Duden), nicht der englischen. | ||
|
|
||
| ## Striche | ||
|
|
||
| | Zeichen | Name | Verwendung | Beispiel | | ||
| | ------- | -------------------------------- | ------------------------------------------------- | ---------------------------------------------------------- | | ||
| | `-` | Bindestrich | Zusammensetzungen, Ergänzungen | `Mitarbeiter-App`, `Arbeitszeit- und Abwesenheitsdaten` | | ||
| | `–` | Gedankenstrich (mit Leerzeichen) | Einschub, Nachtrag, Trenner in Titeln | `Zeiten erfassen – mit der App`, `title: Kalender – Hilfe` | | ||
| | `–` | Bis-Strich (ohne Leerzeichen) | Bereiche bei Zahlen, Zeiten, Wochentagen | `8–12 Uhr`, `S. 1–32`, `Mo–Fr` | | ||
| | `—` | Geviertstrich | **nicht verwenden**, das ist englische Typografie | – | | ||
|
|
||
| - Den Gedankenstrich und den Bis-Strich immer als Zeichen `–` (U+2013) schreiben, nie als `–`, `—` oder `-`. | ||
| `title` und `description` aus dem Front Matter werden mit `{{title}}` escaped ausgegeben, ein `–` stünde dort als Text im Browser-Tab und im Suchergebnis. | ||
| - Bei „von … bis“ das Wort ausschreiben statt eines Strichs: `vom 23.11. bis 27.11.`, nicht `vom 23.11.–27.11.`. | ||
|
|
||
| `npm run check:dashes` (läuft auch in der CI) meldet Geviertstriche, `–`/`—`, einen Bindestrich mit Leerzeichen als Gedankenstrich im Fließtext und Bereiche mit Leerzeichen um den Strich. | ||
| Bereiche ohne Leerzeichen mit Bindestrich (`8-12 Uhr`) erkennt der Check nicht, da sie von Datumsangaben, Versionen und Hausnummern nicht zu unterscheiden sind. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| // Checks the dashes in the page sources (German typography, see CLAUDE.md). | ||
| // | ||
| // The site wrote the Gedankenstrich four different ways (" - ", " – ", " — " | ||
| // and "–"). Only the literal en dash "–" is allowed: the em dash is | ||
| // English typography, and entities end up as visible text when a front matter | ||
| // title or description is rendered escaped with {{title}}. | ||
|
|
||
| import fs from "node:fs"; | ||
| import path from "node:path"; | ||
|
|
||
| const root = "src"; | ||
|
|
||
| const everywhere = [ | ||
| { pattern: /—/g, message: 'em dash "—", use "–"' }, | ||
| { | ||
| pattern: /&(ndash|mdash|#821[12]|#x201[34]);/gi, | ||
| message: 'dash entity, write the character "–" instead', | ||
| }, | ||
| ]; | ||
|
|
||
| const prose = [ | ||
| { | ||
| pattern: /[\p{L}.,!?)*_"”’] - [\p{L}(*_„"]/gu, | ||
| message: 'hyphen as Gedankenstrich, use " – "', | ||
| }, | ||
| { pattern: /\d - \d/g, message: 'spaced range, use "–" without spaces' }, | ||
| ]; | ||
|
|
||
| // Markup and code in which " - " is not a dash, replaced by spaces so that | ||
| // the reported columns stay correct. | ||
| const notProse = [ | ||
| /<script[\s\S]*?<\/script>/g, | ||
| /<style[\s\S]*?<\/style>/g, | ||
| /^```[\s\S]*?^```/gm, | ||
| /\{\{[\s\S]*?\}\}/g, | ||
| /`[^`\n]*`/g, | ||
| /^\s*- /gm, | ||
| ]; | ||
|
|
||
| function blank(text) { | ||
| return notProse.reduce( | ||
| (result, pattern) => | ||
| result.replace(pattern, match => match.replace(/[^\n]/g, " ")), | ||
| text, | ||
| ); | ||
| } | ||
|
|
||
| function check(file) { | ||
| const source = fs.readFileSync(file, "utf8"); | ||
| const rules = file.endsWith(".js") ? everywhere : [...everywhere, ...prose]; | ||
| const text = file.endsWith(".js") ? source : blank(source); | ||
| const lines = text.split("\n"); | ||
|
|
||
| const errors = []; | ||
| for (const [index, line] of lines.entries()) { | ||
| for (const { pattern, message } of rules) { | ||
| for (const match of line.matchAll(pattern)) { | ||
| const column = match.index + match[0].search(/[-—&]/) + 1; | ||
| errors.push(`${file}:${index + 1}:${column} ${message}`); | ||
| } | ||
| } | ||
| } | ||
| return errors; | ||
| } | ||
|
|
||
| const files = fs | ||
| .readdirSync(root, { recursive: true }) | ||
| .map(entry => path.join(root, entry)) | ||
| .filter(file => /\.(md|hbs)$|\.11tydata\.js$/.test(file)) | ||
| .sort(); | ||
|
|
||
| const errors = files.flatMap(check); | ||
| for (const error of errors) { | ||
| console.error(error); | ||
| } | ||
|
|
||
| if (errors.length > 0) { | ||
| process.exit(1); | ||
| } | ||
|
|
||
| console.log(`${files.length} files checked, no problems found.`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.