Skip to content

Allow using 'none' footer attribute in frontmatter - #1002

Merged
yamgent merged 6 commits into
MarkBind:masterfrom
yash-chowdhary:footer-none
Feb 23, 2020
Merged

Allow using 'none' footer attribute in frontmatter#1002
yamgent merged 6 commits into
MarkBind:masterfrom
yash-chowdhary:footer-none

Conversation

@yash-chowdhary

@yash-chowdharyyash-chowdhary commented Jan 29, 2020

Copy link
Copy Markdown
Contributor

What is the purpose of this pull request? (put "X" next to an item, remove the rest)

  • Enhancement to an existing feature

Fixes#638

What is the rationale for this request?

Enables users to exclude the footer that is derived/inherited from the layout specified in the <frontmatter>.

What changes did you make? (Give an overview)
Added a check for when the footer attribute is none while inserting the footer file into a Page.

Testing instructions:

  • Specify a layout in a page's <frontmatter>
  • Add footer: none to <frontmatter>
  • Build and serve site

Expected output: Footer of the derived layout is omitted

Proposed commit message: (wrap lines at 72 characters)
Allow using 'none' footer attribute in frontmatter

@crphangcrphang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall approach seems okay.

Even though it might not be in the scope of this PR, wondering whether this functionality should only be for footer? @damithc

Comment threadsrc/Page.js Outdated
let footerFile;

if (footer === 'none') {
// avoid adding any footer

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment seems redundant

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will remove it 👍

Comment threadsrc/Page.js Outdated
const { footer } = this.frontMatter;
let footerFile;

if (footer === 'none') {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if 'none' is a keyword, put it as a constant.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will make the change 👍

@damithc

Copy link
Copy Markdown
Contributor

Even though it might not be in the scope of this PR, wondering whether this functionality should only be for footer? @damithc

There was a suggestion to extend this to other elements. I have no objections to that. I'll leave the decision to senior devs.

@yash-chowdhary

Copy link
Copy Markdown
ContributorAuthor

Even though it might not be in the scope of this PR, wondering whether this functionality should only be for footer? @damithc

There was a suggestion to extend this to other elements. I have no objections to that. I'll leave the decision to senior devs.

@yamgent@acjh any suggestions?

@yamgent

Copy link
Copy Markdown
Member

@yamgent@acjh any suggestions?

Sure, feel free to add it for header, site-nav, etc...

Comment threadsrc/Page.js
@yash-chowdhary

Copy link
Copy Markdown
ContributorAuthor

Ready for review

@yamgentyamgent added this to the v2.11.1 milestone Feb 23, 2020
@yamgent
yamgent merged commit e67dce1 into MarkBind:masterFeb 23, 2020
Tejas2805 added a commit to Tejas2805/markbind that referenced this pull request Feb 27, 2020
* 'master' of https://github.com/MarkBind/markbind:
Update tests
Allow using 'none' footer attribute in frontmatter (MarkBind#1002)
Support line numbers for code blocks (MarkBind#991)
2.11.0
Update test files due to changes in PR MarkBind#982
Update vue-strap version to v2.0.1-markbind.36
Make highlighting bold (MarkBind#1045)
Support markdown for header attr in dropdown (MarkBind#1029)
Add '_site' to the ignored folders in site.json (MarkBind#1046)
Use path.join instead of string interpolation (MarkBind#1052)
Implement box markdown header attributes parsing (MarkBind#1025)
Make the position of top navbar fixed (MarkBind#982)
Exclude *.md files from being copied over on build (MarkBind#1010)
# Conflicts:
#	docs/css/main.css
@yamgentyamgent added the pr.Enhancement 📈 Enhancement to an existing feature label Mar 3, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr.Enhancement 📈Enhancement to an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow using an empty footer attribute in frontmatter to omit the default footer

4 participants

@yash-chowdhary@damithc@yamgent@crphang