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

feat: use meta tag to redirect externalURLs #778

Merged
merged 2 commits into from
Jan 21, 2024

Conversation

Jh123x
Copy link
Contributor

@Jh123x Jh123x commented Jan 13, 2024

No description provided.

Copy link

netlify bot commented Jan 13, 2024

Deploy Preview for hugo-congo ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 25f82b2
🔍 Latest deploy log https://app.netlify.com/sites/hugo-congo/deploys/65ad96ca71d017000800d856
😎 Deploy Preview https://deploy-preview-778--hugo-congo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jpanther
Copy link
Owner

Thanks for the PR, but why is this required? Links to external URLs already send you to the correct destination.

@Jh123x
Copy link
Contributor Author

Jh123x commented Jan 19, 2024

Thanks for the PR, but why is this required? Links to external URLs already send you to the correct destination.

In cases where the users go to the URL directly, the webpage itself does not redirect to the external URL.

@jpanther
Copy link
Owner

Interesting. I don't see this issue as I always set those pages to not be built to prevent that from happening. I don't think it's good for SEO to have pages that are just redirects. It's much better to be linking to the original content and forming backlinks. Is there a particular reason you still generate output for external URL pages?

@jpanther jpanther added the question Further information is requested label Jan 20, 2024
@Jh123x
Copy link
Contributor Author

Jh123x commented Jan 20, 2024

The use case for me is to redirect links which have been migrated to another website. Should this be under another property instead?

@jpanther
Copy link
Owner

Hmm okay, no that use case is valid and one that I hadn't considered. I don't see any reason why the same parameter couldn't serve both purposes. If you don't need the leaf pages you can tell Hugo not to generate them, but in your use case where you want them, then you can leave them on and have them redirect.

I'll accept the PR, although is there a reason you coded this with an {{ else }} block? It seems redundant.

@jpanther jpanther added enhancement New feature or request and removed question Further information is requested labels Jan 21, 2024
@jpanther
Copy link
Owner

This is tested and working so I'll merge it in.

@jpanther jpanther merged commit b2f8227 into jpanther:dev Jan 21, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants