biopython.github.io icon indicating copy to clipboard operation
biopython.github.io copied to clipboard

Use relative url filter consistently and remove unused post template

Open LalitNM opened this issue 5 years ago • 7 comments

Follow up pull request on #181.

@MarkusPiotrowski I added relative_url at couple of places. But couldn't find any use of https://github.com/biopython/biopython.github.io/blob/3e4d073472c89af3477137e92c423f44dd3a6caf/_layouts/wiki.html#L7 in website. Can we simply remove this? BTW this has a history at 431d3512b36673fa7623f948518823b86ff701e1 and #104.

You can see a live demo of this state of website at https://lalitnm.github.io/biopython.github.io.

Please let me know if this pull request can be improved further.

LalitNM avatar Nov 26 '20 10:11 LalitNM

In reference to the snippet you noted, this works OK on https://biopython.org/wiki/Category:Wiki_Documentation but https://lalitnm.github.io/biopython.github.io/wiki/Category:Wiki_Documentation are currently broken - they still assume an absolute URL starting /wiki/Category...

I guess this needs the same relative URL filter applied here?

peterjc avatar Nov 26 '20 10:11 peterjc

I would guess we'll need something like this?

/wiki/Category%3A{{ tag | replace:' ','_' }}

to:

{{ "/wiki" | relative_url }}/Category%3A{{ tag | replace:' ','_' }}

(Untested)

peterjc avatar Nov 26 '20 11:11 peterjc

In reference to the snippet you noted, this works OK on https://biopython.org/wiki/Category:Wiki_Documentation but https://lalitnm.github.io/biopython.github.io/wiki/Category:Wiki_Documentation are currently broken - they still assume an absolute URL starting /wiki/Category...

I got you. Let me fix this too.

{{ "/wiki" | relative_url }}/Category%3A{{ tag | replace:' ','_' }} (Untested)

Let me test this as well.

LalitNM avatar Nov 26 '20 11:11 LalitNM

Now, only one place left where relative_url is not used, i.e. https://github.com/biopython/biopython.github.io/blob/3e4d073472c89af3477137e92c423f44dd3a6caf/_layouts/post.html#L17

@peterjc as far as I understand, we are not using that layout anywhere in website. Should we also change that file?

Also test this state at https://lalitnm.github.io/biopython.github.io.

LalitNM avatar Nov 26 '20 13:11 LalitNM

@peterjc as far as I understand, we are not using that layout anywhere in website.

This is also my understanding. This template is for blogs, isn't it? However, if we keep the template then you should also add the filter here. Or delete the template.

MarkusPiotrowski avatar Nov 26 '20 13:11 MarkusPiotrowski

I think Markus is probably right - and we might as well fix the currently unused post template.

peterjc avatar Nov 26 '20 15:11 peterjc

I'm guessing tag_with_ means tag with underscore?

Yeah, that is what it means.

If it is not possible in one line, how about using category instead of tag_with_, or maybe tag_underscore?

Sure, let me rename it as category.

I think Markus is probably right - and we might as well fix the currently unused post template.

Sure, let me remove that.

LalitNM avatar Nov 26 '20 15:11 LalitNM