biopython / biopython.github.io

Source of biopython.org website, migrated from MediaWiki
biopython.org
154 stars 284 forks source link

Use relative url filter consistently and remove unused post template #182

Closed LalitNM closed 4 months ago

LalitNM commented 3 years ago

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.

peterjc commented 3 years ago

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 commented 3 years ago

I would guess we'll need something like this?

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

to:

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

(Untested)

LalitNM commented 3 years ago

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" | relativeurl }}/Category%3A{{ tag | replace:' ','' }} (Untested)

Let me test this as well.

LalitNM commented 3 years ago

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.

MarkusPiotrowski commented 3 years ago

@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.

peterjc commented 3 years ago

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

LalitNM commented 3 years ago

I'm guessing tagwith means tag with underscore?

Yeah, that is what it means.

If it is not possible in one line, how about using category instead of tagwith, 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.

peterjc commented 4 months ago

Looks like we forgot about this cleanup work - applying now, thanks!