diff --git a/public/missing.md b/public/missing.md index 0b6be3a..dbcf3d7 100644 --- a/public/missing.md +++ b/public/missing.md @@ -1,5 +1,5 @@ --- -Hide extension: no +Show extension: yes ---
four oh four
diff --git a/samhuri.net/Sources/samhuri.net/Site/MarkdownRenderer.swift b/samhuri.net/Sources/samhuri.net/Site/MarkdownRenderer.swift index 658a5a4..9912b66 100644 --- a/samhuri.net/Sources/samhuri.net/Site/MarkdownRenderer.swift +++ b/samhuri.net/Sources/samhuri.net/Site/MarkdownRenderer.swift @@ -30,8 +30,9 @@ final class MarkdownRenderer: Renderer { let pageHTML = try pageRenderer.renderPage(site: site, bodyHTML: bodyHTML, metadata: metadata) let mdFilename = fileURL.lastPathComponent + let showExtension = mdFilename == "index.md" || metadata["Show extension"]?.lowercased() == "yes" let htmlPath: String - if metadata["Hide extension"]?.lowercased() == "no" || mdFilename == "index.md" { + if showExtension { htmlPath = mdFilename.replacingOccurrences(of: ".md", with: ".html") } else {