diff options
| author | Jieiku | 2024-08-07 14:16:53 -0700 |
|---|---|---|
| committer | Jieiku | 2024-08-07 14:16:53 -0700 |
| commit | 126c4c9c914c178a9dbb682e6845ee0b51902797 (patch) | |
| tree | 9e6fb03d7cfaeb7d7f11cb7335cabe6fc028f87d /package_abridge.js | |
| parent | dcfd66a2f8ef4d1777deaaabed94d90c9e247dc8 (diff) | |
| download | abridge-126c4c9c914c178a9dbb682e6845ee0b51902797.tar.gz abridge-126c4c9c914c178a9dbb682e6845ee0b51902797.tar.bz2 abridge-126c4c9c914c178a9dbb682e6845ee0b51902797.zip | |
node script cleanup
Diffstat (limited to 'package_abridge.js')
| -rw-r--r-- | package_abridge.js | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/package_abridge.js b/package_abridge.js index 1edc243..9ddfdce 100644 --- a/package_abridge.js +++ b/package_abridge.js @@ -84,23 +84,7 @@ async function abridge() { base_url = base_url.slice(0, -1); } - if (search_library === 'elasticlunr') { - if (fs.existsSync('content/static/tinysearch_json.md')) { - replaceInFileSync({files: 'content/static/tinysearch_json.md', from: /draft.*=.*/g, to: "draft = true"}); - } - } else if (search_library === 'tinysearch') { - if (!fs.existsSync('content/static/tinysearch_json.md')) {// 'content/static/tinysearch_json.md' file is missing, copy from abridge theme. - fs.copyFileSync(bpath+'content/static/tinysearch_json.md', 'content/static/tinysearch_json.md',fs.constants.COPYFILE_EXCL); - } - if (fs.existsSync('content/static/tinysearch_json.md')) { - replaceInFileSync({files: 'content/static/tinysearch_json.md', from: /draft.*=.*/g, to: "draft = false"}); - } - // zola build && mkdir -p tmp && tinysearch --optimize --path tmp public/data_tinysearch/index.html && rsync -avz tmp/*.wasm static/ && rm -rf tmp - } else if (search_library === 'pagefind') { - if (fs.existsSync('content/static/tinysearch_json.md')) { - replaceInFileSync({files: 'content/static/tinysearch_json.md', from: /draft.*=.*/g, to: "draft = true"}); - } - + if (search_library === 'pagefind') { // Run the pagefind script to generate the index files. // Has to happen at start otherwise, it happens too late asyncronously. const createIndex = require('./static/js/pagefind.index.cjs'); // run the pagefind index.js script |
