fongandrew / hydeout

A refreshed version of Hyde for Jekyll 3.x and 4.x
https://fongandrew.github.io/hydeout/
Other
591 stars 744 forks source link

Useless back arrow #130

Open HaukeCornell opened 1 year ago

HaukeCornell commented 1 year ago

The theme has a back arrow at the top of pages. E.g., on the about page.

This back arrow link does not link back to the home page, but just refreshes the page. Should we remove it? How?

frothedoatmilk commented 5 months ago

I've just ran into the same issue. I believe there's some issue with Jekyll's custom filters. A fix is to add your own _includes/back-link.html with the following:

{% assign back_page = site.pages | where: "name", page.back_page | first %}
{% if back_page != null %}
    <p class="back-link">
    <a href="{{ back_page.url | relative_url }}"><span class="back-arrow icon">{% include svg/back-arrow.svg %}</span>{{ back_page.short_title | default: back_page.title }}</a>
    </p>
{% endif %}

My only change from the original file is the assign back_page clause, which went from site.pages | find 'name', page.pack_page to what it is now. Digging further into Jekyll to see what's up here...

frothedoatmilk commented 5 months ago

Yeah, so the find method was introduced in (this release)[https://github.com/jekyll/jekyll/releases/tag/v4.1.0], but GitHub pages is locked to 3.9.5 as of writing. So I'm not positive what's happening in this call when find doesn't exist. But it ends up returning the current page. Would be best to revert this behavior to where syntax until GH updates it's jekyll version?