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

Do not depent on front page title #20

Closed
wants to merge 1 commit into from
Closed

Do not depent on front page title #20

wants to merge 1 commit into from

Conversation

sergeyklay
Copy link

No description provided.

@karlstolley
Copy link
Member

@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
Copy link
Author

@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
Copy link
Member

@sergeyklay yes

@sergeyklay
Copy link
Author

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
Copy link
Member

karlstolley commented Nov 19, 2019

@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
Copy link
Author

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?

@sergeyklay sergeyklay closed this Nov 21, 2019
@sergeyklay sergeyklay deleted the patch-1 branch November 21, 2019 10:10
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

Successfully merging this pull request may close these issues.

2 participants