Fix demo
This commit is contained in:
parent
d9338543eb
commit
43b5f62210
@ -4,22 +4,18 @@ echo "Building silver bullet"
|
||||
npm run clean-build
|
||||
echo "Cleaning website build dir"
|
||||
rm -rf website_build
|
||||
mkdir -p website_build/page/_plug
|
||||
mkdir -p website_build/fs/_plug
|
||||
echo "Copying silverbullet runtime files"
|
||||
cp -r packages/web/dist/* website_build/
|
||||
echo "Copying netlify config files"
|
||||
cp website/{_redirects,_headers} website_build/
|
||||
|
||||
echo "Copying website markdown files"
|
||||
cp -r website/* website_build/page/
|
||||
rm website_build/page/{_redirects,_headers}
|
||||
cp -r website/* website_build/fs/
|
||||
rm website_build/fs/{_redirects,_headers}
|
||||
|
||||
echo "Copying standard set of plugs"
|
||||
cp packages/plugs/dist/* website_build/page/_plug/
|
||||
|
||||
echo "Applying rename magic"
|
||||
find website_build/page/ -depth -name "*.md" -exec sh -c 'mv "$1" "${1%.md}"' _ {} \;
|
||||
find website_build/page/ -depth -name "*.plug.json" -exec sh -c 'mv "$1" "${1%.plug.json}"' _ {} \;
|
||||
cp packages/plugs/dist/* website_build/fs/_plug/
|
||||
|
||||
echo "Generating file listing"
|
||||
node scripts/generate_fs_list.js > website_build/index.json
|
||||
|
@ -12,15 +12,12 @@ async function getFiles(dir) {
|
||||
return Array.prototype.concat(...files);
|
||||
}
|
||||
|
||||
const rootDir = resolve("website_build/page");
|
||||
const rootDir = resolve("website_build/fs");
|
||||
|
||||
getFiles(rootDir).then((files) => {
|
||||
files = files
|
||||
.map((file) => ({
|
||||
name: file
|
||||
.substring(rootDir.length + 1)
|
||||
.replace(/\.md$/, "")
|
||||
.replace(/\.plug\.json$/, ""),
|
||||
name: file.substring(rootDir.length + 1),
|
||||
lastModified: 0,
|
||||
perm: "rw",
|
||||
}))
|
||||
|
@ -1,8 +1,8 @@
|
||||
/page/_plug/*
|
||||
/fs/_plug/*
|
||||
Content-Type: application/json
|
||||
Last-Modified: 0
|
||||
X-Permission: ro
|
||||
/page/*
|
||||
/fs/*
|
||||
Content-Type: text/markdown
|
||||
Last-Modified: 0
|
||||
X-Permission: rw
|
||||
|
Loading…
Reference in New Issue
Block a user