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
Incorrect path generated for index.md files #1485
Comments
Yep — this is buggy. Alternatively (and more verbosely, though arguably easier to read): if item.identifier =~ '/index.*'
write ext: 'html'
else
# We write all items into its own directory with an index.html file,
# except the root index.* file, which needs to remain at the root –
# otherwise, /index.md would end up as /index/index.html.
write item.identifier.without_ext + '/index.html'
end I added a comment, because I feel that it’s necessary to explain this in more detail. I’ll give this some more thought. |
That alternative definitely reads easier than my band-aid, but the condition didn't match. This condition worked:
It looks like this bug also pops up if I put an The first |
Let default Rules handle index.* files (fixes #1485)
@ddfreyne Does this change actually work correctly with Markdown (
If I rename |
What I found worked correctly is below; it's the compile '/**/*.md' do
filter :kramdown
layout '/default.*'
if item.identifier =~ '**/index.*'
write ext: 'html'
else
write item.identifier.without_ext + '/index.html'
end
end Directory layouts and results:
|
After enabling markdown in
Rules
,path/index.md
files are incorrectly generated topath/index/index.html
path instead ofindex.html
. This is especially problematic when usingindex.md
for the root page of a site.This patch updates the template for
Rules
:The text was updated successfully, but these errors were encountered: