Compare commits
No commits in common. "ee2611a5d768862a537ea6816ac87d36dfc0c817" and "1f18d7aacf76f905516f7a89e4c1651b26dc1e25" have entirely different histories.
ee2611a5d7
...
1f18d7aacf
5
.gitmodules
vendored
5
.gitmodules
vendored
|
@ -1,3 +1,4 @@
|
||||||
[submodule "abridge-orig"]
|
[submodule "themes/abridge"]
|
||||||
path = themes/abridge
|
path = themes/abridge
|
||||||
url = https://github.com/Jieiku/abridge.git
|
url = https://git.hoyer.xyz/harald/abridge.git
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,6 @@ const util = require("util");
|
||||||
const { exec } = require("child_process");
|
const { exec } = require("child_process");
|
||||||
const execPromise = util.promisify(exec);
|
const execPromise = util.promisify(exec);
|
||||||
|
|
||||||
if (!(fs.existsSync('config.toml'))) {
|
|
||||||
throw new Error('ERROR: cannot find config.toml!');
|
|
||||||
}
|
|
||||||
const tomlString = String(fs.readFileSync('config.toml'));
|
const tomlString = String(fs.readFileSync('config.toml'));
|
||||||
const data = TOML.parse(tomlString);
|
const data = TOML.parse(tomlString);
|
||||||
const js_prestyle = data.extra.js_prestyle;
|
const js_prestyle = data.extra.js_prestyle;
|
||||||
|
@ -40,23 +37,17 @@ async function execWrapper(cmd) {
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
}
|
}
|
||||||
if (stderr) {
|
if (stderr) {
|
||||||
console.log('ERROR: '+stderr);
|
console.log('Error: '+stderr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function abridge() {
|
async function abridge() {
|
||||||
if (offline === false) {
|
if (offline === false) {
|
||||||
if (typeof online_url !== 'undefined' && typeof online_indexformat !== 'undefined') {
|
|
||||||
replace.sync({files: 'config.toml', from: /base_url.*=.*/g, to: "base_url = \""+online_url+"\""});
|
replace.sync({files: 'config.toml', from: /base_url.*=.*/g, to: "base_url = \""+online_url+"\""});
|
||||||
replace.sync({files: 'config.toml', from: /index_format.*=.*/g, to: "index_format = \""+online_indexformat+"\""});
|
replace.sync({files: 'config.toml', from: /index_format.*=.*/g, to: "index_format = \""+online_indexformat+"\""});
|
||||||
}
|
|
||||||
} else if (offline === true) {
|
} else if (offline === true) {
|
||||||
if (typeof online_url !== 'undefined' && typeof online_indexformat !== 'undefined') {
|
|
||||||
replace.sync({files: 'config.toml', from: /base_url.*=.*/g, to: "base_url = \""+__dirname+"\/public\""});
|
replace.sync({files: 'config.toml', from: /base_url.*=.*/g, to: "base_url = \""+__dirname+"\/public\""});
|
||||||
replace.sync({files: 'config.toml', from: /index_format.*=.*/g, to: "index_format = \"elasticlunr_javascript\""});
|
replace.sync({files: 'config.toml', from: /index_format.*=.*/g, to: "index_format = \"elasticlunr_javascript\""});
|
||||||
} else {
|
|
||||||
throw new Error('ERROR: offline = true requires that online_url and online_indexformat are set in config.toml, so that the base_url and index_format can be restored if offline is later set to false.');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('Zola Build to generate files for minification:');
|
console.log('Zola Build to generate files for minification:');
|
||||||
|
@ -114,7 +105,6 @@ async function abridge() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pwa) {// Update pwa settings, file list, and hashes.
|
if (pwa) {// Update pwa settings, file list, and hashes.
|
||||||
if (typeof pwa_VER !== 'undefined' && typeof pwa_NORM_TTL !== 'undefined' && typeof pwa_LONG_TTL !== 'undefined' && typeof pwa_TTL_NORM !== 'undefined' && typeof pwa_TTL_LONG !== 'undefined' && typeof pwa_TTL_EXEMPT !== 'undefined') {
|
|
||||||
// update from abridge theme.
|
// update from abridge theme.
|
||||||
fs.copyFileSync(bpath+'static/sw.js', 'static/sw.js');
|
fs.copyFileSync(bpath+'static/sw.js', 'static/sw.js');
|
||||||
fs.copyFileSync(bpath+'static/js/sw_load.js', 'static/js/sw_load.js');
|
fs.copyFileSync(bpath+'static/js/sw_load.js', 'static/js/sw_load.js');
|
||||||
|
@ -134,8 +124,7 @@ async function abridge() {
|
||||||
replace.sync({files: 'static/sw.js', from: /TTL_EXEMPT.*=.*/g, to: "TTL_EXEMPT = ["+pwa_TTL_EXEMPT+"];"});
|
replace.sync({files: 'static/sw.js', from: /TTL_EXEMPT.*=.*/g, to: "TTL_EXEMPT = ["+pwa_TTL_EXEMPT+"];"});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pwa_cache_all === true) {
|
if (pwa_cache_all) {
|
||||||
console.log('info: pwa_cache_all = true in config.toml, so caching the entire site.\n');
|
|
||||||
// Generate array from the list of files, for the entire site.
|
// Generate array from the list of files, for the entire site.
|
||||||
|
|
||||||
var dir = 'public';
|
var dir = 'public';
|
||||||
|
@ -174,9 +163,6 @@ async function abridge() {
|
||||||
to: cache,
|
to: cache,
|
||||||
countMatches: true,
|
countMatches: true,
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
throw new Error('ERROR: pwa requires that pwa_VER, pwa_NORM_TTL, pwa_LONG_TTL, pwa_TTL_NORM, pwa_TTL_LONG, pwa_TTL_EXEMPT are set in config.toml.');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bpath === '') {// abridge used directly
|
if (bpath === '') {// abridge used directly
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit d45bc26c2250f573a0d83f755831857999fc125f
|
Subproject commit 21dfeb963068be3467b572a3307dd11c9efc33ba
|
Loading…
Reference in a new issue