Ensure CSS updates after deploy
This commit is contained in:
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
@@ -9,6 +9,13 @@
|
||||
"./_dokuwiki/vendor"
|
||||
],
|
||||
|
||||
// DokuWiki replaces @ini_* placeholders server-side.
|
||||
// VS Code's CSS validator doesn't understand those tokens, but LESS does.
|
||||
"files.associations": {
|
||||
"style.css": "less",
|
||||
"temp-input-colors.css": "less"
|
||||
},
|
||||
|
||||
// Keep the file explorer tidy when the optional DokuWiki checkout exists.
|
||||
"files.exclude": {
|
||||
"**/_dokuwiki/.git": true,
|
||||
|
||||
12
README.md
12
README.md
@@ -167,6 +167,18 @@ the template provides proper form control styles.
|
||||
|
||||
Temporary file: [temp-input-colors.css](temp-input-colors.css)
|
||||
|
||||
Developer note: DokuWiki serves a combined stylesheet via `lib/exe/css.php` and caches it.
|
||||
Cache invalidation is based on the mtimes of the source CSS/LESS files.
|
||||
If you deploy into a mounted/remote filesystem with a different clock, preserving mtimes can prevent
|
||||
automatic invalidation (making it look like your CSS changes don't load until you purge cache).
|
||||
|
||||
`deploy.sh` avoids preserving mtimes by default to make CSS iteration smoother. If you explicitly want
|
||||
to preserve mtimes, use:
|
||||
|
||||
```bash
|
||||
./deploy.sh --preserve-times
|
||||
```
|
||||
|
||||
|
||||
## Features and usage
|
||||
|
||||
|
||||
@@ -41,7 +41,8 @@ class action_plugin_luxtools extends ActionPlugin
|
||||
*/
|
||||
public function addScripts(Event $event, $param)
|
||||
{
|
||||
$base = DOKU_BASE . "lib/plugins/luxtools/js/";
|
||||
$plugin = $this->getPluginName();
|
||||
$base = DOKU_BASE . "lib/plugins/$plugin/js/";
|
||||
$scripts = [
|
||||
"lightbox.js",
|
||||
"gallery-thumbnails.js",
|
||||
@@ -75,7 +76,8 @@ class action_plugin_luxtools extends ActionPlugin
|
||||
return;
|
||||
}
|
||||
|
||||
$event->data['files'][DOKU_PLUGIN . 'luxtools/temp-input-colors.css'] = DOKU_BASE . 'lib/plugins/luxtools/';
|
||||
$plugin = $this->getPluginName();
|
||||
$event->data['files'][DOKU_PLUGIN . $plugin . '/temp-input-colors.css'] = DOKU_BASE . 'lib/plugins/' . $plugin . '/';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
13
deploy.sh
13
deploy.sh
@@ -9,10 +9,12 @@ set -euo pipefail
|
||||
# ./deploy.sh --dry-run # show what would change
|
||||
# ./deploy.sh /path/to/luxtools
|
||||
# ./deploy.sh --no-delete # don't delete extraneous files at target
|
||||
# ./deploy.sh --preserve-times # keep source mtimes at target
|
||||
|
||||
TARGET="/thebe/Web/lib/plugins/luxtools"
|
||||
DRY_RUN=0
|
||||
DELETE=1
|
||||
PRESERVE_TIMES=0
|
||||
|
||||
while (($#)); do
|
||||
case "$1" in
|
||||
@@ -24,6 +26,10 @@ while (($#)); do
|
||||
DELETE=0
|
||||
shift
|
||||
;;
|
||||
--preserve-times)
|
||||
PRESERVE_TIMES=1
|
||||
shift
|
||||
;;
|
||||
-h|--help)
|
||||
sed -n '1,80p' "$0"
|
||||
exit 0
|
||||
@@ -79,6 +85,13 @@ RSYNC_ARGS=(
|
||||
--exclude=.DS_Store
|
||||
)
|
||||
|
||||
# DokuWiki's combined CSS (lib/exe/css.php) is cached and invalidated based on source file mtimes.
|
||||
# When deploying to a mounted/remote filesystem with a different clock, preserving mtimes can make
|
||||
# DokuWiki think the cache is always newer than your plugin CSS. Avoid that by default.
|
||||
if (( ! PRESERVE_TIMES )); then
|
||||
RSYNC_ARGS+=(--no-times --omit-dir-times)
|
||||
fi
|
||||
|
||||
if ((DRY_RUN)); then
|
||||
RSYNC_ARGS+=(--dry-run)
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user