-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Facilities for harmonizing footers across TEv2 sites
Signed-off-by: Rieks <RieksJ@users.noreply.github.com>
- Loading branch information
Showing
9 changed files
with
116 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
The .json files in this directory are meant to be used to create a consistent layout across the documentation sites of the various tools, methods, specifications, etc. | ||
|
||
The way to achieve this in a particular repo is as follows. | ||
|
||
1. Create a copy of the directory `https://github.com/tno-terminology-design/tev2-specifications/tree/main/footer-links` in the directory in your repo that contains `docusaurus.config.js`. | ||
|
||
2. Edit `docusaurus.config.js` and make sure the following lines are at the beginning of that file: | ||
|
||
~~~ json | ||
const manuals = require('./footer-links/manuals.json'); | ||
const specifications = require('./footer-links/specifications.json'); | ||
const repositories = require('./footer-links/repositories.json'); | ||
const copyright = require('./footer-links/copyright.json'); | ||
~~~ | ||
|
||
3 Edit the `footer` section in `docusaurus.config.js`, adjusting its `links` field and `copyright` field so that they read (of course, if you don't want any of the `links` items, just leave them out; also, you can add your own items): | ||
|
||
~~~ json | ||
footer: { | ||
... | ||
links: [ | ||
{ title: manuals.title, items: manuals.items }, | ||
{ title: specifications.title, items: specifications.items, }, | ||
{ title: repositories.title, items: repositories.items }, | ||
], | ||
... | ||
copyright: copyright.text.replace("[20XX-20YY]",`2022-${new Date().getFullYear()}`) | ||
... | ||
}, | ||
~~~ | ||
|
||
4. Make sure to regularly update the contents of the `footer-links`-directory that you have created, which you can do in a github action (or similar) when you deploy your site. Alternatively, you can do that 'manually' while updating your repository, by executing either `update.ps1` in PowerShell or `update.sh` in Bash. | ||
|
||
At this moment, these scripts have not been tested and therefor may not (yet) work. | ||
Please create an issue or pull request specifying problems you encounter and solutions you found. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"text": "<p xmlns:cc='http://creativecommons.org/ns#' xmlns:dct='http://purl.org/dc/terms/'>\n<span property='dct:title'>The texts in this website</span> are licensed under\n<a href='http://creativecommons.org/licenses/by-sa/4.0/?ref=chooser-v1' target='_blank' rel='license noopener noreferrer' style='display:inline-block;'>\nCC BY-SA 4.0\n<img style='height:22px!important;margin-left:3px;vertical-align:text-bottom;' src='https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1'>\n<img style='height:22px!important;margin-left:3px;vertical-align:text-bottom;' src='https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1'>\n<img style='height:22px!important;margin-left:3px;vertical-align:text-bottom;' src='https://mirrors.creativecommons.org/presskit/icons/sa.svg?ref=chooser-v1'>\n</a>. Copyright © [20XX-20YY] by <span property='cc:attributionName'>TNO.</span>" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ "title": "TEv2 Manuals", | ||
"items": [ | ||
{ "label": "Curators", "href": "https://tno-terminology-design.github.io/tev2-specifications/docs/manuals/curator/curator-overview" }, | ||
{ "label": "Contributors", "href": "https://tno-terminology-design.github.io/tev2-specifications/docs/manuals/contributor/contributor-overview" }, | ||
{ "label": "Authors", "href": "https://tno-terminology-design.github.io/tev2-specifications/docs/manuals/author/author-overview" } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ "title": "TEv2 Tool Repo's", | ||
"items": [ | ||
{ "label": "MRGT", "href": "https://github.com/trustoverip/ctwg-toolkit-mrg" }, | ||
{ "label": "MRG Importer", "href": "https://github.com/tno-terminology-design/mrg-import" }, | ||
{ "label": "TRRT", "href": "https://github.com/tno-terminology-design/trrt" } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ "title": "TEv2 Specifications", | ||
"items": [ | ||
{ "label": "Files", "href": "https://tno-terminology-design.github.io/tev2-specifications/docs/tev2-spec-files" }, | ||
{ "label": "Syntaxes", "href": "https://tno-terminology-design.github.io/tev2-specifications/docs/tev2-syntax" }, | ||
{ "label": "Toolbox", "href": "https://tno-terminology-design.github.io/tev2-specifications/docs/tev2-toolbox" } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Define the necessary variables | ||
$USER = "tno-terminology-design" | ||
$REPO = "tev2-specifications" | ||
$BRANCH = "main" | ||
$DIR = "footer-links" | ||
|
||
# Download the ZIP of the branch | ||
Invoke-WebRequest -Uri "https://github.com/$USER/$REPO/archive/$BRANCH.zip" -OutFile "$BRANCH.zip" | ||
|
||
# Extract the specific directory's contents directly to the current location | ||
Add-Type -AssemblyName System.IO.Compression.FileSystem | ||
[System.IO.Compression.ZipFile]::ExtractToDirectory("$BRANCH.zip", "$BRANCH-temp") | ||
Copy-Item -Path "./$BRANCH-temp/$REPO-$BRANCH/$DIR/*" -Destination "./" -Recurse -Force | ||
|
||
# Cleanup | ||
Remove-Item -Recurse -Force "./$BRANCH-temp" | ||
Remove-Item "$BRANCH.zip" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
USER = "tno-terminology-design" | ||
REPO = "tev2-specifications" | ||
BRANCH = "main" | ||
DIR = "footer-links" | ||
|
||
# Download the ZIP of the branch | ||
wget "https://github.com/$USER/$REPO/archive/$BRANCH.zip" | ||
|
||
# Extract the specific directory's contents directly to the current location | ||
unzip -j "$BRANCH.zip" "$REPO-$BRANCH/$DIR/*" -d "./" | ||
|
||
# Cleanup | ||
rm -rf "$REPO-$BRANCH" "$BRANCH.zip" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters