Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/update visual snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ jobs:
luarocks install --lua-version=5.1 busted

- name: Update snapshots
run: npm run lua-test
env:
UPDATE_SNAPSHOTS: true
run: npm run update-snapshots

- name: Commit and push if snapshots changed
uses: stefanzweifel/git-auto-commit-action@v7
Expand Down
4 changes: 2 additions & 2 deletions lua/spec/helpers/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<head>
<meta charset="UTF-8">
<title>Liquipedia</title>
<!-- TODO: We might in the future make the cacheversion dynamic -->
<link rel="stylesheet" href="https://liquipedia.net/commons/load.php?cacheversion=cipipeline&lang=en&modules=fontawesome-pro|ext.TeamLiquidIntegration.liquipedia-custom-icon|skins.lakesideview.mw|skins.lakesideview.theme.commons&only=styles&skin=lakesideview">
<!-- The wiki's own styles, fetched by scripts/fetch-remote-css.sh -->
<link rel="stylesheet" href="./css/lakeside.css">
<link rel="stylesheet" href="./css/main.css">
<script src="../../node_modules/jquery/dist/jquery.min.js"></script>
<script src="../../javascript/Main.js"></script>
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@
"lint:scss:ci": "stylelint \"stylesheets/**/*.scss\" --custom-formatter @csstools/stylelint-formatter-github",
"test:js": "jest",
"compile:scss": "sass stylesheets/Main.scss lua/output/css/main.css",
"fetch:remote-css": "bash scripts/fetch-remote-css.sh",
"build:css": "npm run compile:scss",
"build:js": "node build-js.js",
"build": "npm run build:css && npm run build:js",
"lua-test": "npm run build:css && busted -C lua",
"update-snapshots": "UPDATE_SNAPSHOTS=true npm run lua-test"
"update-snapshots": "npm run fetch:remote-css && UPDATE_SNAPSHOTS=true npm run lua-test"
}
}
18 changes: 18 additions & 0 deletions scripts/fetch-remote-css.sh
Comment thread
Rathoz marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail

# The styles liquipedia.net serves for the lakesideview skin, fetched once per
# run rather than once per snapshot.
# TODO: We might in the future make the cacheversion dynamic
URL='https://liquipedia.net/commons/load.php?cacheversion=cipipeline&lang=en&modules=fontawesome-pro|ext.TeamLiquidIntegration.liquipedia-custom-icon|skins.lakesideview.mw|skins.lakesideview.theme.commons&only=styles&skin=lakesideview'
ORIGIN='https://liquipedia.net'
OUTPUT='lua/output/css/lakeside.css'

cd "$(dirname "$0")/.."
mkdir -p "$(dirname "$OUTPUT")"

# The sed puts back the origin on fonts, logos and icons, which the bundle
# references from the site root, as both url(/x) and url("/x"). Off the local
# filesystem those resolve nowhere.
curl -fsS --compressed --max-time 30 "$URL" \
| sed -E 's|url\((["'\'']?)/|url(\1'"$ORIGIN"'/|g' > "$OUTPUT"
Loading