mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-03-25 09:05:47 +00:00
Invert Markdown metadata directive to show HTML extension
This commit is contained in:
parent
96b249a21c
commit
0f6500cf2d
2 changed files with 3 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
Hide extension: no
|
||||
Show extension: yes
|
||||
---
|
||||
|
||||
<p align="center">four oh four</p>
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue