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

Add baseof.html layout to docs #31608

Merged
merged 3 commits into from
Nov 17, 2020
Merged

Add baseof.html layout to docs #31608

merged 3 commits into from
Nov 17, 2020

Conversation

NotWoods
Copy link
Contributor

@NotWoods NotWoods commented Sep 6, 2020

For #28479

Adds a base layout used by most other layouts. Also adds a base "redirect" layout to avoid some duplication.


Biggest sticking point here is body_override.

Seems like hugo doesn't like having an attribute defined like this:

<body {{ block "body_attribute" . }}{{ end }}>

Since this is used just for the class attribute, you could add a class override like this:

<body class="{{ block "body_class" . }}{{ end }}">

But then you have <body class=""> on most pages. The issue indicates that you may want to add a body class for most pages anyways, so if this is a preferable approach let me know.

Preview: https://deploy-preview-31608--twbs-bootstrap.netlify.app/

TODO:

  • Test release-zip-examples just in case

@XhmikosR
Copy link
Member

@NotWoods Thanks for the PR. Can you rebase this please?

@regisphilibert could you also have a quick look please?

@XhmikosR
Copy link
Member

But then you have <body class=""> on most pages. The issue indicates that you may want to add a body class for most pages anyways, so if this is a preferable approach let me know.

Indeed, I'd like to always have a body class, but maybe we should tackle that later. My idea was to has a body class automatically generated based on the layout used and page's file path (with slashes and the extension removed).

I think your patch is a good start and can land as is for now :)

@XhmikosR
Copy link
Member

BTW it seems the example.html is left out.

@NotWoods
Copy link
Contributor Author

I changed it around to use a block for the class, and that can be expanded upon later to generate a class name from the page path. example.html is intentionally left out because the layout is unique and doesn't share much with the other pages.

@XhmikosR
Copy link
Member

I changed it around to use a block for the class, and that can be expanded upon later to generate a class name from the page path. example.html is intentionally left out because the layout is unique and doesn't share much with the other pages.

I'll revert the change since it doesn't make sense to have this unless it's ready.

About examples, I still think we could reuse some of the partials, but I'll leave this to explore later. Like scripts.html and try to generate the placeholder inline CSS from Sass instead of manually hardcoding its output.

@XhmikosR
Copy link
Member

I'll do a little more testing later and merge this. Thanks for your contribution(s)!

@XhmikosR XhmikosR merged commit 4c9597e into twbs:main Nov 17, 2020
@XhmikosR
Copy link
Member

@NotWoods can you apply this against my v4-dev-xmr-hugo branch too please? The only difference is the meta viewport tag and the fact that we don't include footer.html in the docs layout.

@NotWoods NotWoods mentioned this pull request Nov 18, 2020
@NotWoods
Copy link
Contributor Author

#32192

@NotWoods NotWoods deleted the baseof branch November 18, 2020 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants