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

Option to skip top-of page H1 link with site URL #40

Open
epogrebnyak opened this issue Aug 14, 2020 · 8 comments
Open

Option to skip top-of page H1 link with site URL #40

epogrebnyak opened this issue Aug 14, 2020 · 8 comments
Labels

Comments

@epogrebnyak
Copy link

By default the Premier theme adds an H1 link with site URL on top of page. I believe the code below is responsible for this behaviour:

      {% if site.title and site.title != page.title %}
      <h1><a href="{{ "/" | absolute_url }}">{{ site.title }}</a></h1>
      {% endif %}

I would like to find out how can top-of page link can be switched off.

My initial idea is forking a repo and deleting the code above from template. I would like to learn how can add and extra custom variable in _config.yaml to make H1 with URL disappear.

I think the code will look like:

      {% if must_show and (if site.title and site.title != page.title %)}
      <h1><a href="{{ "/" | absolute_url }}">{{ site.title }}</a></h1>
      {% endif %}

My qustion is how can I introduce must_show or similar in _config.yaml

@seshrs
Copy link

seshrs commented Aug 14, 2020

I believe this was discussed in #21.

According to this comment, the initial title heading is removed if you specify the following in _config.yml:

name: Site name that appears as HTML “title”
title: null

@epogrebnyak
Copy link
Author

@seshrs thanks for the info - I think I just created a duplicate.

However - will title: null shut the display of title in <title> tag? I cannot find where it is generated.

@seshrs
Copy link

seshrs commented Aug 16, 2020

However - will title: null shut the display of title in <title> tag? I cannot find where it is generated.

You're right, adding title: null alone makes the <title> tag not render. But if you add a name: My Page Title in _config.yml in addition, the <title> tag renders. (I just tried this on one of my sites, and the <title> tag renders as expected.)

@epogrebnyak
Copy link
Author

epogrebnyak commented Aug 16, 2020 via email

@seshrs
Copy link

seshrs commented Aug 16, 2020

@epogrebnyak like you mentioned, the <title> tag is generated by the jekyll-seo-tag plugin. Here's the code that uses the name if no title is provided in _config.yml: https://github.com/jekyll/jekyll-seo-tag/blob/933b914ab27601ca29615489f0343c4417bb146a/lib/jekyll-seo-tag/drop.rb#L33-L35

@epogrebnyak
Copy link
Author

Maybe make a PR for README.md that has advice about avoiding the top header?

@stale
Copy link

stale bot commented Dec 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Dec 25, 2020
@settings settings bot removed the wontfix label Jul 15, 2021
@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants