Skip to content

Commit

Permalink
Merge pull request #211 from opendata-swiss/feat/update-themes-mapping
Browse files Browse the repository at this point in the history
Feat/update themes mapping
  • Loading branch information
bellisk authored Nov 23, 2023
2 parents 3bbd4ea + 7d9447b commit 6767be3
Show file tree
Hide file tree
Showing 9 changed files with 1,129 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/deploy_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ jobs:
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS_PRODUCTION }}

- name: Deploy with rsync
run: rsync -avz -e 'ssh -p ${{ secrets.SSH_PORT_PRODUCTION }}' docs/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST_PRODUCTION }}:/var/www/dcat-ap.ch
run: |
rsync -avz -e 'ssh -p ${{ secrets.SSH_PORT_PRODUCTION }}' docs/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST_PRODUCTION }}:/var/www/dcat-ap.ch
rsync -avz -e 'ssh -p ${{ secrets.SSH_PORT_PRODUCTION }}' apache/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST_PRODUCTION }}:/var/www/dcat-ap.ch
37 changes: 37 additions & 0 deletions apache/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Options +FollowSymlinks
RewriteEngine On

# If the request contains .rdf, .ttl or .html, pass it through
RewriteCond %{REQUEST_URI} .*\.(html|ttl|rdf).*
RewriteRule ^.* - [L]

# Redirect vocabulary urls to most recent version of vocabulary in requested format
RewriteCond %{HTTP:Accept} application/rdf\+xml
RewriteRule ^vocabulary/themes/.*$ /vocabulary/themes/20231122.rdf [L,R=303]
RewriteCond %{HTTP:Accept} text/turtle
RewriteRule ^vocabulary/themes/.*$ /vocabulary/themes/20231122.ttl [L,R=303]
RewriteCond %{HTTP:Accept} text/html
RewriteRule ^vocabulary/themes/$ /vocabulary/themes/20231122.html [L,R=303]

RewriteCond %{HTTP:Accept} application/rdf\+xml
RewriteRule ^vocabulary/licenses/.*$ /vocabulary/licenses/20210623.rdf [L,R=303]
RewriteCond %{HTTP:Accept} text/turtle
RewriteRule ^vocabulary/licenses/.*$ /vocabulary/licenses/20210623.ttl [L,R=303]
RewriteCond %{HTTP:Accept} text/html
RewriteRule ^vocabulary/licenses/$ /vocabulary/licenses/20210623.html [L,R=303]

RewriteCond %{HTTP:Accept} application/rdf\+xml
RewriteRule ^vocabulary/publishers/.*$ /vocabulary/publishers/20210623.rdf [L,R=303]
RewriteCond %{HTTP:Accept} text/turtle
RewriteRule ^vocabulary/publishers/.*$ /vocabulary/publishers/20210623.ttl [L,R=303]
RewriteCond %{HTTP:Accept} text/html
RewriteRule ^vocabulary/publishers/$ /vocabulary/publishers/20210623.html [L,R=303]

# Redirect urls for vocabulary terms to anchors in most recent version
# This is only relevant for HTML requests
RewriteCond %{HTTP:Accept} text/html
RewriteRule ^vocabulary/themes/(.*) /vocabulary/themes/20231122.html#$1 [L,NE,R=303]
RewriteCond %{HTTP:Accept} text/html
RewriteRule ^vocabulary/licenses/(.*) /vocabulary/licenses/20210623.html#$1 [L,NE,R=303]
RewriteCond %{HTTP:Accept} text/html
RewriteRule ^vocabulary/publishers/(.*) /vocabulary/publishers/20210623.html#$1 [L,NE,R=303]
10 changes: 5 additions & 5 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
rel="stylesheet"
/>
<script
src="https://kit.fontawesome.com/a38bff75ad.js"
src="https://kit.fontawesome.com/edc0267a8f.js"
crossorigin="anonymous"
></script>
</head>
Expand Down Expand Up @@ -78,7 +78,7 @@ <h2>Standard Definition</h2>
<td>
<a href="releases/2.0/dcat-ap-ch.html" class="icon external"
>DCAT-AP CH V2</a
>
>
</td>
<td>Version 2.0.0</td>
<td>html</td>
Expand Down Expand Up @@ -130,19 +130,19 @@ <h2>Vocabularies</h2>
<tbody>
<tr>
<td>
<a href="vocabulary/themes/20210623.html"
<a href="vocabulary/themes/20231122.html"
>Dataset Theme</a
>
Vocabulary
</td>
<td>Version 1.0 Draft</td>
<td>
html |
<a href="vocabulary/themes/20210623.ttl" class="icon code"
<a href="vocabulary/themes/20231122.ttl" class="icon code"
>turtle</a
>
|
<a href="vocabulary/themes/20210623.rdf" class="icon download"
<a href="vocabulary/themes/20231122.rdf" class="icon download"
>rdf</a
>
</td>
Expand Down
2 changes: 1 addition & 1 deletion docs/vocabulary/licenses/20210623.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
rel="stylesheet"
/>
<script
src="https://kit.fontawesome.com/a38bff75ad.js"
src="https://kit.fontawesome.com/edc0267a8f.js"
crossorigin="anonymous"
></script>
</head>
Expand Down
2 changes: 1 addition & 1 deletion docs/vocabulary/publishers/20210623.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
rel="stylesheet"
/>
<script
src="https://kit.fontawesome.com/a38bff75ad.js"
src="https://kit.fontawesome.com/edc0267a8f.js"
crossorigin="anonymous"
></script>
</head>
Expand Down
2 changes: 1 addition & 1 deletion docs/vocabulary/themes/20210623.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
rel="stylesheet"
/>
<script
src="https://kit.fontawesome.com/a38bff75ad.js"
src="https://kit.fontawesome.com/edc0267a8f.js"
crossorigin="anonymous"
></script>
</head>
Expand Down
Loading

0 comments on commit 6767be3

Please sign in to comment.