minicomp / ed

A Jekyll theme for minimal editions :book:
https://minicomp.github.io/ed/
Other
247 stars 129 forks source link

Do not depent on front page title #20

Closed sergeyklay closed 5 years ago

karlstolley commented 5 years ago

@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.

sergeyklay commented 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?

karlstolley commented 5 years ago

@sergeyklay yes

sergeyklay commented 5 years ago

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?

karlstolley commented 5 years ago

@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

sergeyklay commented 5 years ago

Thus, current logic is:

If you want to use site.title as a title for a particular page, just assign to page.title value Home.

I'm correct?