Closed sergeyklay closed 5 years ago
@karlstolley If I understand correctly for http://example.com page.url
will be /
and for http://example.com/my-post-here page.url
will be /my-post-here
, isn't?
@sergeyklay yes
Current patch allows not rely on page title and provide an ability use any other title for front page. And I do not quite understand your comment:
Under your
if
statement,site.title
is always going to be displayed in the<title>
tag at/
(or the baseurl).
Could you elaborate on that?
@sergeyklay There is not much to elaborate. Your code:
{% if page.url == "/" %}
{% assign page_title = site.title %}
{% else %}
{% assign page_title = page.title %}
{% endif %}
will always assign site.title
in the <title>
tag for whatever is displayed at the base URL (page.url == "/"
). That is not acceptable for users who wish to have a custom page.title
value other than Home
, which is currently what triggers the use of site.title
Thus, current logic is:
If you want to use
site.title
as a title for a particular page, just assign topage.title
valueHome
.
I'm correct?
@sergeyklay Thanks for your PR.
I've reviewed your code but I'm afraid I don't quite see the advantage to your proposed change. Under your
if
statement,site.title
is always going to be displayed in the<title>
tag at/
(or the baseurl).That breaks from how Ed has worked previously, and does not provide users with an option to display a custom page title (other, as it currently stands, than 'Home') without fiddling with the code in the template.