Skip to content

Commit d8b4a7b

Browse files
doc: add Google Analytics settings for MicroCeph
Signed-off-by: Elijah Greenstein <elijah.greenstein@canonical.com>
1 parent c6fa74d commit d8b4a7b

3 files changed

Lines changed: 103 additions & 1 deletion

File tree

doc/.sphinx/_integration/add_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
html_baseurl = "https://documentation.ubuntu.com/microceph/v19.2.0-squid/"
1818
# Override default header styles
1919
html_static_path = globals().get('html_static_path', []) + ["_static"]
20-
html_css_files = globals().get('html_css_files', []) + ['override-header.css']
20+
html_css_files = globals().get('html_css_files', []) + ['override-header.css', 'https://assets.ubuntu.com/v1/d86746ef-cookie_banner.css']
21+
html_js_files = globals().get('html_js_files', []) + ['https://assets.ubuntu.com/v1/287a5e8f-bundle.js']
2122
# Add "integrated" to the list of custom tags
2223
tags.add('integrated')
2324
elif project == "MicroOVN":
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
{# ru-fu: copied from Furo, with modifications as stated below. Modifications are marked 'mod:'. #}
2+
3+
<div class="related-pages">
4+
{# mod: Per-page navigation #}
5+
{% if meta %}
6+
{% if 'sequential_nav' in meta %}
7+
{% set sequential_nav = meta.sequential_nav %}
8+
{% endif %}
9+
{% endif %}
10+
{# mod: Conditional wrappers to control page navigation buttons #}
11+
{% if sequential_nav != "none" -%}
12+
{% if next and (sequential_nav == "next" or sequential_nav == "both") -%}
13+
<a class="next-page" href="{{ next.link }}">
14+
<div class="page-info">
15+
<div class="context">
16+
<span>{{ _("Next") }}</span>
17+
</div>
18+
<div class="title">{{ next.title }}</div>
19+
</div>
20+
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
21+
</a>
22+
{%- endif %}
23+
{% if prev and (sequential_nav == "prev" or sequential_nav == "both") -%}
24+
<a class="prev-page" href="{{ prev.link }}">
25+
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
26+
<div class="page-info">
27+
<div class="context">
28+
<span>{{ _("Previous") }}</span>
29+
</div>
30+
{% if prev.link == pathto(master_doc) %}
31+
<div class="title">{{ _("Home") }}</div>
32+
{% else %}
33+
<div class="title">{{ prev.title }}</div>
34+
{% endif %}
35+
</div>
36+
</a>
37+
{%- endif %}
38+
{%- endif %}
39+
</div>
40+
<div class="bottom-of-page">
41+
<div class="left-details">
42+
{%- if show_copyright %}
43+
<div class="copyright">
44+
{%- if hasdoc('copyright') %}
45+
{% trans path=pathto('copyright'), copyright=copyright|e -%}
46+
<a href="{{ path }}">Copyright</a> &#169; {{ copyright }}
47+
{%- endtrans %}
48+
{%- else %}
49+
{% trans copyright=copyright|e -%}
50+
Copyright &#169; {{ copyright }}
51+
{%- endtrans %}
52+
{%- endif %}
53+
</div>
54+
{%- endif %}
55+
56+
{# mod: removed "Made with" #}
57+
58+
{%- if last_updated -%}
59+
<div class="last-updated">
60+
{% trans last_updated=last_updated|e -%}
61+
Last updated on {{ last_updated }}
62+
{%- endtrans -%}
63+
</div>
64+
{%- endif %}
65+
66+
{%- if show_source and has_source and sourcename %}
67+
<div class="show-source">
68+
<a class="muted-link" href="{{ pathto('_sources/' + sourcename, true)|e }}"
69+
rel="nofollow">Show source</a>
70+
</div>
71+
{%- endif %}
72+
</div>
73+
<div class="right-details">
74+
75+
{# mod: replaced RTD icons with our links #}
76+
77+
{% if discourse %}
78+
<div class="ask-discourse">
79+
<a class="muted-link" href="{{ discourse }}">Ask a question on Discourse</a>
80+
</div>
81+
{% endif %}
82+
83+
{% if github_url and github_version and github_folder %}
84+
85+
{% if github_issues %}
86+
<div class="issue-github">
87+
<a class="muted-link" href="{{ github_url }}/issues/new?title=doc%3A+ADD+A+TITLE&body=DESCRIBE+THE+ISSUE%0A%0A---%0ADocument: {{ pagename }}{{ page_source_suffix }}">Open a GitHub issue for this page</a>
88+
</div>
89+
{% endif %}
90+
91+
<div class="edit-github">
92+
<a class="muted-link" href="{{ github_url }}/edit/{{ github_version }}{{ github_folder }}{{ pagename }}{{ page_source_suffix }}">Edit this page on GitHub</a>
93+
</div>
94+
{% endif %}
95+
96+
<a href="" class="js-revoke-cookie-manager muted-link">Manage your tracker settings</a>
97+
98+
</div>
99+
</div>
100+
</div>

doc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ integrate:
108108
cp .sphinx/_integration/microceph.html integration/microceph/docs/.sphinx/_templates/header.html
109109
cp _templates/google-tag.html integration/microceph/docs/.sphinx/_templates/
110110
cp .sphinx/_integration/override-header.css integration/microceph/docs/.sphinx/_static/
111+
cp .sphinx/_integration/microceph_footer.html integration/microceph/docs/.sphinx/_templates/footer.html
111112

112113
cp .sphinx/_integration/microovn.html integration/microovn/docs/.sphinx/_templates/header.html
113114
cp _templates/google-tag.html integration/microovn/docs/.sphinx/_templates/

0 commit comments

Comments
 (0)