primer
primer copied to clipboard
Option to skip top-of page H1 link with site URL
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
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
@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.
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.)
Do you know which part of the layout is responsible for this in the repo? Сould not code responsible for
@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
Maybe make a PR for README.md that has advice about avoiding the top header?
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.
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.