Fix relURL for custom_css#252
Merged
regisphilibert merged 1 commit intotheNewDynamic:masterfrom Jun 3, 2020
Merged
Conversation
The way relURL was used meant that one needed to preface the custom_css entries with a slash, or the href would be incorrectly set to subdircss/mycss.css rather than subdir/css/mycss.css, in the case of a baseURL in a subdir.
|
|
||
| {{ range .Site.Params.custom_css }} | ||
| <link rel="stylesheet" href="{{ relURL ($.Site.BaseURL) }}{{ . }}"> | ||
| <link rel="stylesheet" href="{{ relURL (.) }}"> |
Member
There was a problem hiding this comment.
@nickjwhite thank you for this.
Would you mind removing the () while you're at it. I understand they were there initially, but it turns out they're not needed.
<link rel="stylesheet" href="{{ relURL . }}">
This reads a bit picky, but we're getting back at improving the theme and use it to promote Hugo's best practices.
jan-xyz
reviewed
Apr 5, 2020
|
|
||
| {{ range .Site.Params.custom_css }} | ||
| <link rel="stylesheet" href="{{ relURL ($.Site.BaseURL) }}{{ . }}"> | ||
| <link rel="stylesheet" href="{{ relURL (.) }}"> |
There was a problem hiding this comment.
For your convenience:
Suggested change
| <link rel="stylesheet" href="{{ relURL (.) }}"> | |
| <link rel="stylesheet" href="{{ relURL . }}"> |
I hope that makes it easier to fix!
Member
|
@jan-xyz sorry for merging this so late! Thanks! |
Remicck
pushed a commit
to Remicck/gohugo-theme-ananke
that referenced
this pull request
Mar 7, 2022
The way relURL was used meant that one needed to preface the custom_css entries with a slash, or the href would be incorrectly set to subdircss/mycss.css rather than subdir/css/mycss.css, in the case of a baseURL in a subdir. Co-authored-by: Nick White <git@njw.name>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The way relURL was used meant that one needed to preface the custom_css
entries with a slash, or the href would be incorrectly set to
subdircss/mycss.css rather than subdir/css/mycss.css, in the case of
a baseURL in a subdir.