Skip to content

Commit

Permalink
Performance fix on the sidebar (cockroachdb#16213)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickvigilante authored Feb 8, 2023
1 parent d50cdf9 commit d5168e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions _includes/corestyle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
@import "utils/backgrounds";
@import "utils/type";

$images-url: "{{site.url}}/docs/images/";
$images-url: "{% if site.url == "https://www.cockroachlabs.com" %}{{site.url}}{% endif %}/docs/images/";

html {
height: 100%;
Expand Down Expand Up @@ -838,7 +838,7 @@ a.accordion-toggle {
color: $neutral-800;
}

@import "{{site.url}}/docs/css/theme-blue.css";
@import "{% if site.url == "https://www.cockroachlabs.com" %}{{site.url}}{% endif %}/docs/css/theme-blue.css";

a.btn-primary {
&:hover {
Expand Down
4 changes: 2 additions & 2 deletions _includes/sidebar.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@
// This condition makes it possible to use external
// urls in the sidebar.
if (!/^https?:/.test(url)) {
url = '{{ site.url }}' + sidebar.baseUrl + url;
url = {% if site.url == "https://www.cockroachlabs.com" %}'{{ site.url }}' + {% endif %}sidebar.baseUrl + url;
}
return url;
});

// this ensures page will be highlighted in sidebar even if URL is accessed without `.html` appended
var activePathname
if (!/^https?:/.test(location.pathname)) {
activePathname = '{{ site.url }}' + location.pathname
activePathname = {% if site.url == "https://www.cockroachlabs.com" %}'{{ site.url }}' + {% endif %}location.pathname
}
else {
activePathname = location.pathname
Expand Down

0 comments on commit d5168e0

Please sign in to comment.