Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/userGuide/syntax/footers.mbdf
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<frontmatter>` will override the footer within the Layout.
- If you wish to use a Layout but exclude its footer file, specify `footer: none` in the `<frontmatter>` of the page.
- [MarkBind Components]({{ baseUrl }}/userGuide/usingComponents.html) and [`<include>` tags]({{ baseUrl }}/userGuide/reusingContents.html#the-include-tag) are not supported in footers.

<span id="short" class="d-none">
Expand Down
1 change: 1 addition & 0 deletions docs/userGuide/syntax/headers.mbdf
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<frontmatter>` will override the header within the Layout.
- If you wish to use a Layout but exclude its header file, specify `header: none` in the `<frontmatter>` of the page.
- [MarkBind Components]({{ baseUrl }}/userGuide/usingComponents.html) and [`<include>` tags]({{ baseUrl }}/userGuide/reusingContents.html#the-include-tag) are not supported in headers.

<span id="short" class="d-none">
Expand Down
2 changes: 2 additions & 0 deletions docs/userGuide/syntax/pageHead.mbdf
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,5 @@ To specify that you want to insert `myCustomLinks.md` into the `<head>` of `myPa
</frontmatter>
```
</span>

If you wish to use a [Layout]({{ baseUrl }}/userGuide/tweakingThePageStructure.html#page-layouts) but exclude its head file, specify `head: none` in the `<frontmatter>` of the page.
2 changes: 2 additions & 0 deletions docs/userGuide/syntax/siteNavigationMenus.mbdf
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<frontmatter>` of the page.


<span id="short" class="d-none">

Expand Down
19 changes: 19 additions & 0 deletions src/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -669,6 +682,12 @@ class Page {

collectHeadFiles(baseUrl, hostBaseUrl) {
const { head } = this.frontMatter;
if (head === FRONT_MATTER_NONE_ATTR) {
Comment thread
yash-chowdhary marked this conversation as resolved.
this.headFileTopContent = '';
this.headFileBottomContent = '';
return;
}

let headFiles;
const collectedTopContent = [];
const collectedBottomContent = [];
Expand Down
1 change: 1 addition & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down