Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: hyde_links relative from base_url #31

Open
homersimpsons opened this issue May 29, 2023 · 2 comments
Open

Feature: hyde_links relative from base_url #31

homersimpsons opened this issue May 29, 2023 · 2 comments

Comments

@homersimpsons
Copy link

homersimpsons commented May 29, 2023

Currently, the hyde_links config option is used directly in the template:

<li class="sidebar-nav-item"><a href="{{link.url}}">{{link.name}}</a></li>

This is somewhat inconvenient when the site is not hosted at the root of the domain (for instance on github pages).

The 2 inconvenient I can see are:

  • Differences between local site and hosted version making it harder to tests changes
  • Impossibility to have a GitHub Repository template that is ready to use

Here are the options I can see of for the current behavior of the list:

  • uses a fully-qualified link: https://...com/my/page => has to update everything on domain change
  • uses a relative link: my/page => breaks on most pages
  • uses a root-relative link: /my/page => works well but not suitable if the hosing is not on the root and changes

I think it would be a good addition if it could be prefixed with the base_url or if there was a syntax to use base_url in the config.toml.

Of course absolute links should still be available.

@Keats
Copy link
Collaborator

Keats commented May 31, 2023

We can maybe just use get_url ?

@homersimpsons
Copy link
Author

homersimpsons commented Jun 2, 2023

I just tested get_url and it looks like it does not handle external links.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants