Skip to content

Commit cafe3a1

Browse files
jupiter deployment fixes due to canonical url
1 parent 8b5f66a commit cafe3a1

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ sphinx:
113113
html_theme: prem_theme
114114
html_theme_options:
115115
# (NEW) Provide your base URL here, so you can reference it in page.html as {{ theme_options.baseurl }}
116-
baseurl: https://book.premai.io/state-of-open-source-ai
116+
book_baseurl: https://book.premai.io/state-of-open-source-ai
117117
navigation_with_keys: false
118118
use_download_button: false
119119

_templates/page.html

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
{% extends "!page.html" %}
22

33
{% block meta %}
4-
<link rel="canonical" href="{{ theme_options.baseurl }}/{{ pagename }}/">
5-
<script>location="{{ theme_options.baseurl }}/{{ pagename }}/"</script>
6-
<meta http-equiv="refresh" content="0; url={{ theme_options.baseurl }}/{{ pagename }}/">
4+
<!-- Add a canonical link and redirect logic in the head section -->
5+
<link rel="canonical" href="{{ theme_options.book_baseurl }}/{{ pagename }}/">
6+
<script>location="{{ theme_options.book_baseurl }}/{{ pagename }}/"</script>
7+
<meta http-equiv="refresh" content="0; url={{ theme_options.book_baseurl }}/{{ pagename }}/">
78
<meta name="robots" content="noindex">
89

9-
{{ super() }}
10+
{{ super() }} {# Keep any other meta tags from the theme #}
1011
{% endblock meta %}
1112

1213
{% block main %}
14+
<!-- A visible message for users who aren't automatically redirected -->
1315
<h1>Redirecting…</h1>
14-
<p><a href="{{ theme_options.baseurl }}/{{ pagename }}/">Click here if you are not redirected.</a></p>
15-
{{ super() }}
16+
<p>
17+
<a href="{{ theme_options.book_baseurl }}/{{ pagename }}/">
18+
Click here if you are not redirected.
19+
</a>
20+
</p>
21+
22+
{{ super() }} {# Keep the rest of the theme’s body content #}
1623
{% endblock main %}

0 commit comments

Comments
 (0)