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

Forum onebox (asides) do not display favicon because of invalid relative link #23

Open
DanRathbun opened this issue May 9, 2021 · 0 comments

Comments

@DanRathbun
Copy link
Contributor

DanRathbun commented May 9, 2021

Firstly, the "favicon.ico" file is located at: "https://ruby.sketchup.com/favicon.ico".

In template file:
/master/lib/yard-sketchup/templates/default/layout/html/headers.erb
... the shortcut icon ERB HTML is:

    <link rel="shortcut icon" type="image/vnd.microsoft.icon"
    href="<%= url_for('favicon.ico') %>" />

This results in a relative url:

<link rel="shortcut icon" type="image/vnd.microsoft.icon" href="../favicon.ico">

... which works for the API doc page's browser tab, but not when a link to that page is inserted into the forum.

The link in the forum's onebox (aka Discourse aside,) comes out as:
"https://ruby.sketchup.com/Sketchup/InstanceObserver.html/../favicon.ico"
so the favicon cannot be found and so does not render to the left of the site name.
(Interestingly if you insert another "../" in front of the filename, then it's a valid URL.)

The simplest solution is to remove the YARD method call to url_for() and just set an absolute favicon path.

@DanRathbun DanRathbun changed the title Ruby API forum oneboxes (asides) are broken because of a relative link Forum onebox (asides) do not display favicon because of invalid relative link May 9, 2021
DanRathbun added a commit to DanRathbun/sketchup-yard-template that referenced this issue May 9, 2021
Fix invalid relative links to favicon in forum oneboxes.
Ref: Issue SketchUp#23
thomthom pushed a commit that referenced this issue Oct 20, 2021
* Update favicon.ico to same as other SketchUp sites

Update favicon.ico to same as other SketchUp sites.
Ref Issue #21

* Delete Favicon.ico

* Update favicon.ico to same as other SketchUp sites

Update favicon.ico to same as other SketchUp sites.
Ref Issue #21

* Edit Ruby.svg change red to Trimble blue.

Changed all references of Ruby color #e62b3e to Trimble blue #005F9E.
Ref Issue #22

* Fix invalid relative links to favicon in forum

Fix invalid relative links to favicon in forum oneboxes.
Ref: Issue #23
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

No branches or pull requests

1 participant