From 796c1021edcf515ebc8d8afa0c840eff449c2fb8 Mon Sep 17 00:00:00 2001 From: yash-chowdhary Date: Wed, 29 Jan 2020 10:39:03 +0800 Subject: [PATCH 1/6] Update user guide --- docs/userGuide/syntax/footers.mbdf | 1 + 1 file changed, 1 insertion(+) 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. From f9c5eb0fe122c1ca6e2c317d6a7cebf2fddeccd6 Mon Sep 17 00:00:00 2001 From: yash-chowdhary Date: Tue, 4 Feb 2020 09:57:28 +0800 Subject: [PATCH 2/6] Replace none string with constant --- src/Page.js | 5 +++++ src/constants.js | 1 + 2 files changed, 6 insertions(+) diff --git a/src/Page.js b/src/Page.js index 880ed32198..e882136b60 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, @@ -496,6 +497,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); 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', From 27c1a268a3fba66ba0ea76f4bfea1ebd01522f20 Mon Sep 17 00:00:00 2001 From: yash-chowdhary Date: Tue, 4 Feb 2020 10:22:07 +0800 Subject: [PATCH 3/6] Remove trailing space --- src/Page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Page.js b/src/Page.js index e882136b60..ba7829b601 100644 --- a/src/Page.js +++ b/src/Page.js @@ -500,7 +500,7 @@ class Page { if (footer === FRONT_MATTER_NONE_ATTR) { return pageData; } - + let footerFile; if (footer) { footerFile = path.join(FOOTERS_FOLDER_PATH, footer); From 59a472182b9ca262337bb4df0b193d12fcece44e Mon Sep 17 00:00:00 2001 From: yash-chowdhary Date: Tue, 4 Feb 2020 20:08:52 +0800 Subject: [PATCH 4/6] Extend functionality to other components of layout --- src/Page.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Page.js b/src/Page.js index ba7829b601..c2173c627e 100644 --- a/src/Page.js +++ b/src/Page.js @@ -471,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); @@ -528,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); @@ -674,6 +682,10 @@ class Page { collectHeadFiles(baseUrl, hostBaseUrl) { const { head } = this.frontMatter; + if (head === FRONT_MATTER_NONE_ATTR) { + return; + } + let headFiles; const collectedTopContent = []; const collectedBottomContent = []; From 1251e8e442c447de299c957fcb88583e58847f84 Mon Sep 17 00:00:00 2001 From: yash-chowdhary Date: Tue, 4 Feb 2020 20:21:46 +0800 Subject: [PATCH 5/6] Update user guide --- docs/userGuide/syntax/headers.mbdf | 1 + docs/userGuide/syntax/pageHead.mbdf | 2 ++ docs/userGuide/syntax/siteNavigationMenus.mbdf | 2 ++ 3 files changed, 5 insertions(+) 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. + From 41599ff7622955924b9572da278b73da27d58330 Mon Sep 17 00:00:00 2001 From: yash-chowdhary Date: Wed, 5 Feb 2020 10:19:05 +0800 Subject: [PATCH 6/6] Set headFileContent properties appropriately --- src/Page.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Page.js b/src/Page.js index c2173c627e..2a35bfeba1 100644 --- a/src/Page.js +++ b/src/Page.js @@ -683,6 +683,8 @@ class Page { collectHeadFiles(baseUrl, hostBaseUrl) { const { head } = this.frontMatter; if (head === FRONT_MATTER_NONE_ATTR) { + this.headFileTopContent = ''; + this.headFileBottomContent = ''; return; }