Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow layout to be disabled #63

Closed
mojavelinux opened this issue May 28, 2016 · 5 comments
Closed

Allow layout to be disabled #63

mojavelinux opened this issue May 28, 2016 · 5 comments
Assignees
Milestone

Comments

@mojavelinux
Copy link
Member

Allow the layout to be disabled. In this case, Asciidoctor's header_footer option is enabled so that the page is converted to a standalone HTML document.

The layout would be disabled by unsetting the page-layout attribute in the document header:

:page-layout!:

See the Middleman AsciiDoc extension for an example.

@mojavelinux
Copy link
Member Author

I've decided instead that explicit values will be easier to parse:

  • false :: don't use a layout; create a standalone document
  • ~ or null :: don't use a layout; don't create a standalone document
  • empty or not specified :: use the default (inherited) layout
  • otherwise, use the value to resolve a layout

@mojavelinux
Copy link
Member Author

The following can be used to create a standalone document:

:page-layout: false

@mojavelinux mojavelinux self-assigned this May 28, 2016
@mojavelinux mojavelinux added this to the v1.2.0 milestone May 28, 2016
@mojavelinux
Copy link
Member Author

mojavelinux commented May 28, 2016

In order for this to work, empty page attribute values need to be converter to an empty string instead of null. For example, the following should resolve to empty string:

:page-layout:

Currently, it's resolving to nil.

See #70.

mojavelinux added a commit to mojavelinux/jekyll-asciidoc that referenced this issue May 28, 2016
- false disables layout, enables standalone output
- nil disables layout, does not enable standalone output
- not specified or empty string uses default (inherited) layout
@mojavelinux
Copy link
Member Author

mojavelinux commented May 28, 2016

I think we leave room to support unsetting the page-layout attribute in the future.

:!page-layout:

We just won't do it yet (due to how this plugin works).

mojavelinux added a commit to mojavelinux/jekyll-asciidoc that referenced this issue May 30, 2016
- false disables layout, enables standalone output
- nil disables layout, does not enable standalone output
- not specified or empty string uses default (inherited) layout
mojavelinux added a commit to mojavelinux/jekyll-asciidoc that referenced this issue May 31, 2016
- false or unset disables layout, enables standalone output
- nil disables layout, does not enable standalone output
- not specified, empty string or _auto uses default (inherited) layout
mojavelinux added a commit to mojavelinux/jekyll-asciidoc that referenced this issue May 31, 2016
- false or unset disables layout, enables standalone output
- nil disables layout, does not enable standalone output
- not specified, empty string or _auto uses default (inherited) layout
mojavelinux added a commit to mojavelinux/jekyll-asciidoc that referenced this issue May 31, 2016
- false or unset disables layout, enables standalone output
- nil disables layout, does not enable standalone output
- not specified, empty string or _auto uses default (inherited) layout
mojavelinux added a commit to mojavelinux/jekyll-asciidoc that referenced this issue May 31, 2016
- false or unset disables layout, enables standalone output
- nil disables layout, does not enable standalone output
- not specified, empty string or _auto uses default (inherited) layout
@mojavelinux
Copy link
Member Author

I decided to implement the following rules:

  • :page-layout: page — use the layout named page (e.g., page.html)
  • not specified, :page-layout: or :page-layout: _auto — use the default layout (i.e., default for pages, post for posts)
  • :!page-layout: or :page-layout: false — don’t use a layout; instead, generate a standalone HTML document
  • :page-layout: ~ — don’t use a layout (often results in an incomplete HTML file)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant