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

refractor: footer links - column 4 - rel attribute #740

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

aaofyi
Copy link

@aaofyi aaofyi commented Feb 14, 2024

PR type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other... Please describe:

PR checklist

Please check if your PR fulfills the following requirements:

  • I have read the CONTRIBUTING.md doc
  • The Git workflow follows our guidelines: CONTRIBUTING.md#git
  • I have added necessary documentation (if appropriate)

Unsure if this requires configuration usage documentation.

What is the current behavior?

Currently iVPN has a link to mastodon but it lacks rel="me", meaning iVPN does not appear verified on Mastodon.

The iVPN site also does not include noopener or noferrer on external social links.

The changes detailed in the next section allow the rel to be customized within config.toml, allowing these problems to be addressed individually.

What is the new behavior?

Now footercolfour links in the config.toml can be configured to have a rel. If one does not exist, it will not add the rel definition at all. This accomplishes three tasks:

  • Allows external links to be configured with noopener, preventing tabnapping.
  • Allows verified links with services such as Mastodon.
  • Allows adding noreferrer, optionally, this is intentionally the last commit so it can be easily chopped off.

Note in the config.toml file the mastodon definition includes me . iVPN already includes the proper link (without the me) on their site, but their Mastodon profile lacks verification. This modification would allow the site to automatically become verified on Mastodon with no further effort. Relevant links for this:

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@jurajhilje
Copy link
Member

Current changes don't compile, there's an error:
https://github.com/ivpn/ivpn.net/actions/runs/7907442820/job/21602031191?pr=740

executing "partials/footer.html" at <.Rel>: can't evaluate field Rel in type *navigation.MenuEntry

I'll also try to troubleshoot.

@aaofyi
Copy link
Author

aaofyi commented Feb 15, 2024

Built with local Hugo, my bad. I will troubleshoot later with the proper build.

@aaofyi
Copy link
Author

aaofyi commented Feb 15, 2024

Okay I have found the issue, it lies with custom parameters in the Hugo Menu.

The output of .Hugo.Version for the site is: 0.76.3

Custom Hugo parameters for the menu were added in Hugo version 0.79.0.

I will be adding one more commit that fixes the parameter definition. Otherwise this PR should just be held until the site updates to a newer Hugo version.

@jurajhilje
Copy link
Member

@aaofyi OK understood, thanks for the info. I'll check if I can upgrade Hugo to latest version without braking anything on the site.

@aaofyi
Copy link
Author

aaofyi commented Feb 16, 2024

If you update to Hugo >= 0.110.0, you may want to rename the config.toml files to hugo.toml in the src/config directory. This caused me a few headaches in the past.

This change is detailed in Hugo's docs:
"With v0.109.0 and earlier the basename of the site configuration file was config instead of hugo. You can use either, but should transition to the new naming convention when practical."

@jurajhilje
Copy link
Member

OK understood. Thanks for the heads up.

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

Successfully merging this pull request may close these issues.

2 participants