on master help sign in
cache: get relative link of slug
commitbe2b5faf8754efb2cc13d7b953820c09bc17ddd9 authorMatilde Park <matilde@tlon.io> dateThu 24 Jun 2021, 17:17 (5 years ago) parentb9b839d
1 file changed+4−1
lib/cache.js+4−1
lib/cache.js+4−1
@@ -38,7 +38,10 @@ function buildSearchIndex(dir) {
3838 return {
3939 title: pageData.title,
4040 base: page.name,
41− slug: page.name.replace(/.md$/, ""),
41+ slug: path.join(
42+ dir.substr(dir.indexOf("content/") + 7),
43+ page.name.replace(/.md$/, "")
44+ ),
4245 content: pageContent,
4346 parent: metadata.data.title,
4447 };