Fixed resource links
This commit is contained in:
parent
cb51aa3ab1
commit
6aa929711c
11 changed files with 5 additions and 1 deletions
|
@ -46,6 +46,7 @@ function main() {
|
|||
|
||||
app.route("/", page(require("./views/pages/home")(app)));
|
||||
app.route("/resources", page(require("./views/pages/resources")(app)));
|
||||
app.route("/resources/*", page(require("./views/pages/page")(app)));
|
||||
app.route("/tour", page(require("./views/pages/tour")(app)));
|
||||
app.route("/*", page(require("./views/pages/page")(app)));
|
||||
|
||||
|
|
|
@ -48,7 +48,10 @@ const raw = require("nanohtml/raw");
|
|||
// E X P O R T
|
||||
|
||||
module.exports = exports = () => async state => {
|
||||
const path = state.params.wildcard;
|
||||
let path;
|
||||
|
||||
if (state.route === "resources/*") path = `resources/${state.params.wildcard}`;
|
||||
else path = state.params.wildcard;
|
||||
|
||||
if (!fs.existsSync(`./documents/${path}.md`)) {
|
||||
return html`
|
||||
|
|
Loading…
Reference in a new issue