Open manuelbieh opened 7 years ago
@manuelbieh Thanks for the issue! If you're reporting a bug, please be sure to include:
assemble
you are using.This looks like a bug in an old dependency.
I'm curious to see how you're using grunt-assemble-permalinks
with the latest version of assemble
. This should only work with grunt-assemble
.
In either case, will you make a repository with the minimum amount of configuration that demonstrates the bug? It probably just needs to be those 5 files listed above with the gruntfile or assemblefile and a package.json with the necessary dependencies. This will help us debug quicker.
Ah, sorry, I had assemble and grunt-assemble installed and I'm using grunt-assemble to assemble my files. Sorry for that!
Here is a testcase: https://github.com/manuelbieh/assemble-permalinks-testcase
What I was actually trying to do was to get localized filenames for different languages, using a (translated) metadata json similar to here: http://assemble.io/docs/YAML-front-matter.html#metadata-conduit-
(<%= page.about.file %>
in my example) and a custom permalinks pattern.
I don't know if there's an easier way to do that. However, it doesnt work due to the problem I described initially.
Plus: I have another problem: if I use <%= page.about.file %> in YFM, I get another error:
Warning: Unable to write "dist/de/<%= page.about.file %>.html" file (Error code: ENOENT).
Which is probably because permalinks receives the unparsed YFM data, right?
Just ran into my issue again. Have you had a look at my testcase already? 😉
Hey,
I was trying to use replacements to make it possible to optionally define alternative filenames just for certain pages or otherwise fallback to basename. This is my config:
Now I got the problem that subsequent files which are not explicitly specifying a
file
property in frontmatterthis.file
is still set to the value of the last file.a.hbs: no yfm b.hbs: sets
file
toz
in yfm c.hbs: no yfm d.hbs: no yfm e.hbs: setsfile
toy
in yfmresults in:
z.html contains the content from d.hbs as it instantly overwrites b.hbs and c.hbs. e.hbs has its own
file
prop so it gets correctly written to y.html.Anything I can do about that? Any workarounds or alternatives?
Assemble version: 0.23.0 Grunt-Assemble-Permalinks version: 0.1.1