Skip to content

Commit

Permalink
Refactored algolia logo embed to fix issues with languages and/or oth…
Browse files Browse the repository at this point in the history
…er baseURLs. Fixes #232.
  • Loading branch information
Lednerb committed Aug 3, 2020
1 parent 5333bbb commit ab4cd2c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion assets/js/theme.js
Expand Up @@ -74,7 +74,7 @@ $(document).ready(function () {
return "<span class='empty'>" + $('#algolia-search-noSearchResults').val() + "</span>"
},
footer: function () {
return '<div class="branding">Powered by <img src="' + $('#siteBaseUrl').attr('href') + '/algolia-logo-light.svg" /></div>'
return '<div class="branding">Powered by <img src="' + $('meta[name=siteBaseUrl]').attr("content") + '/algolia-logo-light.svg" /></div>'
}
},
}
Expand Down
7 changes: 4 additions & 3 deletions layouts/_default/baseof.html
Expand Up @@ -51,6 +51,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="siteBaseUrl" content="{{ .Site.BaseURL }}">
<meta name="author" content="{{ .Site.Params.author }}">
<meta name="description" content="{{ .Site.Params.description }}">
<meta name="keywords" content="{{ .Site.Params.keywords }}">
Expand Down Expand Up @@ -94,9 +95,9 @@
{{ partial "twitter-card.html" . }}

{{ if isset .Site.Params "css_modules" }}
{{ range .Site.Params.css_modules }}
<link rel="stylesheet" href="{{ . | absURL }}">
{{ end }}
{{ range .Site.Params.css_modules }}
<link rel="stylesheet" href="{{ . | absURL }}">
{{ end }}
{{ end }}
</head>

Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/header.html
Expand Up @@ -5,7 +5,7 @@
{{ end }}
<div class="container">
<div class="logo">
<a id="siteBaseUrl" href="{{ .Site.BaseURL | relLangURL }}" class="logo">
<a href="{{ .Site.BaseURL | relLangURL }}" class="logo">
{{ if and (isset .Site.Params "customimage") (ne .Site.Params.customImage "") }}
<img src="{{ .Site.Params.customImage | relURL }}" alt="">
{{ else }}
Expand Down
2 changes: 1 addition & 1 deletion static/theme.js

Large diffs are not rendered by default.

0 comments on commit ab4cd2c

Please sign in to comment.