Skip to content

Commit

Permalink
docs: Set relativeURL for Netlify. (#1612)
Browse files Browse the repository at this point in the history
Since we are in process of moving to Netlify, we need this change for docs to work.

This change has no effect on current badger docs
  • Loading branch information
mbj36 authored Dec 7, 2020
1 parent f492aa3 commit eaf91a1
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
4 changes: 3 additions & 1 deletion docs/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
languageCode = "en-us"
theme = "hugo-docs"
canonifyURLs = true
canonifyURLs = false

relativeURLs = true

[markup.goldmark.renderer]
unsafe = true
Expand Down
18 changes: 9 additions & 9 deletions docs/themes/hugo-docs/layouts/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<head>
<meta charset="utf-8"> {{ partial "meta.html" . }}
<title>{{ .Title }}</title>
<link href="{{ .Site.BaseURL }}/css/nucleus.css" rel="stylesheet">
<link href="{{ .Site.BaseURL }}/css/font-awesome.min.css" rel="stylesheet">
<link href="{{ .Site.BaseURL }}/css/hybrid.css" rel="stylesheet">
<link href="{{ .Site.BaseURL }}/css/featherlight.min.css" rel="stylesheet">
<link href="{{ .Site.BaseURL }}/css/perfect-scrollbar.min.css" rel="stylesheet">
<link href="{{ .Site.BaseURL }}/css/theme.css" rel="stylesheet">
<link href="{{ .Site.BaseURL }}/css/hugo-theme.css" rel="stylesheet">
<link href='{{ relURL "/css/nucleus.css"}}' rel="stylesheet">
<link href='{{ relURL "/css/font-awesome.min.css"}}' rel="stylesheet">
<link href='{{ relURL "/css/hybrid.css"}}' rel="stylesheet">
<link href='{{ relURL "/css/featherlight.min.css"}}' rel="stylesheet">
<link href='{{ relURL "/css/perfect-scrollbar.min.css"}}' rel="stylesheet">
<link href='{{ relURL "/css/theme.css"}}' rel="stylesheet">
<link href='{{ relURL "/css/hugo-theme.css"}}' rel="stylesheet">
<style type="text/css">
:root #header + #content > #left > #rlblock_left {
display: none !important;
Expand Down Expand Up @@ -41,8 +41,8 @@ <h1>Error </h1>
</p>
<p>Woops. Looks like this page doesn't exist.</p>
<p></p>
<p><a href="{{.Site.BaseURL}}">Go to homepage</a></p>
<p><img src="{{ .Site.BaseURL }}/images/gopher-404.jpg" style="width:50%"></img></p>
<p><a href='{{relURL "/"}}'>Go to homepage</a></p>
<p><img src='{{ relURL "/images/gopher-404.jpg"}}' style="width:50%"></img></p>
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions docs/themes/hugo-docs/layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
}
</script>

<script src="{{ .Site.BaseURL }}/js/clipboard.min.js"></script>
<script src='{{ relURL "/js/clipboard.min.js"}}'></script>
<script
src='{{ .Site.BaseURL }}/js/dgraph.js?{{ md5 (readFile "themes/hugo-docs/static/js/dgraph.js") }}'
src='{{ relURL "/js/dgraph.js"}}?{{ md5 (readFile "themes/hugo-docs/static/js/dgraph.js") }}'
></script>
<script>
hljs.initHighlightingOnLoad();
Expand Down
2 changes: 1 addition & 1 deletion docs/themes/hugo-docs/layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</title>

<link
href='{{ .Site.BaseURL }}/css/theme.css?{{ md5 (readFile "themes/hugo-docs/static/css/theme.css") }}'
href='{{ relURL "/css/theme.css"}}?{{ md5 (readFile "themes/hugo-docs/static/css/theme.css") }}'
rel="stylesheet"
/>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
Expand Down
2 changes: 1 addition & 1 deletion docs/themes/hugo-docs/layouts/partials/topbar.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<nav id="header">
<a href="/" class="brand">
<img src="{{ .Site.BaseURL }}/images/badger.png" alt="dgraph" class="logo" />
<img src='{{ relURL "/images/badger.png"}}' alt="dgraph" class="logo" />
</a>

<a href="#" id="sidebar-toggle">
Expand Down
2 changes: 1 addition & 1 deletion docs/themes/hugo-docs/layouts/shortcodes/load-img.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ $url := .Get 0}}
{{ $alt := .Get 1}}

<img src="{{ .Site.BaseURL }}{{ $url }}" alt="{{ $alt }}" />
<img src="{{ relURL $url }}" alt="{{ $alt }}" />

0 comments on commit eaf91a1

Please sign in to comment.