Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deduplicate the assets directory #375

Merged
merged 2 commits into from
Dec 14, 2022
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
2 changes: 1 addition & 1 deletion docs/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ from wich the GUI is served.


**NOTE:** Don't forget to apply the changes to the `index.html` and Web
server configurartion after each updates as thoses files will be overwritten.
server configuration after each updates as thoses files will be overwritten.


## Change default language
Expand Down
8 changes: 7 additions & 1 deletion scripts/create_release.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ archive.pipe(output);

archive.file('zonemaster.conf-example', { name: 'zonemaster.conf-example' });
archive.file('LICENSE', { name: 'LICENSE' });
archive.directory('dist/', 'dist');

const localizedBundles = fs.readdirSync('dist', {withFileTypes: true})
.filter(entry => entry.isDirectory())
.map(entry => entry.name);

archive.glob('dist/**', {ignore: '**/assets/**'});
archive.directory(`dist/${localizedBundles[0]}/assets`, 'dist/assets');

archive.finalize();
3 changes: 3 additions & 0 deletions zonemaster.conf-example
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
RewriteBase ${BASE_URL}
RewriteRule ^../index\.html$ - [L]

# Rewrite /<LANG>/assets/ to /assets to share the assets directory
RewriteRule ^../(assets/.+) $1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (..) $1/index.html [L]
Expand Down