Open mbforbes opened 2 years ago
Hi @mbforbes, that's a good issue to solve indeed! 👍
I wonder if there's a way to get the pass prefix in the plugin code. Would you have an idea about that?
Thank you for the reply, @nhoizey! 🙏
That's a great question. Haven't touched plugin code so I hadn't even considered that it might be awkward to plumb through, but looking now I see the plugin doesn't refer to anything eleventy! From the docs it looks like this is a top-level config option, so we'd need access to the eleventy config object somehow?
Hi there,
Thank you for writing this plugin!
I'm not sure whether there's a natural way for it to play nicely with eleventy's global path prefix.
The path prefix mechanism prepends something to all URLs in case your website doesn't start at
/
. E.g., building witheleventy --pathprefix 'website-3'
would produce URLs that start with/website-3/
.When I build with a
--pathprefix
, thenlink_to
still produces URLs without the prefix.I thought to pipe them through eleventy's filter for adding path prefixes,
url
, like so:This produces the correct URL, but I get an error in the build log that
link_to
is looking for the new path, and couldn't find it:I'm not sure whether there is a workaround, or whether the plugin would require changes to support the path prefix?
Many thanks for your time!