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

redirector for /live to jb-live domain #300

Conversation

elreydetoda
Copy link
Collaborator

@elreydetoda elreydetoda commented Aug 16, 2022

unfortunately there doesn't appear to be a native way to redirect to a url that's not hugo based for the current site (i.e. jb-live.jb.net is technically a completely different deployment)

Normally if we'd redirect to another internal page to the repo it'd be easy (see #297 & #295), but since it's referencing an external site it not as easy (look at #294 for more info).

So, the only way I can think to handle this is by defining a static file (which doesn't get access to hugo variables (I tried to reference it), pic below), and having the redirect there manually defined. (based on hugo's default page when calling an alias)

(what happened when trying to reference a hugo variable)
image

@gerbrent
Copy link
Collaborator

sure would be nice to solve #233 if it simplifies this PR/functionality for you...

@RealOrangeOne
Copy link

This redirect is probably better done with nginx than like this. It would require vendoring our own nginx config, but that's probably a good idea anyway for extra customization.

@elreydetoda
Copy link
Collaborator Author

This redirect is probably better done with nginx than like this. It would require vendoring our own nginx config, but that's probably a good idea anyway for extra customization.

So, I actually just copy/pasted the exact redirect page that hugo generates with aliases: https://gohugo.io/content-management/urls#aliases and swapped out the values we wanted.

Also, IIRC @ironicbadger mentioned we're using traefik so it'd be a config change (probably just a label) for that. I was going to post an issue on the infra repo, but figured I'd draft it here and get opinions.

To @gerbrent's point though, if #233 was taken care of I'd just be able to add an alias to it just like the other ones.

@RealOrangeOne
Copy link

Nginx is running in the container, so it's still possible to do it there, regardless of what sits in front of it.

@elreydetoda
Copy link
Collaborator Author

Closed via #317

@elreydetoda elreydetoda deleted the feat/jb-live_redirector/294 branch August 19, 2022 12:44
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

Successfully merging this pull request may close these issues.

3 participants