Skip to content

Commit

Permalink
node script cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Jieiku committed Aug 7, 2024
1 parent dcfd66a commit 126c4c9
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 54 deletions.
5 changes: 0 additions & 5 deletions content/static/tinysearch_json.md

This file was deleted.

18 changes: 1 addition & 17 deletions package_abridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 0 additions & 27 deletions templates/macros/create_tinysearch_json.html

This file was deleted.

5 changes: 0 additions & 5 deletions templates/tinysearch_json.html

This file was deleted.

0 comments on commit 126c4c9

Please sign in to comment.