skohub-io / skohub-vocabs

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

263 vocabs without apache #279

Closed sroertgen closed 5 months ago

sroertgen commented 8 months ago

SkoHub Vocabs is now no longer dependent on an Apache Webserver to be delivered through. The language is now chosen through the browser language.

All End-2-End tests and unit/integration tests are going through.

I deployed to dev and you can use the test webhook to test: https://test.skohub.io/sroertgen/test-vocabs/heads/main/

Benefits of this:

Open question:

Before merge:

Fixes #263 Fixes #270 Fixes #283

acka47 commented 7 months ago

See #280 for a problem introduced on with this PR on the test system.

acka47 commented 7 months ago

I did some functional review, Overall this looks very mature, but I noticed one thing:

Otherwise this looks good. Wrt the direct language links, I thin we should have them. At least fpr bug fixing in SkoHub or by a vocab's editors it will be useful to directly link to a page in a specific language. For me it would be ok to implement this by a query parameter, e.g. ?lang=de. And of course this should be set in the URL bar latest when I select a specific language. Probably it should already be set when the display ist set to the language requested by the browser or – if this is not available – when displaying the default language.

sroertgen commented 5 months ago

Parsing for an URL parameter lang= is implemented, see e.g.

https://test.skohub.io/sroertgen/test-vocabs/heads/main/?lang=nl https://test.skohub.io/sroertgen/test-vocabs/heads/main/w3id.org/kim/hcrt/scheme.html?lang=uk

If language from URL parameter does not exist, a default language is chosen:

https://test.skohub.io/sroertgen/test-vocabs/heads/main/w3id.org/kim/hcrt/scheme.html?lang=bla

Also the use of the browsers "Go Back" function should now remove the concept scheme info in the header.

Assigning @acka47 for testing.

acka47 commented 5 months ago

I build a new version on test with my testing repo to have a look at this: https://test.skohub.io/build/?id=58f2d04b-e0b7-4dc9-8cfd-97e13c088d3d

Parsing for an URL parameter lang= is implemented, see e.g.

https://test.skohub.io/sroertgen/test-vocabs/heads/main/?lang=nl

Yes, it works. See also https://test.skohub.io/acka47/testing-skohub-vocabs/heads/master/?lang=en

https://test.skohub.io/sroertgen/test-vocabs/heads/main/w3id.org/kim/hcrt/scheme.html?lang=uk

Hmm, this does not work for me: https://test.skohub.io/acka47/testing-skohub-vocabs/heads/master/w3id.org/kim/hcrt/assessment.html&lang=de Am I doing something wrong?

If language from URL parameter does not exist, a default language is chosen: https://test.skohub.io/sroertgen/test-vocabs/heads/main/w3id.org/kim/hcrt/scheme.html?lang=bla

Works here: https://test.skohub.io/acka47/testing-skohub-vocabs/heads/master/?lang=foo but not here: https://test.skohub.io/acka47/testing-skohub-vocabs/heads/master/w3id.org/kim/hcrt/assessment.html&lang=foo

Also the use of the browsers "Go Back" function should now remove the concept scheme info in the header.

Yes, this works now.

I have noticed that the URL does not change when switching the language. I think we have already discussed this. Did we settle on not representing the current language state anymore at all in the URL?

acka47 commented 5 months ago

My bad, it works with question mark instead of ampersand .

https://test.skohub.io/acka47/testing-skohub-vocabs/heads/master/w3id.org/kim/hcrt/assessment.html?lang=de https://test.skohub.io/acka47/testing-skohub-vocabs/heads/master/w3id.org/kim/hcrt/assessment.html?lang=foo

acka47 commented 5 months ago

So, this looks good. +1

I have noticed that the URL does not change when switching the language. I think we have already discussed this. Did we settle on not representing the current language state anymore at all in the URL?

This is ok. We will mainly use direct links to a language for debugging and now about how to create them. Others won't need this.

sroertgen commented 5 months ago

Assigning @Phu2 for setting up redirects:

If someone comes with ...index.de.html or ...scheme.de.html it needs to be redirected to index.html?lang=en or scheme.html?lang=de etc

Phu2 commented 5 months ago

Added

        # Redirect from ...filename.LANGCODE.html to ...filename.html?lang=LANGCODE
        RewriteRule ^(.+)\.([a-z]{2})\.html$ $1.html?lang=$2 [L,R=301]

to Apache vhost config test.skohub.io.conf and reloaded.

sroertgen commented 5 months ago

With https://github.com/skohub-io/skohub-webhook/pull/20 we tested to rebuild vocabularies on the test environment and it seems to work.

The redirect is also configured, so https://test.skohub.io/sroertgen/test-vocabs/heads/main/w3id.org/kim/hcrt/application.de.html will redirect to https://test.skohub.io/sroertgen/test-vocabs/heads/main/w3id.org/kim/hcrt/application.html?lang=de

Next steps will be:

What do you think @Phu2 @acka47 ?

Phu2 commented 5 months ago

+1

acka47 commented 5 months ago

Sounds good to me.

Last step:

sroertgen commented 5 months ago

Fallback if it would not work for any reason: