1
0
Fork 0

Add “edit this page” link

This commit is contained in:
Shipow 2018-08-25 10:43:36 +02:00
parent c3a185846c
commit c0076f9962
2 changed files with 10 additions and 3 deletions

View file

@ -41,6 +41,8 @@ export default {
'./src',
_.replace(filepath, '.md', '.html')
);
const srcpath =
siteConfig.site.repo + _.replace(filepath, './', '/tree/master/docs/');
const destination = `./dist/${currentUrl}`;
// Read file, and extract front-matter from raw text
@ -86,6 +88,7 @@ export default {
current: {
url: currentUrl,
content: htmlBody,
src: srcpath,
...fileConfig,
},
};

View file

@ -11,14 +11,14 @@ block nav
.md_hidden.flex.justify-start.items-center.mx-2
button.custom-toggle-nav.text-solstice.items-center.hover_text-grey-darker.focus_outline-none
svg.align-text-bottom.navigation-open.h-1x.w-1x.fill-current(role="button", xmlns="http://www.w3.org/2000/svg", viewBox="0 0 20 20")
path(d="M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z")
path(d="M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z")
svg.align-text-bottom.navigation-close.hidden.h-1x.w-1x.fill-current(role="button", xmlns="http://www.w3.org/2000/svg", viewBox="0 0 20 20")
path(d="M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z")
block content
.bgtb-moon-white-pure.relative
.md_flex.max-w-lg.m-auto
.navigation-sidebar.sticky.pin-t.top-3.h-100vh-3.overflow-y-auto.hidden.md_block.bg-white
.navigation-sidebar.sticky.pin-t.top-3.h-100vh-3.overflow-y-auto.hidden.md_block.bg-white.pl-1
// Adding subsections from markdown
.pt-2.w-5.m-auto.sm_flex.sm_w-90.md_block.md_w-100
each category in sidebar
@ -35,7 +35,7 @@ block content
ul.list-reset.pl-1.text-1
each heading in page.headings
li
a.block.py-0x.text-telluric.whitespace-pre(href=`${page.url}#${heading.anchor}`)=heading.title
a.block.py-0x.text-telluric(href=`${page.url}#${heading.anchor}`)=heading.title
.documentation-content.text-2.pt-2.pb-1.px-2.w_100.md_w-75
.block.md_hidden.mb-1
@ -44,6 +44,10 @@ block content
a(href=`${site.url}/what-is-docsearch.html`) Documentation
.custom-main-title.text-5.lg_text-7.uppercase.tracking-poppins.text-solstice.bold.mb-2=current.title
!=current.content
br
br
a(href=current.src) edit this page
// Include the apply form
if current.includeForm
.mt-2