diff --git a/site/brand/README.md b/site/brand/README.md new file mode 100644 index 00000000..2e81c18c --- /dev/null +++ b/site/brand/README.md @@ -0,0 +1,14 @@ +# site/brand -- the wikis' banner + +The top bar of both XWikis shows the starshipOS wordmark, not XWiki's logo, and the browser tab's +title ends "- StarshipOS" (Captain Bob, 2026-11-07). `starshipos-com.png` and `starshipos-org.png` +are the wordmark (Exo 2, white with an orange "OS", transparent), rendered at 2x. + +``` +XWIKI_USER=rajames XWIKI_PASSWORD=... site/brand/install.sh https://starshipos-f18.com starshipos-com.png +XWIKI_USER=rajames XWIKI_PASSWORD=... site/brand/install.sh https://starshipos-f18.org starshipos-org.png +``` + +The logo belongs to the colour theme, so this makes one of our own, `FlamingoThemes.StarshipOS` (a +copy of the stock Iceberg with the wordmark), and makes it the wiki's. To undo: set the wiki's +colour theme back to Iceberg (Administration, Look & Feel, Themes). diff --git a/site/brand/install.sh b/site/brand/install.sh new file mode 100755 index 00000000..d0eaa39f --- /dev/null +++ b/site/brand/install.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# install.sh -- the wiki's banner says StarshipOS, not XWiki (Captain Bob, 2026-11-07: "The banner +# XWiki should not say that"). +# +# site/brand/install.sh https://starshipos-f18.com starshipos-com.png +# site/brand/install.sh https://starshipos-f18.org starshipos-org.png +# +# In XWiki 17 the top bar's logo is the colour theme's. This makes a colour theme of our own, +# FlamingoThemes.StarshipOS -- a copy of the stock Iceberg with our wordmark as its logo -- and +# makes it the wiki's; the stock theme is not touched (set colorTheme back to +# FlamingoThemes.Iceberg to undo). It also makes the browser tab's title " - StarshipOS". +# Run again after changing the wordmark: the logo is replaced. XWIKI_USER and XWIKI_PASSWORD as for +# site/*/install.sh. Everything goes as XML: XWiki refuses form and plain-text writes without its +# form token. +set -euo pipefail +cd "$(dirname "$0")" +base=${1:?usage: install.sh } +logo=${2:?usage: install.sh } +rest="$base/rest/wikis/xwiki/spaces" +auth=(-u "${XWIKI_USER:?set XWIKI_USER}:${XWIKI_PASSWORD:?set XWIKI_PASSWORD}") +theme="$rest/FlamingoThemes/pages/StarshipOS" +x() { curl -fsS -m 60 "${auth[@]}" "$@"; } +prop() { # prop : set one property + x -o /dev/null -w " $2: %{http_code}\n" -X PUT -H 'Content-Type: application/xml' \ + --data-binary "$(python3 -c ' +import sys +from xml.sax.saxutils import escape +print("%s" % (escape(sys.argv[1]), escape(sys.argv[2])))' "$2" "$3")" \ + "$1/properties/$2" +} + +echo "=== $base: the colour theme FlamingoThemes.StarshipOS" +x -o /dev/null -w " page: %{http_code}\n" -X PUT -H 'Content-Type: application/xml' --data-binary \ + 'StarshipOSxwiki/2.1{{include reference="FlamingoThemesCode.ThemeSheet"/}}' \ + "$theme" +x -o /dev/null -w " logo $logo: %{http_code}\n" -X PUT -H 'Content-Type: image/png' --data-binary "@$logo" \ + "$theme/attachments/$logo" +have=$(x -H 'Accept: application/json' "$theme/objects/FlamingoThemesCode.ThemeClass" | + python3 -c 'import json,sys; print(len(json.load(sys.stdin).get("objectSummaries") or []))') +if [ "$have" = 0 ]; then + # Iceberg's theme object, every property as it is, posted to our page + x -H 'Accept: application/xml' "$rest/FlamingoThemes/pages/Iceberg/objects/FlamingoThemesCode.ThemeClass/0" | + x -o /dev/null -w " theme object, from Iceberg: %{http_code}\n" -X POST -H 'Content-Type: application/xml' \ + --data-binary @- "$theme/objects" +fi +prop "$theme/objects/FlamingoThemesCode.ThemeClass/0" logo "$logo" +prop "$theme/objects/FlamingoThemesCode.ThemeClass/0" logo-description "StarshipOS" + +echo "=== the wiki's preferences" +prefs="$rest/XWiki/pages/XWikiPreferences/objects/XWiki.XWikiPreferences/0" +prop "$prefs" colorTheme "FlamingoThemes.StarshipOS" +prop "$prefs" title "\$tdoc.getRenderedTitle('plain/1.0') - StarshipOS" + +echo "=== check, as a guest" +page=$(curl -sS -m 60 "$base/bin/login/XWiki/XWikiLogin") # a page that shows the chrome to a guest +case "$page" in *"FlamingoThemes/StarshipOS/$logo"*) echo " the banner's logo: ours";; *) echo " the banner's logo: NOT ours" >&2; exit 1;; esac +case "$page" in *"- StarshipOS"*) echo " the tab's title: ends - StarshipOS";; *) echo " the tab's title: NOT ours" >&2; exit 1;; esac diff --git a/site/brand/starshipos-com.png b/site/brand/starshipos-com.png new file mode 100644 index 00000000..c4c32a1e Binary files /dev/null and b/site/brand/starshipos-com.png differ diff --git a/site/brand/starshipos-org.png b/site/brand/starshipos-org.png new file mode 100644 index 00000000..2ebd2089 Binary files /dev/null and b/site/brand/starshipos-org.png differ