Skip to content

Commit 71b30ca

Browse files
committed
Remove underscores from default displayed title
1 parent ef43717 commit 71b30ca

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Next
44
- Changed output to no longer be prettified.
55
- Fixed spacing issues resulting from output prettification.
6+
- Fixed underscores appearing in the default page title when present in the URL.
67
- Fixed links not being automatically capitalised.
78
- Fixed named references not working.
89

src/compile.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ export function compile(dir: string = '.', config: Config = {}): void {
3838
const outFilename: string = filename.replace(/ /g, '_').replace('.wiki', '.html');
3939
const outFilePath = paths.join(outputFolder, outFilename);
4040
const urlPath: string = outFilename.replace(/(?<=^|\/)\w/g, m => m.toUpperCase()); // capitalise first letters
41-
const displayTitle: string = metadata.displayTitle || urlPath.replace('.html', '');
41+
42+
const displayTitle: string = metadata.displayTitle || urlPath.replace('.html', '').replace(/_/g, ' ');
4243

4344
// Eleventy configuration
4445
const frontMatter = config.eleventy ? dedent`

0 commit comments

Comments
 (0)