diff --git a/content/blog/2024-03-20-skohub-pages/index.md b/content/blog/2024-03-20-skohub-pages/index.md new file mode 100644 index 0000000..1256729 --- /dev/null +++ b/content/blog/2024-03-20-skohub-pages/index.md @@ -0,0 +1,76 @@ +--- +title: Easier workflow for publishing your vocabularies +date: "2024-03-21" +authors: [{lastname: "Rörtgen", + firstname: "Steffen", + id: "https://lobid.org/team/sr#"}] +--- + +## Simplifying the workflow for publishing vocabularies + +Not all projects or individuals involved in the creation of controlled vocabularies are able or have the resources to run their own infrastructure. +Therefore, some time ago we pursued an approach that also makes it possible to use [SkoHub Vocabs](https://github.com/skohub-io/skohub-vocabs) based only on GitHub infrastructure. +The workflow is documented in the [SkoHub Pages](https://github.com/skohub-io/skohub-pages) repository. +For this we use the function "[GitHub Pages](https://docs.github.com/de/pages/getting-started-with-github-pages)" and "[GitHub Action](https://docs.github.com/en/actions)" +With GitHub Pages it is possible to host websites on the GitHub infrastructure. +GitHub Actions are used for automated tests and deployments. + +We have written a "GitHub Action" that ensures that a process is started after each push to the repository, which builds the vocabularies with SkoHub Vocabs. +The built vocabulary is then pushed to a separate git branch "gh-pages". +"GitHub Pages" in turn is configured to deliver HTML pages from this "gh-pages" branch. + +We have also used this approach in various workshops to introduce SKOS and SkoHub. +However, the workflow was not really user-friendly and required some adjustments in the GitHub action, so that some errors could quickly creep in. + +We have now been able to improve this 🎉 + +The relevant information is now set directly as environment variables and all other customizations can be changed via the GitHub GUI, so the workflow is now much more user-friendly. + +But that's not all! + +## Resolving custom domains + +Although with the presented approach the custom vocabulary could be provided without own infrastructure, the domains did not resolve to the GitHub pages. +This means that a concept scheme with an `@base` based on the GitHub Pages domain (e.g. `https://skohub-io.github.io/skohub-docker-vocabs/`) could not be resolved so far, which is why we recommended setting up a redirect via [w3id](https://w3id.org/) or [purl.org](https://purl.archive.org/). +It still makes sense to set up a redirect (in case the vocabulary moves somewhere else), but it is now also possible to use the domain that is assigned via GitHub Pages. + +To do this, a [`config.yaml`](https://github.com/skohub-io/skohub-pages/blob/main/config.yaml) must be created in the repo. +The respective domain must then be entered under the `custom_domain`. +Example: Your GitHub Pages domain is: https://skohub-io.github.io/skohub-docker-vocabs/ Then provide https://skohub-io.github.io/skohub-docker-vocabs/ as `custom_domain` in your config.yaml. + +The base of your concept scheme could then be something like: https://skohub-io.github.io/skohub-docker-vocabs/colours/ + +```yaml +#config.yaml +--- +# [...] +custom_domain: "https://skohub-io.github.io/skohub-docker-vocabs/" +#[...] +``` + +```turtle +# colors.ttl +@prefix colour: . +@prefix dct: . +@prefix skos: . +@prefix xsd: . + +colour: a skos:ConceptScheme ; + dct:title "Colour Vocabulary"@en, "Farbvokabular"@de ; + dct:creator "Hans Dampf"@de ; + dct:created "2021-11-02"^^xsd:date ; + dct:license ; + skos:hasTopConcept colour:violet, colour:blue . + +colour:violet a skos:Concept ; + skos:prefLabel "Violett"@de, "violet"@en; + skos:altLabel "Lila"@de, "purple"@en ; + skos:topConceptOf colour: . + +colour:blue a skos:Concept ; + skos:prefLabel "Blau"@de, "blue"@en ; + skos:topConceptOf colour: . +``` + +Feel free to try out our simplified approach and let us know if something does not work: +