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

Metadata: Site Title and Description is used for each page. #50

Closed
infominer33 opened this issue Jun 25, 2019 · 4 comments
Closed

Metadata: Site Title and Description is used for each page. #50

infominer33 opened this issue Jun 25, 2019 · 4 comments
Assignees
Labels
bug report Something isn't working

Comments

@infominer33
Copy link
Contributor

Describe the bug

I"m just now reading over the contributors guidelines, and considered that I should have started there.. (and am new to github... but learning quick enough I hope :)

I already made a pull request for this

As it stands Metadata for each page is chosen with this code:

<title>{{ .Site.Title }}</title>
    <meta name="description" content="{{ .Site.Params.Description }}">

the result is that each page uses the Site Title and Description when shared on social media.

To Reproduce

for example, viewing the source of https://angelostavrow.com/post/mbb-season-1-retro/

<title>Angelo Stavrow</title>

Expected behavior

Seen here: https://web-work.tools/indieweb/indigo-indieweb-features/

   <title>Indigo - A Hugo Indiweb Theme - Features</title>
    <meta name="description" content="Indigo is a A Hugo theme, designed with indieweb in mind.">

The Solution

    <title>{{ .Title }}</title>
    <meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }}">

This uses page title .Title and check for a description, otherwise using site description

@AngeloStavrow
Copy link
Owner

Good call, this is definitely something I'd categorize as a bug.

In the page's <title> tag, I feel like I'd expect something more like:

Site Name - Title Of Page/Post

What do you think about that, @infominer33?

@infominer33
Copy link
Contributor Author

yeah, if you have some more "proper" or even just different solution, I'm all for going with your inclination and swapping out my patch. :D

I commonly share on Twitter, Discord, Keybase, etc.... and was just happy to have each pages title and description reproduced. I think each of these social sites displays the domain along w generated meta-data.. which may be why I didn't worry about the site-title not getting propagated for each page in my patch...

I didn't think too much about it, in any case.

@AngeloStavrow
Copy link
Owner

For sharing, you're right that your issue #44 will help to dispel any confusion. But another use case to consider is that the <title> tag in an HTML page's <body> is displayed in the browser, too. 🙂

A good question to you: what order makes more sense?

Site Name - Title of Page/Post

or

Title of Page/Post - Site Name

?

@infominer33
Copy link
Contributor Author

I tried <title>{{ .Title }} | {{ .Site.Title }}</title> in the pull-request... simply because that's how it's displayed on my other sites, and a random sampling of my browser tabs similarly finds the site title displayed on the right side, after the page title mostly... but i don't think it's a rule either way.

I'll defer to your preferences... I haven't gotten those changes live yet to see how it looks. Think I need to get finished w my morning and come back to this later, tho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants