X Tutup
The Wayback Machine - https://web.archive.org/web/20221229222547/https://github.com/git/git.github.io/pull/497
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

Fix icon path #497

Merged
merged 8 commits into from May 2, 2021
Merged

Fix icon path #497

merged 8 commits into from May 2, 2021

Conversation

serzhan-nasredin
Copy link
Contributor

@serzhan-nasredin serzhan-nasredin commented Apr 17, 2021

Fix #496

Not sure. Check this, please.

@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{{ page.title }}</title>
<meta name="viewport" content="width=device-width">
<link rel="icon" type="image/x-icon" href="../images/logo.png"/>
<link rel="icon" type="image/x-icon" href="images/logo.png"/>
Copy link
Collaborator

@chriscool chriscool Apr 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that @sivaraam suggested either /images/logo.png or just adding a link to it or a copy of it named favicon.ico. But this is doing something else. Is there a reason why you think Kaartic's suggestions will not work, or what you are doing is better?

Copy link
Contributor Author

@serzhan-nasredin serzhan-nasredin Apr 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm not mistaken, this is how it works:

_layouts
    L default.html
images
    L logo.png

And what I did then - it worked correctly, but I don't know why: rev_news / rev_news.md do not work.
But here's what confused me:
#496 (comment)

Copy link
Member

@sivaraam sivaraam Apr 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand, paths in the layout are referenced relatively from the path where the layout is used. So, your relative reference worked properly for the index and about pages but not for Rev News pages.

That's why I suggested using an absolute path instead.

Copy link
Member

@sivaraam sivaraam left a comment

The favicon.ico file should be placed only at the ROOT of the repository. No need to add it to sub-folders. That way the favicon is automatically served to the browser upon request.

On some research though, it looks like using the link tag is the standardized way to serve website icons [ref]. See suggestion about how to do that below.

@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{{ page.title }}</title>
<meta name="viewport" content="width=device-width">
<link rel="icon" type="image/x-icon" href="../images/logo.png"/>
<link rel="icon" type="image/x-icon" href="images/icons/favicon.ico"/>
Copy link
Member

@sivaraam sivaraam Apr 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're going the favicon.icon route, you could just remove the whole link tag altogether. It isn't necessary.

Copy link
Member

@sivaraam sivaraam Apr 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, we could fix this link tag to make it work with the logo by using an absolute link as follows:

Suggested change
<link rel="icon" type="image/x-icon" href="images/icons/favicon.ico"/>
<link rel="icon" type="image/x-icon" href="/images/logo.png"/>

@serzhan-nasredin
Copy link
Contributor Author

serzhan-nasredin commented Apr 30, 2021

Hello. Sorry for the lack of feedback.
@sivaraam, check it out.

Copy link
Member

@sivaraam sivaraam left a comment

Hello. Sorry for the lack of feedback.

No worries! 🙂

@sivaraam, check it out.

This looks good to me. Thanks for the fix @snxx-lppxx !

@sivaraam sivaraam merged commit 4a7b445 into git:master May 2, 2021
@serzhan-nasredin serzhan-nasredin deleted the patch-2 branch May 2, 2021
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.

Favicon: missing
3 participants
X Tutup