-
Notifications
You must be signed in to change notification settings - Fork 156
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 resources so they honor .Site.BaseURL #95
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Gregory L. Dietsche <gregory.dietsche@cuw.edu>
@@ -21,7 +21,7 @@ | |||
{{ end }} | |||
{{ end }} | |||
{{ $srcset := delimit ($.Scratch.Get "srcset") "," }} | |||
<a {{ printf "href=%q" ("/" | relLangURL) | safeHTMLAttr }}><img class="avatar" src="/{{ .Site.Params.avatar }}" {{ printf "srcset=%q" $srcset | safeHTMLAttr }}></a> | |||
<a {{ printf "href=%q" ("/" | relLangURL) | safeHTMLAttr }}><img class="avatar" src="{{ .Site.BaseURL }}{{ .Site.Params.avatar }}" {{ printf "srcset=%q" $srcset | safeHTMLAttr }}></a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't .Site.BaseURL
also be needed as the target of the avatar link (the round image at the top of the page), as well as when clicking on the name right below it? Perhaps Hugo already writes the links correctly, never placed a site in a subdirectory.
waiting for merged 👍 |
Do you have plans to merge it @nishanths ? |
@@ -46,7 +46,7 @@ | |||
{{ if .Site.Params.faviconfile }} | |||
href="/{{ .Site.Params.faviconfile }}" | |||
{{ else }} | |||
href="/img/favicon.ico" | |||
href="{{ .Site.BaseURL }}img/favicon.ico" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if you noticed but there is an extra white space after BaseURL
. 😅
Thanks for your PR, it helped me to solve a problem.
While trying out the theme from a relative location, I found problems.
For example if baseurl is set to "http://mysite/hugo/" then the image and css links
were wrong in the past because of the "hugo" sub directory.
Signed-off-by: Gregory L. Dietsche gregory.dietsche@cuw.edu