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 ability to insert custom code into the global <head>. #17

Merged
merged 2 commits into from Nov 22, 2016
Merged

Add ability to insert custom code into the global <head>. #17

merged 2 commits into from Nov 22, 2016

Conversation

DeedleFake
Copy link
Contributor

@DeedleFake DeedleFake commented Nov 22, 2016

The change is pretty simple. I wanted to put some custom JavaScript in the <head> of a site I'm building, but I didn't want to have to edit the theme or make a copy of layouts/_default/baseof.html, since later changes to the theme may break it. This change allows code to be insterted into <head> by creating a layouts/partial/head-custom.html.

Copy link
Owner

@alanorth alanorth left a comment

Choose a reason for hiding this comment

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

Brilliant and simple. Minor changes requested.

@@ -23,6 +23,8 @@
{{ if .Site.Params.cookie_consent_info_url }}
{{ partial "cookie-consent.html" . }}
{{ end }}

{{ partial "head-custom.html" . }}
Copy link
Owner

Choose a reason for hiding this comment

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

Spacing here should be like the surrounding text: four spaces, not two tabs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice change! I had the need too but did simply override cookie_consent.html. (It's changed anyway, so it was no problem for me).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Woops. Looks like vim decided to use tabs to indent and I forgot to check. Do you mind if I add a modeline comment to the bottom of the file while I'm at it?

Copy link
Owner

Choose a reason for hiding this comment

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

Let's stick to one logical change for each commit / pull request — you can add modelines to ALL the files in a separate pull request. ;)

Also, in the future it would be better for the GitHub workflow if you committed your changes to a feature branch like custom-head-code or something. Your master should theoretically always match the upstream one (mine).

@@ -23,6 +23,8 @@
{{ if .Site.Params.cookie_consent_info_url }}
{{ partial "cookie-consent.html" . }}
{{ end }}

{{ partial "head-custom.html" . }}
Copy link
Owner

Choose a reason for hiding this comment

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

Let's stick to one logical change for each commit / pull request — you can add modelines to ALL the files in a separate pull request. ;)

Also, in the future it would be better for the GitHub workflow if you committed your changes to a feature branch like custom-head-code or something. Your master should theoretically always match the upstream one (mine).

@alanorth alanorth merged commit b83b168 into alanorth:master Nov 22, 2016
@alanorth alanorth mentioned this pull request Nov 27, 2016
@damnms damnms mentioned this pull request Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants