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 head-custom.html for custom head tags. #30

Merged
merged 2 commits into from
Jul 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions _includes/head-custom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- start custom head snippets -->

<!-- Setup theme-color. -->
{% include head-custom-theme-colors.html %}

<!-- You can set your favicon here. -->
<!-- link rel="shortcut icon" type="image/x-icon" href="{{ '/favicon.ico' | relative_url }}" -->

<!-- end custom head snippets -->
4 changes: 1 addition & 3 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
<link rel="stylesheet" href="{{ '/assets/css/ie.css' | relative_url }}">
<![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<!-- Setup theme-color. -->
{% include theme_color_meta_headers.html %}

{% include head-custom.html %}
Copy link
Contributor

Choose a reason for hiding this comment

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

With #31 merged, how would you feel about setting this up this way:

  1. _layouts/default.html has {% include head-custom.html %}
  2. _includes/head-custom.html has {% include theme_color_meta_headers.html %}

That way we can move custom headers into head-custom.html as a single entry point and use this across all the themes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@parkr Great idea! That will also clarify that this is meant to be customized if wanted, and it's certainly a good idea to use this across all themes.
The latest force-push has added changed this accordingly 😄.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PS: If you prefer underscores as separators, of course I can change that for consistency, just let me know.
I took inspiration from:
https://github.com/mmistakes/so-simple-theme/blob/master/_includes/head-custom.html
which uses the "kebab case" style with dash-separators, but snake-case is also fine with me 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

@olifre Let's be consistent, whatever we choose.

Either:

  1. head-custom.html and head-custom-theme-colors.html, OR
  2. custom_headers.html and theme_color_meta_headers.html

I like the kebab-style system since it's kind of a grouping (we use a head-custom prefix, so head-custom-google-analytics.html could be added later for example) and it seems easily readable to 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.

I like the kebab-style system since it's kind of a grouping (we use a head-custom prefix, so head-custom-google-analytics.html could be added later for example) and it seems easily readable to me.

That's a great point, indeed!
I have pushed another commit doing the renaming, so now all is implemented according to the kebab-style variant 👍 .

</head>
<body>
<div id="header">
Expand Down