-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
HTML head customisation with head.hbs
#1206
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also update the documentation in the theme docs for this and header.hbs
?
@@ -75,6 +75,7 @@ impl HelperDef for RenderToc { | |||
("", 1) | |||
}; | |||
|
|||
#[warn(clippy::if_same_then_else)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why this is added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see. I just pushed a change to rewrite it: #1214. I usually prefer unrelated changes like this to be separate.
src/theme/index.hbs
Outdated
} | ||
html.classList.remove('sidebar-visible'); | ||
html.classList.add("sidebar-" + sidebar); | ||
</script> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to avoid unrelated formatting changes. Can you remove all the whitespace changes and formatting changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code auto-formatting has been reverted.
@Dylan-DPC does this seem like a reasonable idea to you? I suspect there might be some longer term issues with making it easier to extend the templates (#353 ?), but this seems like a simple, incremental improvement. |
i don't see any issue with this |
Documentation added. Comments answered. Thanks for your reviews. |
Create a `index.hbs` template file to render additional HTML <head> attributes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
The documentation might be confusing. It says:
I think it should say "under" or "inside" the src folder because that's what worked for me. Not having |
HTML head customisation with `head.hbs`
Allow to define custom attributes within the HTML tag thanks to a
head.hbs
template file.A typical use case is the addition of mobile capabilities for PWA deployment for example to render the doc in fullscreen once added to the home screen (Android or iOS):