Franklin.jl
Franklin.jl copied to clipboard
Links on page with fill not rendered by optimize
This is a bit obscure: there's a page on my site where links are not rendered:
Upon some investigations, I noticed that these lines are those causing the trouble:
* [{{fill title ...}}](...)
* ...
I also noticed that replace the unrendered links with the inline variant also solve the issue.
The issue occurs to me on both 0.10.30 and the latest 0.10.33.
Thanks for reporting!
Ok yes so that's a bit tricky in terms of the order in which things are resolved. Basically {{...}}
blocks are currently left "untouched" and passed to the HTML processor so the ordering is:
- markdown pass, most things are converted to HTML using MD -> HTML
- html pass, remaining
{{...}}
items are resolved
So in this case there's a conflict because it sees "shortcut links" (like [internship]()
) but it can't find the definition because the {{...}}
is not yet resolved (at least I think that's what's happening for you, I haven't yet looked at your repo).
An alternative which would work now and might suit you is to define page variables with the links and fill those so something like
+++
benchmark = "/foo/bar/benchmark/"
+++
Did you [see the benchmarks]({{benchmark}}) etc.
The difference here is that the MD pass will lead to <a href={{benchmark}}>see the benchmarks</a>
and the html pass will then appropriately fill so you'll get <a href=/foo/bar/benchmark/>see the benchmarks</a>
.
Thanks, the suggested work-around indeed has the expected effect (the date is still incorrect though). I also forgot to mention that running serve
also fix it (even the date), which agrees with your analogy, but it feels too hacky for automation :smile:
What is the date issue?
Affected pages also have the last modified date rendered as 0001-01-01. My guess would be it's has the same root cause.
Hmm no that's another issue which I'm aware of but haven't fixed yet. Thanks for reporting!
Just for the specific issue here, is the workaround suggested above ok for you?
Note also that I'm working on a pretty significant refactoring of this (MD->HTML->HTML) pass which will likely remove the problem completely but I'm not sure exactly when I'll be done with it (it might take me a month or two).
Thanks again for the report!
Yes, the workaround is OK for me. I'm looking forward to the refactored logic, although there's no hurry on my side.
me too :joy:
I was able to work around the date issue with git log
, which is a win-win since the modification date is not preserved by git clone
.
ah awesome! thanks for letting me know :)