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

_includes/head.html does not include header #16

Open
yerenutku opened this issue Dec 28, 2024 · 1 comment
Open

_includes/head.html does not include header #16

yerenutku opened this issue Dec 28, 2024 · 1 comment

Comments

@yerenutku
Copy link

Adding _includes/head.html file does not add anything to the header.
I also modified index.md

---
layout: home
---
<head>{% include head.html %}</head>

Still no luck. It is said in the documentation, that themes out of the box provide this functionality. Is there something going wrong that I can't see?

@yerenutku yerenutku changed the title _includes/head.html does not includes header _includes/head.html does not include header Dec 28, 2024
@piazzai
Copy link
Owner

piazzai commented Dec 29, 2024

Hi! I would need to look at the content of your _includes/head.html file to see exactly what you are trying to do, but here are a few thoughts.

First, you mention you're trying to add a header, but what you seem to be trying to add is an html head. And you are adding it to the content of index.md, but in doing so you're placing it inside the html body. This will not work.

Second, the theme already includes an html head (correctly placed outside the body). You can see it in the _layouts/default.html file, which specifies the base layout of every webpage. Take a look:

https://github.com/piazzai/hacked-jekyll/blob/master/_layouts/default.html

The homepage replaces {{ content }} on line 25 with the code included in _layouts/home.html. This code reads the information provided as part of the _data/json.yml file to render the json block. It ignores the content of index.md. The only thing it reads from index.md is the front matter. This is why anything you add there will never show up.

If you show me the content of your _includes/head.html file, I'll be able to tell you how to best achieve what you're trying to achieve.

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

No branches or pull requests

2 participants