Skip to content

Commit b2a266e

Browse files
authored
fix: improve markdown rendering for knowledge hub pages (#2841)
* fix: remove duplicate breadcrumbs in MD format * fix: use correct privacy policy link * fix: remove JS dependent blog section from MD format * fix: invalid `ol` markup used in the breadcrumbs
1 parent b1ac452 commit b2a266e

4 files changed

Lines changed: 44 additions & 38 deletions

File tree

templates/blog/newsletter-form.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
products and services.</span>
1313
</label>
1414
<p>By submitting this form, I confirm that I have read and agree to <a
15-
href="/legal/dataprivacy" target="_blank">Canonical's Privacy Policy</a>.</p>
15+
href="/legal/data-privacy" target="_blank">Canonical's Privacy Policy</a>.</p>
1616
</div>
1717

1818
<button type="submit" class="u-no-margin--bottom">Sign up</button>

templates/knowledge/_base_knowledge_markdown.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ <h2>Newsletter signup</h2>
8686
<span class="p-checkbox__label" id="canonicalUpdatesOptIn">I agree to receive information about Canonical's products and services.</span>
8787
</label>
8888
<p>
89-
By submitting this form, I confirm that I have read and agree to <a href="#">Canonical's Privacy Policy</a>.
89+
By submitting this form, I confirm that I have read and agree to <a href="/legal/data-privacy">Canonical's Privacy Policy</a>.
9090
</p>
9191
<button type="submit" class="u-no-margin--bottom js-submit-button">Sign up</button>
9292
</form>
@@ -130,6 +130,7 @@ <h2>Newsletter signup</h2>
130130
{% endcall -%}
131131
{% endif %}
132132

133+
<div data-md-strip>
133134
{{ vf_blog(
134135
title={"text": blog.get('title', 'Latest from our blog')},
135136
padding="deep",
@@ -140,6 +141,7 @@ <h2>Newsletter signup</h2>
140141
"template_id": "template"
141142
})
142143
}}
144+
</div>
143145

144146
<script src="{{ versioned_static('js/in-page-navigation.js') }}" nonce="{{ csp_nonce }}"></script>
145147
<script src="{{ versioned_static('js/modules/latest-news/latest-news.js') }}" nonce="{{ csp_nonce }}"></script>

templates/legal/data-privacy/partner-portal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ context:
99

1010
# Privacy notice - Partner Portal
1111

12-
This privacy notice tells you about the information we collect from you when you access the Canonical Partner Portal. In collecting this information, we are acting as a data controller and, by law, we are required to provide you with information about us, about why and how we use your data, and about the rights you have over your data. For more information, please see our [privacy policy](/legal/dataprivacy).
12+
This privacy notice tells you about the information we collect from you when you access the Canonical Partner Portal. In collecting this information, we are acting as a data controller and, by law, we are required to provide you with information about us, about why and how we use your data, and about the rights you have over your data. For more information, please see our [privacy policy](/legal/data-privacy).
1313

1414
## Who are we ?
1515

templates/partial/_knowledge_breadcrumbs.html

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,45 +17,49 @@
1717
</ol>
1818

1919
<!-- Small screens -->
20-
{% if breadcrumbs | length == 1 %}
21-
{% set breadcrumb = breadcrumbs[0] %}
20+
<div data-md-strip>
21+
{% if breadcrumbs | length == 1 %}
22+
{% set breadcrumb = breadcrumbs[0] %}
2223

23-
<!-- Single row with truncation -->
24-
<ol class="p-inline-list p-knowledge-breadcrumb u-truncate p-text--small-caps u-hide--large u-hide--medium u-margin-bottom-0-5rem">
25-
<li class="p-inline-list__item p-knowledge-breadcrumbs__item">
26-
<a href="/knowledge">Knowledge Hub</a>
27-
</li>
28-
<li class="p-inline-list__item p-knowledge-breadcrumbs__item">
29-
{% if breadcrumb.href %}<a href="{{ breadcrumb.href }}">{{ breadcrumb.name }}</a>
30-
{% else %}
31-
{{ breadcrumb.name }}
32-
{% endif %}
33-
</li>
34-
</ol>
24+
<!-- Single row with truncation -->
25+
<ol class="p-inline-list p-knowledge-breadcrumb u-truncate p-text--small-caps u-hide--large u-hide--medium u-margin-bottom-0-5rem">
26+
<li class="p-inline-list__item p-knowledge-breadcrumbs__item">
27+
<a href="/knowledge">Knowledge Hub</a>
28+
</li>
29+
<li class="p-inline-list__item p-knowledge-breadcrumbs__item">
30+
{% if breadcrumb.href %}<a href="{{ breadcrumb.href }}">{{ breadcrumb.name }}</a>
31+
{% else %}
32+
{{ breadcrumb.name }}
33+
{% endif %}
34+
</li>
35+
</ol>
3536

36-
{% else %}
37+
{% else %}
3738

38-
<!-- Two rows -->
39-
<ol class="p-inline-list p-knowledge-breadcrumbs p-text--small-caps u-hide--large u-hide--medium">
40-
<li class="p-knowledge-breadcrumbs">
41-
<ol class="p-inline-list">
42-
<li class="p-inline-list__item p-knowledge-breadcrumbs__item p-knowledge-breadcrumbs__item--home">
43-
<a href="/knowledge">Knowledge Hub</a>
44-
</li>
45-
</ol>
46-
</li>
47-
<ol class="p-inline-list u-truncate u-margin-bottom-0-5rem">
48-
{% for breadcrumb in breadcrumbs %}
49-
<li class="p-inline-list__item p-knowledge-breadcrumbs__item">
50-
{% if breadcrumb.href %}<a href="{{ breadcrumb.href }}">{{ breadcrumb.name }}</a>
51-
{% else %}
52-
{{ breadcrumb.name }}
53-
{% endif %}
54-
</li>
55-
{% endfor %}
39+
<!-- Two rows -->
40+
<ol class="p-inline-list p-knowledge-breadcrumbs p-text--small-caps u-hide--large u-hide--medium">
41+
<li class="p-knowledge-breadcrumbs">
42+
<ol class="p-inline-list">
43+
<li class="p-inline-list__item p-knowledge-breadcrumbs__item p-knowledge-breadcrumbs__item--home">
44+
<a href="/knowledge">Knowledge Hub</a>
45+
</li>
46+
</ol>
47+
</li>
48+
<li>
49+
<ol class="p-inline-list u-truncate u-margin-bottom-0-5rem">
50+
{% for breadcrumb in breadcrumbs %}
51+
<li class="p-inline-list__item p-knowledge-breadcrumbs__item">
52+
{% if breadcrumb.href %}<a href="{{ breadcrumb.href }}">{{ breadcrumb.name }}</a>
53+
{% else %}
54+
{{ breadcrumb.name }}
55+
{% endif %}
56+
</li>
57+
{% endfor %}
58+
</ol>
59+
</li>
5660
</ol>
57-
</ol>
58-
{% endif %}
61+
{% endif %}
62+
</div>
5963
</div>
6064
<hr class="p-rule" />
6165
</div>

0 commit comments

Comments
 (0)