I have a problem making a partial work, because of differences between the value of .Site.BaseURL
for my test and my production instance.
In production, the root of my site is https://developers.<blah>.com
.
In test, the root is http://preview.<foo>.<bar>.com/<snafu>/<branchname>
(Our test deployment system can make a separate instance of the site for each git branch I put into GitHub).
One of my partials uses this markup: {{ .Site.BaseURL }/}<filename>_reference.html
to link to a static HTML file.
When the deployment system builds production, .Site.BaseURL
turns into https://developers.<blah>.com
, so the markup is rendered as https://developers.<blah>.com/<filename>_reference.html
, which works.
When the deployment system builds to test, .Site.BaseURL
turns into http://preview.<foo>.<bar>.com/<snafu>/<branchname>//<filename>_reference.html
(note the two slashes between
<branchname>
and <filename>
, which doesn’t work.
Am I doing something wrong? Is there a way to have one version of the partial that works for test and for production?