Closed cassidyjames closed 5 years ago
This technique might be useful. It's a workaround, but it's compatible with GitHub Pages.
The prerequisite is that all internal links should be relative, that is, not start with the string http
. Looking at the rendered HTML of a few blog posts tells me that is indeed the case, but I also found this:
As I’ve <a href="{ site.baseurl }/the-need-for-a-freedesktop-dark-style-preference/">written before</a>, practically all major platforms and browsers…</p>
That shouldn't be a problem in theory, but I want to test it out.
@dar5hak ah that could work! Here’s a sample post that has links to other blog posts if you want to test with real data: https://raw.githubusercontent.com/elementary/blog/master/_posts/2019-09-19-updates-for-august-2019.md?token=AAEVGYBNZBGXREBZMD2RAV25TYBUE
Impeccable timing, dude. I was testing things on my fork and this is exactly what I needed. :beers:
Another prerequisite was that href
must be the first attribute in an <a>
tag, or it won't be replaced. However, this only needed a change in license.html
. Everything else was already handled beforehand.
Check out my changes and the published version.
I've tested everything I could think of (including the "Newer"/"Older" links which aren't published).
Update: On a second thought, license.html
probably doesn't need to be changed either. Reverted.
I also didn't publish the sample post you shared with me because I didn't want to pollute the PR.
If everything looks good, I'll make a PR to upstream.
From https://github.com/elementary/blog/issues/48. Context:
@cassidyjames:
@btkostner:
@cassidyjames:
I do agree we should move it to build-time ideally if we can get that working.