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

Try to fix 404 #249

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

Try to fix 404 #249

wants to merge 14 commits into from

Conversation

Lotes
Copy link
Contributor

@Lotes Lotes commented Aug 22, 2024

No description provided.

@Lotes Lotes temporarily deployed to pull-request-preview August 22, 2024 12:25 — with GitHub Actions Inactive
hugo/package.json Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Aug 22, 2024

PR Preview Action v1.4.6
🚀 Deployed preview to https://eclipse-langium.github.io/langium-previews/pr-previews/pr-249/
on branch previews at 2024-08-28 09:19 UTC

@Lotes Lotes had a problem deploying to pull-request-preview August 22, 2024 13:33 — with GitHub Actions Failure
@Lotes Lotes temporarily deployed to pull-request-preview August 22, 2024 14:04 — with GitHub Actions Inactive
Lotes added a commit that referenced this pull request Aug 22, 2024
This change is needed to fix the base url in #249 for creating previews
@Lotes
Copy link
Contributor Author

Lotes commented Aug 23, 2024

I tried to make the paths relative, but Hugo seems not to accept some little amount of links and makes them relative to the root instead of the current path. That makes the link checker pointless.

@Lotes Lotes temporarily deployed to pull-request-preview August 28, 2024 07:30 — with GitHub Actions Inactive
@aabounegm
Copy link
Member

I think one issue could be that the base URL doesn't end in a trailing slash. I didn't run Hugo myself, but in the following HTML:

<head>
  <base href="/pr-249">
</head>
<body>
  <a href="./page">Page</a>
  <a href="page">equivalent link</a>
</body>

the links will actually point to /page. To have them point to /pr-249/page, the base URL needs to be /pr-249/ instead.

The other issue is that with <base> set, all relative URLs in the website become relative to that base. For example, ./features will be /pr-249/features, not /pr-249/docs/features as intended.

Lastly, I think the build script is not necessary because Hugo can be configured through environment variables, according to the docs. I believe it should suffice to set the env var HUGO_BASEURL instead.

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