skohub-io / skohub-vocabs

A lightweight tool to publish SKOS Vocabularies
https://skohub.io/
Apache License 2.0
34 stars 25 forks source link

Do the created pages make use of absolute paths where relative paths would be better? #175

Closed awagner-mainz closed 2 years ago

awagner-mainz commented 2 years ago

I have had GitHub create html pages for my vocabulary with the latest docker image in a GitHub Action. The resulting pages contained links to "/index.html", "/index.de.html" etc. (see e.g. in this index.de.html).

However, if I want to use these pages in the GitHub pages context, they should contain the repository name as the first path component, e.g. https://rhonda-org.github.io/vocabs-polmat/w3id.org/rhonda/polmat/scheme.de.html. The absolute link that is being created instead points to https://rhonda-org.github.io/w3id.org/rhonda/polmat/scheme.de.html which does not exist. This can be seen on the "general index page" at https://rhonda-org.github.io/vocabs-polmat/index.de.html.

The scheme page itself does exist at https://rhonda-org.github.io/vocabs-polmat/w3id.org/rhonda/polmat/scheme.de.html (even though no other page links to it correctly), but it has the top-level concept in the concept tree on the left pointing to https://rhonda-org.github.io/w3id.org/rhonda/polmat/n0.de.html (without the first path component) and thus leads to 404. Possibly this is the reason why the tree is actually not even populated... It also affects all other pages like https://rhonda-org.github.io/vocabs-polmat/w3id.org/rhonda/polmat/n01.2pso.4.c.02.de.html (check the language switcher for instance).

If it is not something that I have configured badly (which may also very well be the case), then it could be related to the

let path = url.replace(/^https?:\//, "").split('#').shift()

in common.js:getFilePath()

Could you have a look? I have never noticed this kind of behaviour before...

acka47 commented 2 years ago

I noticed you forgot to adjust the GitHub workflow so that it points to the actual vocab rep. I made a PR to fix that, see https://github.com/rhonda-org/vocabs-polmat/pull/4. However, I am not sure whether this will do the trick. I quickly tried it out in a fork and it didn't work...

acka47 commented 2 years ago

Apparently, merging the PR https://github.com/rhonda-org/vocabs-polmat/pull/4 did not fix the problem. This is really weird as the problem does not occur on any other vocabs...

awagner-mainz commented 2 years ago

I have just triggered the build again (after banging my head on the desk for forgetting to adjust the workflow, and spending an hour searching for a valid update to make to the vocabulary), and yes: no change. Will continue to investigate on my end, too...

awagner-mainz commented 2 years ago

While the new build has apparently added at least one file, it does not seem to have updated the existing ones... index, scheme and concept pages have been changed for the last time 3 days ago. (However, all the files in the workflow artifact have the new date/time of the new build. They just haven't changed. Maybe that's the reason why the build did not update the files that have already existed. Also, even the one new file has the links with missing path component in the language switcher.)

acka47 commented 2 years ago

This looks suspicious:

run: echo "PATH_PREFIX=/vocabs-polmat" > .env.production

In the skohub-docker-vocabs it reads BASEURL instead of PATH_PREFIX (See here):

run: echo "BASEURL=/skohub-docker-vocabs" > .env.production

However, in my fork this didn't fix the problem either. Strange.

awagner-mainz commented 2 years ago

On https://github.com/skohub-io/skohub-docker-vocabs the change from PATH_PREFIX to BASEURL is mentioned. Note that in the example workflow file on that page, it says BASERURL with an additional "R". If the current build (with BASEURL) is not successful, I will check if writing BASERURL changes anything...

awagner-mainz commented 2 years ago

Fixed it! It was BASEURL indeed. Now everything is working again! Thanks for helping to find it.

acka47 commented 2 years ago

Note that in the example workflow file on that page, it says BASERURL with an additional "R"

Thanks, fixed it in https://github.com/skohub-io/skohub-docker-vocabs/commit/94f988fbd87305ce98b22fd6dbbf5fe011f1a765