diff --git a/docs/userGuide/syntax/footers.mbdf b/docs/userGuide/syntax/footers.mbdf index 22dfed5d27..28f047edb3 100644 --- a/docs/userGuide/syntax/footers.mbdf +++ b/docs/userGuide/syntax/footers.mbdf @@ -24,6 +24,7 @@ In the page that you want to include the footer: Notes: - Any inline footers will be removed by MarkBind to ensure compatibility with footer files. - If a [Layout]({{ baseUrl }}/userGuide/tweakingThePageStructure.html#page-layouts) is specified, the footer file specified in the `` will override the footer within the Layout. +- If you wish to use a Layout but exclude its footer file, specify `footer: none` in the `` of the page. - [MarkBind Components]({{ baseUrl }}/userGuide/usingComponents.html) and [`` tags]({{ baseUrl }}/userGuide/reusingContents.html#the-include-tag) are not supported in footers. diff --git a/docs/userGuide/syntax/headers.mbdf b/docs/userGuide/syntax/headers.mbdf index b570fa8e08..9cd3fef74f 100644 --- a/docs/userGuide/syntax/headers.mbdf +++ b/docs/userGuide/syntax/headers.mbdf @@ -26,6 +26,7 @@ In the page that you want to include the header: Notes: - Any inline headers will be removed by MarkBind to ensure compatibility with header files. - If a [Layout]({{ baseUrl }}/userGuide/tweakingThePageStructure.html#page-layouts) is specified, the header file specified in the `` will override the header within the Layout. +- If you wish to use a Layout but exclude its header file, specify `header: none` in the `` of the page. - [MarkBind Components]({{ baseUrl }}/userGuide/usingComponents.html) and [`` tags]({{ baseUrl }}/userGuide/reusingContents.html#the-include-tag) are not supported in headers. diff --git a/docs/userGuide/syntax/pageHead.mbdf b/docs/userGuide/syntax/pageHead.mbdf index 148e3754cd..043caad28c 100644 --- a/docs/userGuide/syntax/pageHead.mbdf +++ b/docs/userGuide/syntax/pageHead.mbdf @@ -78,3 +78,5 @@ To specify that you want to insert `myCustomLinks.md` into the `` of `myPa ``` + +If you wish to use a [Layout]({{ baseUrl }}/userGuide/tweakingThePageStructure.html#page-layouts) but exclude its head file, specify `head: none` in the `` of the page. diff --git a/docs/userGuide/syntax/siteNavigationMenus.mbdf b/docs/userGuide/syntax/siteNavigationMenus.mbdf index 254a9f58ef..eedcc46b54 100644 --- a/docs/userGuide/syntax/siteNavigationMenus.mbdf +++ b/docs/userGuide/syntax/siteNavigationMenus.mbdf @@ -89,6 +89,8 @@ A siteNav has a fixed width of 300 pixels for its contents. A siteNavs is [_resp There is no limit to the number of nesting levels or the number of items in the menu, but note that any content exceeding a height of 1000 pixels will be cut off. +If you wish to use a Layout but exclude its navigation file, specify `siteNav: none` in the `` of the page. + diff --git a/src/Page.js b/src/Page.js index 880ed32198..2a35bfeba1 100644 --- a/src/Page.js +++ b/src/Page.js @@ -37,6 +37,7 @@ const { NAVIGATION_FOLDER_PATH, CONTENT_WRAPPER_ID, FRONT_MATTER_FENCE, + FRONT_MATTER_NONE_ATTR, PAGE_NAV_ID, PAGE_NAV_TITLE_CLASS, SITE_NAV_ID, @@ -470,6 +471,10 @@ class Page { */ insertHeaderFile(pageData) { const { header } = this.frontMatter; + if (header === FRONT_MATTER_NONE_ATTR) { + return pageData; + } + let headerFile; if (header) { headerFile = path.join(HEADERS_FOLDER_PATH, header); @@ -496,6 +501,10 @@ class Page { */ insertFooterFile(pageData) { const { footer } = this.frontMatter; + if (footer === FRONT_MATTER_NONE_ATTR) { + return pageData; + } + let footerFile; if (footer) { footerFile = path.join(FOOTERS_FOLDER_PATH, footer); @@ -523,6 +532,10 @@ class Page { */ insertSiteNav(pageData) { const { siteNav } = this.frontMatter; + if (siteNav === FRONT_MATTER_NONE_ATTR) { + return pageData; + } + let siteNavFile; if (siteNav) { siteNavFile = path.join(NAVIGATION_FOLDER_PATH, siteNav); @@ -669,6 +682,12 @@ class Page { collectHeadFiles(baseUrl, hostBaseUrl) { const { head } = this.frontMatter; + if (head === FRONT_MATTER_NONE_ATTR) { + this.headFileTopContent = ''; + this.headFileBottomContent = ''; + return; + } + let headFiles; const collectedTopContent = []; const collectedBottomContent = []; diff --git a/src/constants.js b/src/constants.js index 984667811b..251ca40a40 100644 --- a/src/constants.js +++ b/src/constants.js @@ -20,6 +20,7 @@ module.exports = { CONTENT_WRAPPER_ID: 'content-wrapper', FRONT_MATTER_FENCE: '---', + FRONT_MATTER_NONE_ATTR: 'none', PAGE_NAV_ID: 'page-nav', PAGE_NAV_TITLE_CLASS: 'page-nav-title', SITE_NAV_ID: 'site-nav',