diff --git a/docs/_includes/edit_button.html b/docs/_includes/edit_button.html index 801ef54442..c01e84d97b 100644 --- a/docs/_includes/edit_button.html +++ b/docs/_includes/edit_button.html @@ -1,9 +1,8 @@ -{% assign pagePath = page.inputPath | replace: "./", "" %} diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html index 63670b0804..34028984b9 100644 --- a/docs/_layouts/default.html +++ b/docs/_layouts/default.html @@ -69,12 +69,14 @@
-

{{ title }}

- {% if edit != false %} - +

{{ title }} + + {% if edit != false %} + {% include edit_button.html %} - {% endif %} + {% endif %} +

{% if sub_title %}

{{ sub_title}}

{% endif %} diff --git a/docs/eleventy.config.js b/docs/eleventy.config.js index 3ff0e68e26..cacf3a56fb 100644 --- a/docs/eleventy.config.js +++ b/docs/eleventy.config.js @@ -18,7 +18,9 @@ module.exports = eleventyConfig => { eleventyConfig.addGlobalData('permalink', '/{{ page.filePathStem }}.html'); eleventyConfig.addCollection('guides', collectionApi => { - return collectionApi.getFilteredByTag('guides').sort((a, b) => a.data.index - b.data.index); + return collectionApi + .getFilteredByTag('guides') + .sort((a, b) => a.data.index - b.data.index); }); eleventyConfig.addCollection('pages', collectionApi => { @@ -43,6 +45,10 @@ module.exports = eleventyConfig => { .sort((a, b) => b.date - a.date || b.inputPath.localeCompare(a.inputPath)); }); + eleventyConfig.addFilter("formatInputPath", function(value) { + return value.replace("./", "").replace("_guides", "guides").replace("_posts", "post"); + }); + eleventyConfig.addFilter('first_paragraph', function(content) { const marker = '

'; const idx = content.indexOf(marker);