Meng-Shuan Tsai created HDDS-16234:
--------------------------------------

             Summary: Favicon missing on all non-root pages (docs, blog, 
roadmap, etc.)
                 Key: HDDS-16234
                 URL: https://issues.apache.org/jira/browse/HDDS-16234
             Project: Apache Ozone
          Issue Type: Bug
          Components: website
            Reporter: Meng-Shuan Tsai
            Assignee: Meng-Shuan Tsai


On [https://ozone.apache.org/], the browser tab shows the Ozone favicon 
correctly. On any other page the favicon does not appear on a normal page load.

Steps to reproduce:
 # Open [https://ozone.apache.org/] the Ozone favicon shows in the tab.
 # Open 
[https://ozone.apache.org/docs/core-concepts/architecture/ozone-manager/] (or 
[https://ozone.apache.org/blog/], [https://ozone.apache.org/roadmap/]) directly 
as a fresh page load, the favicon is missing.

Root cause: in 
[{{docusaurus.config.js}}|https://github.com/apache/ozone-site/blob/master/docusaurus.config.js]
 ({{{}headTags{}}}, introduced in 
[#95|https://github.com/apache/ozone-site/pull/95]), the favicon {{<link>}} 
tags use relative {{href}} values with no leading {{{}/{}}}:
{code:java}
{ tagName: 'link', attributes: { rel: 'icon', href: 'favicon.ico', sizes: 
'32x32' } },

{ tagName: 'link', attributes: { rel: 'icon', href: 'favicon.svg', type: 
'image/svg+xml' } },

{ tagName: 'link', attributes: { rel: 'apple-touch-icon', href: 
'apple-touch-icon.png' } }, {code}
Since there's no {{<base>}} tag, the browser resolves these relative to the 
current page URL, not the site root. This only happens to work on {{/}} 
(resolves to {{{}/favicon.ico{}}}, 200). On any other page it resolves to a 
nested, non-existent path (e.g. {{{}/blog/favicon.ico{}}}, 404), so the icon 
fails to load. Adding a leading {{/}} to all three {{href}} values fixes it, 
since they would then always resolve to the site root regardless of page depth.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to