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

🐛 fix(footer): fix external link redirection in footer #219

Merged
merged 3 commits into from
Oct 31, 2023

Conversation

joberthrogers18
Copy link
Contributor

@joberthrogers18 joberthrogers18 commented Oct 31, 2023

Summary

This PR aimed to fix the bug footer url redirect when user add in footer a link external. In the past the external redirection behaviored like the internal now the redirect was fixed to expected behavior.

Related issue

212

Changes

I had to change the footer html adding some conditions to verifiy if the url cotained the prefix http or https and decorate the variable url with get_url if it is not contained in string.

OBS: How the changes is transparent to user, it was not necessary modify documentation.

Type of change

  • Bug fix (fixes an issue without altering functionality)
  • New feature (adds non-breaking functionality)
  • Breaking change (alters existing functionality)
  • UI/UX improvement (enhances user interface without altering functionality)
  • Refactor (improves code quality without altering functionality)
  • Documentation update
  • Other (please describe below)

Checklist

  • I have verified the accessibility of my changes
  • I have tested all possible scenarios for this change
  • I have made corresponding changes to the documentation:
    • Updated config.toml comments
    • Updated theme.toml comments
    • Updated "Mastering tabi" post in English
    • (Optional) Updated "Mastering tabi" post in Spanish
    • (Optional) Updated "Mastering tabi" post in Catalan

@welpo welpo added the bug Something isn't working label Oct 31, 2023
@welpo
Copy link
Owner

welpo commented Oct 31, 2023

Thanks, @joberthrogers18!

I've added two commits with small changes:

  • Instead of splitting the path by ':', we check if menu.url starts with "http". This way we match both http and https with less code/nesting.
  • Added the example for external links to theme.toml (same you added in config.toml) and the footer_menu example in the Mastering tabi posts.

Thanks again!

@welpo welpo force-pushed the fix/external-links-redirect branch from ec7f932 to 372581e Compare October 31, 2023 12:28
@welpo welpo merged commit de91dfb into welpo:main Oct 31, 2023
@joberthrogers18
Copy link
Contributor Author

thanks for trust and help @welpo

Smtbook pushed a commit to Smtbook/zola-theme-tabi that referenced this pull request Feb 29, 2024
Co-authored-by: welpo <welpo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants