saneef / eleventy-plugin-asciidoc

Eleventy plugin to add support for AsciiDoc.
MIT License
25 stars 6 forks source link

Front matter `permalink` seems to mess up #3

Closed nc7s closed 2 years ago

nc7s commented 2 years ago

Using eleventy 1.0.1 and this plugin 1.3.1.

Adding permalink in the front matter:

<!-- hello.adoc -->
---
permalink: /hello-permalink
---

= Hello Title

Hello content

Running eleventy:

❯ yarn run eleventy
yarn run v1.22.18
warning ../../package.json: No license field
$ /Users/i/Works/mstest/node_modules/.bin/eleventy
[11ty] Writing _site/<div class="paragraph">
[11ty] <p>Hello content</p>
[11ty] </div> from ./hello.adoc

which seems the rendered content is being used as permalink. I dug into eleventy source code a little, but have yet to find the crux of this.

saneef commented 2 years ago

@bnoctis thanks for pointing out this.

I have published a new version of the plugin v1.3.2. Could you try with that?

Also, don't forget the trailing slash in permalink. If you want to generate file at /hello-permalink/index.html, you need to set the permalink to either /hello-permalink/ or /hello-permalink/index.html.

nc7s commented 2 years ago

Solved! Thanks for such a quick fix.

I was actually trying to make posts have no trailing slash, for the sake of directory and file semantics. For now, I'm using permalink: /posts/something.html. Thinking of a plugin or something that enables this for all non-index things.