Bump GET parameter for force-refreshing CSS and JS
This commit is contained in:
@ -59,6 +59,9 @@ function generateTranslationFile(string $lang):string {
|
||||
'news' => $tlLoader->tl("csvxml-overview", "csvxml_overview", 'news'),
|
||||
'imprint' => $tlLoader->tl("csvxml-overview", "csvxml_overview", 'imprint'),
|
||||
'about' => $tlLoader->tl("csvxml-overview", "csvxml_overview", 'about'),
|
||||
|
||||
'help_where_am_i' => $tlLoader->tl("csvxml-overview", "csvxml_overview", 'help_where_am_i'),
|
||||
'help_where_am_i_content' => $tlLoader->tl("csvxml-overview", "csvxml_overview", 'help_where_am_i_content'),
|
||||
]);
|
||||
|
||||
}
|
||||
@ -76,7 +79,7 @@ function generateAppShell():string {
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="assets/css/csvxml.min.css?v000003" />
|
||||
<link rel="stylesheet" type="text/css" href="assets/css/csvxml.min.css?v000005" />
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
<meta name="theme-color" content="#aa4400" />
|
||||
|
||||
@ -99,7 +102,7 @@ function generateAppShell():string {
|
||||
</head>
|
||||
<body class="loading">
|
||||
|
||||
<script src="assets/js/csvxmlV2.min.js?v000003" type="text/javascript" async></script>
|
||||
<script src="assets/js/csvxmlV2.min.js?v000005" type="text/javascript" async></script>
|
||||
|
||||
</body>
|
||||
</html>';
|
||||
@ -109,21 +112,29 @@ function generateAppShell():string {
|
||||
const SERVED_ROOT = __DIR__ . '/../public/';
|
||||
const SERVED_JSON_ROOT = __DIR__ . '/../public/json/';
|
||||
|
||||
if (!is_dir(SERVED_JSON_ROOT)) mkdir(SERVED_JSON_ROOT);
|
||||
if (!is_dir(SERVED_JSON_ROOT)) {
|
||||
echo "Will generate JSON root directory (" . SERVED_JSON_ROOT . ")" . PHP_EOL;
|
||||
MD_STD::mkdir(SERVED_JSON_ROOT);
|
||||
}
|
||||
|
||||
foreach (ALLOWED_LANGS as $lang) {
|
||||
echo "Will generate JSON list of fields for language: " . $lang . PHP_EOL;
|
||||
file_put_contents(SERVED_JSON_ROOT . 'fields.' . $lang . '.json', generateFieldsIndex($lang));
|
||||
echo "Will generate JSON list of translations for language: " . $lang . PHP_EOL;
|
||||
file_put_contents(SERVED_JSON_ROOT . 'tls.' . $lang . '.json', generateTranslationFile($lang));
|
||||
}
|
||||
|
||||
echo "Will generate app shell" . PHP_EOL;
|
||||
file_put_contents(SERVED_ROOT . 'index.htm', generateAppShell());
|
||||
|
||||
echo "Will minify CSS" . PHP_EOL;
|
||||
exec("minify \\
|
||||
-o " . escapeshellarg(__DIR__ . '/../public/assets/css/csvxml.min.css') . '\\
|
||||
' . escapeshellarg(__DIR__ . '/../public/assets/css/editMenu.css') . '\\
|
||||
' . escapeshellarg(__DIR__ . '/../public/assets/css/dialogue.css') . '\\
|
||||
' . escapeshellarg(__DIR__ . '/../public/assets/css/csvxml.css'));
|
||||
|
||||
echo "Will minify JS" . PHP_EOL;
|
||||
exec("minify \\
|
||||
-o " . escapeshellarg(__DIR__ . '/../public/assets/js/csvxmlV2.min.js') . '\
|
||||
' . escapeshellarg(__DIR__ . '/../public/assets/js/csvxmlV2.js'));
|
||||
|
Reference in New Issue
Block a user