biopython / biopython.github.io

Source of biopython.org website, migrated from MediaWiki
biopython.org
153 stars 281 forks source link

Replace 'site.baseurl' with relative_url filter #180

Closed MarkusPiotrowski closed 3 years ago

MarkusPiotrowski commented 3 years ago

site.baseurl is not directing to the 'root' URL (any longer). Thus replace with relative_url.

This will close #179

MarkusPiotrowski commented 3 years ago

BTW, this has already a history: https://github.com/biopython/biopython.github.io/commit/055817e96b9fc428c6d135b2e93369dc176a488e#diff-e241bda4e3c3c6dc1c0b00185b61f6ce19b5eb16e294dd955ca9fa6d01befb0e

MarkusPiotrowski commented 3 years ago

Too easy ;-) I think the idea of using these "liquid filters" is that you can have a different baseurl on your local installation for testing.

peterjc commented 3 years ago

So does 055817e96b9fc428c6d135b2e93369dc176a488e need to do that too, rather than just plain slash?

LalitNM commented 3 years ago

I think we should be consistent in all places (either we use / or {{ "/" | relative_url }} or {{ site.baseurl }}). A / would be a better choice, because relative_url and baseurl are used when we have our site in a different place (like /docs) rather than in root, as far as I understand we will continue our site in root. Here is a nice answer for this.

MarkusPiotrowski commented 3 years ago

I'd suggest continuing using relative_url, but do it consistently and in a simplified way as described on Jekyll's liquid filter page (https://jekyllrb.com/docs/liquid/filters/), i.e. {{ "/favicon-32x32.png" | relative_url }} and remove the baseurl definition from _config.yml or set it to empty (""). Need to test how it works. This would let developers the possibility to serve the pages from another folder locally just by setting baseurl.