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 links to relative instead of absolute ones #181

Merged
merged 2 commits into from
Jan 14, 2022

Conversation

lukaszstolarczuk
Copy link
Member

@lukaszstolarczuk lukaszstolarczuk commented Dec 15, 2021

quick grep on all 'https://pmem.io/' links and replace to '/' where it made sense;
Only links generated by hugo can be replaced in that way.

It makes more sense to use it that way, so you can use this website
locally and still test all links.


This change is Reviewable

Copy link

@karczex karczex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you able to add preview?

Reviewable status: 0 of 39 files reviewed, all discussions resolved

@lukaszstolarczuk
Copy link
Member Author

Are you able to add preview?

Reviewable status: 0 of 39 files reviewed, all discussions resolved

I could, but this is not as trivial as it was with Jekyll. I was thinking how to enable this generically for all users, but with no good solution yet.

What you can do is clone my fork and run within the repo:

hugo
hugo server

and you'll get a localhost version of it with no additional changes.

I tested some of the new links and they all worked fine.

@pbalcer
Copy link
Member

pbalcer commented Dec 15, 2021

Change your fork's gh page source to gh-pages and it should just work. The issue will be that relative links will resolve to pmem.io/... instead of myfork.github.io/... because the base URL is a parameter in the config, not something retrieved dynamically. To resolve that, I think we could set the base URL at build time (see rstudio/blogdown#412) where we could use e.g., fork name or a secret variable set to the proper domain. But I didn't have the time to do that yet.

@lukaszstolarczuk
Copy link
Member Author

ok, cool, there's some solution for that.
BTW, there's also a simple trick for CName: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-add-cname-file-cname

Anyhow, thanks @pbalcer, I forgot we deploy this into gh-pages, fixed now on my fork: https://lukaszstolarczuk.github.io

quick grep on all 'https://pmem.io/' links and replace to '/' where it made sense;
Only links generated by hugo can be replaced in that way.
It makes more sense to use it that way, so you can use this website
locally and still test all links.
@lukaszstolarczuk
Copy link
Member Author

I've updated this PR with some more links and it's ready for review.

I won't be doing the aforementioned updates/upgrades to the "deploy system".

Copy link
Member

@pbalcer pbalcer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 38 of 39 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @lukaszstolarczuk)

@pbalcer pbalcer merged commit d532690 into pmem:main Jan 14, 2022
@lukaszstolarczuk lukaszstolarczuk deleted the fix-absolute-links branch January 14, 2022 10:53
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.

None yet

3 participants