Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
"/templates/static/js"
],
"devDependencies": {
"@canonical/cookie-policy": "3.6.5",
"@canonical/latest-news": "2.1.0",
"@canonical/cookie-policy": "3.8.0",
"@canonical/latest-news": "2.2.0",
"@percy/cli": "1.30.7",
"@testing-library/cypress": "10.0.3",
"autoprefixer": "10.4.20",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@

<script src="{{ versioned_static('build/js/modules/latest-news.js') }}"></script>
<script>
canonicalLatestNews.fetchLatestNews({
// Make sure you add `p-image-container__image` to ensure the article image receives the correct styling.
imageClasses: ["p-image-container__image"],
/*
Make sure your article limit and `template_config.layout` match.
Use "3-blocks" with `limit: "3"`.
*/
limit: "3",
articlesContainerSelector: "#articles-3-blocks",
articleTemplateSelector: "#template",
excerptLength: 180,
gtmEventLabel: "Vanilla Blog pattern template example",
})
canonicalLatestNews.fetchLatestNews({
// Make sure you add `p-image-container__image` to ensure the article image receives the correct styling.
imageClasses: ["p-image-container__image"],
/*
Make sure your article limit and `template_config.layout` match.
Use "3-blocks" with `limit: "3"`.
*/
limit: "3",
articlesContainerSelector: "#articles-3-blocks",
articleTemplateSelector: "#template",
excerptLength: 180,
gtmEventLabel: "Vanilla Blog pattern template example",
// Adjust per your needs.
hostname: "ubuntu.com",
})
</script>
{% endblock %}
28 changes: 15 additions & 13 deletions templates/docs/examples/patterns/blog/dynamic-responsive.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@

<script src="{{ versioned_static('build/js/modules/latest-news.js') }}"></script>
<script>
canonicalLatestNews.fetchLatestNews({
// Make sure you add `p-image-container__image` to ensure the article image receives the correct styling.
imageClasses: ["p-image-container__image"],
/*
Make sure your article limit and `template_config.layout` match.
Use "4-blocks" (or no layout, as 4-blocks is the default) with `limit: "4"`.
*/
limit: "4",
articlesContainerSelector: "#articles",
articleTemplateSelector: "#template",
excerptLength: 180,
gtmEventLabel: "Vanilla Blog pattern template example",
})
canonicalLatestNews.fetchLatestNews({
// Make sure you add `p-image-container__image` to ensure the article image receives the correct styling.
imageClasses: ["p-image-container__image"],
/*
Make sure your article limit and `template_config.layout` match.
Use "4-blocks" (or no layout, as 4-blocks is the default) with `limit: "4"`.
*/
limit: "4",
articlesContainerSelector: "#articles",
articleTemplateSelector: "#template",
excerptLength: 180,
gtmEventLabel: "Vanilla Blog pattern template example",
// Adjust per your needs.
hostname: "ubuntu.com",
})
</script>

{% endblock %}
16 changes: 9 additions & 7 deletions templates/docs/patterns/blog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ Be sure to match `articlesContainerSelector` with `template_container_id`, `arti
```javascript
{% raw -%}
canonicalLatestNews.fetchLatestNews({
// Make sure you add `p-image-container__image` to ensure the article image receives the correct styling.
imageClasses: ["p-image-container__image"],
// Use `3` with `template_config.layout="3-blocks"` or `4` with `template_config.layout="4-blocks"`
limit: "3",
articlesContainerSelector: "#articles",
articleTemplateSelector: "#template",
excerptLength: 180
// Make sure you add `p-image-container__image` to ensure the article image receives the correct styling.
imageClasses: ["p-image-container__image"],
// Use `3` with `template_config.layout="3-blocks"` or `4` with `template_config.layout="4-blocks"`
limit: "3",
articlesContainerSelector: "#articles",
articleTemplateSelector: "#template",
excerptLength: 180,
// Adjust per your needs.
hostname: "ubuntu.com",
});
{%- endraw -%}
```
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -507,15 +507,15 @@
stream "^0.0.3"
util "^0.12.5"

"@canonical/cookie-policy@3.6.5":
version "3.6.5"
resolved "https://registry.yarnpkg.com/@canonical/cookie-policy/-/cookie-policy-3.6.5.tgz#50d82df6da2970b6b5d78d066dd94fcc1317e591"
integrity sha512-CQJKSkuLXhSumkIIw4YPSjR7k9561hZ3EEdMPQTkAVTxXURhm3WzJm/uyrvcAuU/a//jzWa8ScltCaHFBdACew==
"@canonical/cookie-policy@3.8.0":
version "3.8.0"
resolved "https://registry.yarnpkg.com/@canonical/cookie-policy/-/cookie-policy-3.8.0.tgz#8f20b5d6d0c2e5553bbe05d1513f7f1af7d0836c"
integrity sha512-njUYf10gFmuXr47Aj5jayuFbyq08IkBdr/W6qtvHjZvJ8Dt4ru9ehMacWa4mostfQoXVARusIucOARSgnMoArg==

"@canonical/latest-news@2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@canonical/latest-news/-/latest-news-2.1.0.tgz#1dbe80117044380f750b9fbf52f2194a14aeeb83"
integrity sha512-L8YDIVsgZlm6j24lnMmRsLfzUAgK+GRy83TblCXI6D8wntrfhAz0F6no58uW3E5vjvq0XEOUXYryqjvR+JTzTg==
"@canonical/latest-news@2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@canonical/latest-news/-/latest-news-2.2.0.tgz#bd471cdfa51394d7450259a4ed4c19c88af91a3c"
integrity sha512-hHtIIrHgoF9VqhWzlphWRJ2vnJekMqdTF5pscp0TZneivkk8YDkd1QUAupnBWkH0hQQ7h6kNwxtD56gxC7s/Dg==

"@colors/colors@1.5.0":
version "1.5.0"
Expand Down
Loading