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

Double <head> tag and title mistake #30

Open
teo330 opened this issue Feb 16, 2020 · 2 comments
Open

Double <head> tag and title mistake #30

teo330 opened this issue Feb 16, 2020 · 2 comments

Comments

@teo330
Copy link

teo330 commented Feb 16, 2020

Looking at the source code of the generated site I found there're two head sections.

I solved the problem by deleting

<head>
    <title>{{ site.author }}</title>
</head>

from the about.html, home.html and post.html files in the _layouts directory.
The right code should be written in /_includes/head.html

NOTE: I'm new to both GitHub and Jekyll and I didn't studied the Jekyll templating structure yet, however I noticed the shortcode {{ site.author }} actually shows the page title when in the wrong position (when there's the double head tag), but the same snippet (<title>{{ site.author }}</title>) in the right position (so when it's in the head.html file) shows the author name.
That's strange because there's not another title tag that overwrites it.
Ideas?

By the way I solved by changing the snippet from the one before to this one: <title>{{ page.title }}</title> (I tried site.title but then I realized I wouldn't print the page title:sweat_smile:)

P.S: I'm sorry if I mistaken or missed anything (in case please let me know) but, as said, I'm new to GitHub and I've no experience with (that's even the reason I don't try to pull the solution):innocent:
P.P.S: Thanks for this theme. It's pretty simple but amazing, for sure for a beginner who wants to learn and customize it:pray:

@huangyz0918
Copy link
Owner

Hi @teo330, nice to meet you in Github! Glad you have noticed the issue in this project. I found a reference that would be helpful for your question,

Technically HTML documents are not allowed to have multiple sections, but sites which aggregate content from multiple sources sometimes have them. This filter moves the content from later sections into the first head.

About this

P.S: I'm sorry if I mistaken or missed anything (in case please let me know) but, as said, I'm new to GitHub and I've no experience with (that's even the reason I don't try to pull the solution)😇

I think you are totally welcome to send a Pull Request, even is it is a stupid one : )
For open source communities, the member would be really happy to see some feedback and active contributors, and most of them are kind and will give you suggestions that can really help you. Don't be shy and just run.

@note4
Copy link

note4 commented Jan 14, 2021

多好的一个主题,因为这个问题,处女座放弃了它

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

3 participants