From 7cb27504aaaf028855b6857aafd14dc11bff6a20 Mon Sep 17 00:00:00 2001 From: Carlos Ceia Date: Wed, 8 Jan 2025 15:58:59 +0000 Subject: [PATCH] update release y2024 with latest theme changes --- config.toml | 9 ++++---- content/rest_api/rest_api.md | 12 ---------- develop.toml | 3 +-- themes/c8ydocs/assets/scss/_admonitions.scss | 8 +++---- themes/c8ydocs/assets/scss/_dropdown.scss | 3 +++ themes/c8ydocs/layouts/_default/baseof.html | 1 + themes/c8ydocs/layouts/partials/head.html | 2 +- .../layouts/shortcodes/link-c8y-github.html | 2 +- themes/c8ydocs/static/js/cl-filters.js | 2 +- themes/c8ydocs/static/js/main.js | 23 ++++++++++++++----- 10 files changed, 33 insertions(+), 32 deletions(-) delete mode 100644 content/rest_api/rest_api.md diff --git a/config.toml b/config.toml index 14e3ed4ddd..0efe967b4d 100644 --- a/config.toml +++ b/config.toml @@ -7,7 +7,6 @@ languageCode = "en-us" defaultContentLanguage = "en-us" title = "Cumulocity documentation" theme = "c8ydocs" -paginate = 12 # canonifyurls = false publishDir = "public" # googleAnalytics = "UA-xxxxxxxx-x" @@ -39,7 +38,7 @@ relativeURLs = true oldguides = "//cumulocity.com/guides/welcome/intro-documentation/" - # Boolean to display the admonition stating it is a preview version + # Can be a boolean 'false' or a string (example: 'CD' or a release version like '2024'). This flag displays the admonition stating it is a preview version docsPreview = false # Display thumbnail image of each post on index pages (false: disabled, true: enabled) @@ -73,8 +72,8 @@ relativeURLs = true link = "https://status.cumulocity.com/" [[params.additionalResources]] - name = "Company portal" - link = "https://cumulocity.com/" + name = "Company website" + link = "https://www.cumulocity.com/" [[params.additionalResources]] name = "Product Support" @@ -84,4 +83,4 @@ relativeURLs = true # Customize [params.footer] copyright = "Cumulocity GmbH | Imprint | Privacy notice" - c8ylink = "https://cumulocity.com" + c8ylink = "https://www.cumulocity.com" diff --git a/content/rest_api/rest_api.md b/content/rest_api/rest_api.md deleted file mode 100644 index 06422beeb2..0000000000 --- a/content/rest_api/rest_api.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "Rest API" -icon: "dlt-c8y-icon-rest-api" -type: external -external: https://cumulocity.com/api/ -weight: 55 -sector: - - rest_api - ---- - -Explore the latest features and improvements in our cloud environments or check out announcements on deprecations or security-relevant changes. diff --git a/develop.toml b/develop.toml index c3e8c5249e..cb3eb24476 100644 --- a/develop.toml +++ b/develop.toml @@ -5,7 +5,6 @@ languageCode = "en-us" defaultContentLanguage = "en-us" title = "Cumulocity documentation" theme = "c8ydocs" -paginate = 12 # canonifyurls = false # publishDir = "public/site" # googleAnalytics = "UA-xxxxxxxx-x" @@ -42,4 +41,4 @@ buildFuture = true # Customize [params.footer] copyright = "Cumulocity GmbH | All rights reserved" - c8ylink = "https://cumulocity.com" + c8ylink = "https://www.cumulocity.com" diff --git a/themes/c8ydocs/assets/scss/_admonitions.scss b/themes/c8ydocs/assets/scss/_admonitions.scss index 4e6e5a7efe..9122985dd4 100644 --- a/themes/c8ydocs/assets/scss/_admonitions.scss +++ b/themes/c8ydocs/assets/scss/_admonitions.scss @@ -118,13 +118,13 @@ } .preview:not(.page-section) { - border-color: var(--c8y-palette-status-preview); - background-color: var(--c8y-palette-status-preview-high); + border-color: var(--c8y-palette-status-info); + background-color: var(--c8y-palette-status-info-light); } .preview .title { - color: var(--c8y-palette-status-preview); - border-color: var(--c8y-palette-status-preview); + color: var(--c8y-palette-status-info); + border-color: var(--c8y-palette-status-info); &:before { content: $dlt-c8y-icon-preview; } diff --git a/themes/c8ydocs/assets/scss/_dropdown.scss b/themes/c8ydocs/assets/scss/_dropdown.scss index 33185774c6..8676fe1049 100644 --- a/themes/c8ydocs/assets/scss/_dropdown.scss +++ b/themes/c8ydocs/assets/scss/_dropdown.scss @@ -74,6 +74,9 @@ &::after{ display: none!important; } + &.active{ + box-shadow: inset 4px 0 0 var(--c8y-brand-primary), inset 0 -1px 0 rgba(black, .1); + } } } diff --git a/themes/c8ydocs/layouts/_default/baseof.html b/themes/c8ydocs/layouts/_default/baseof.html index ed8a7fe96c..39053e05d1 100644 --- a/themes/c8ydocs/layouts/_default/baseof.html +++ b/themes/c8ydocs/layouts/_default/baseof.html @@ -4,6 +4,7 @@ {{- partial "header.html" . -}} {{- partial "to-the-top.html" . -}} diff --git a/themes/c8ydocs/layouts/partials/head.html b/themes/c8ydocs/layouts/partials/head.html index c2221be294..b4976a8ece 100644 --- a/themes/c8ydocs/layouts/partials/head.html +++ b/themes/c8ydocs/layouts/partials/head.html @@ -45,7 +45,7 @@ {{ $options := (dict "targetPath" $cssfile "outputStyle" "compressed" "enableSourceMap" true "includePaths" (slice "node_modules/myscss")) }} - {{ $style := resources.Get "scss/main.scss" | resources.ToCSS $options }} + {{ $style := resources.Get "scss/main.scss" | css.Sass $options }} diff --git a/themes/c8ydocs/layouts/shortcodes/link-c8y-github.html b/themes/c8ydocs/layouts/shortcodes/link-c8y-github.html index 61db59557a..175903d89a 100644 --- a/themes/c8ydocs/layouts/shortcodes/link-c8y-github.html +++ b/themes/c8ydocs/layouts/shortcodes/link-c8y-github.html @@ -1 +1 @@ -{{- "https://github.com/Cumulocity-IoT" -}} +{{- "https://github.com/Cumulocity-IoT/" -}} diff --git a/themes/c8ydocs/static/js/cl-filters.js b/themes/c8ydocs/static/js/cl-filters.js index dd74d4fa66..1ee16287cc 100644 --- a/themes/c8ydocs/static/js/cl-filters.js +++ b/themes/c8ydocs/static/js/cl-filters.js @@ -198,7 +198,7 @@ window.onload = (event) => { // Get the hash from the URL and scroll into it const hash = window.location.hash; - const targt = document.querySelector(hash); + const targt = hash ? document.querySelector(hash) : false; if (hash && targt) { setTimeout(() => { targt.scrollIntoView(); diff --git a/themes/c8ydocs/static/js/main.js b/themes/c8ydocs/static/js/main.js index 2bab271e0c..c9594a4e40 100644 --- a/themes/c8ydocs/static/js/main.js +++ b/themes/c8ydocs/static/js/main.js @@ -17,7 +17,7 @@ var main = (function ($) { class: 'admonition preview' }).insertAfter(elem); $('

Preview

').appendTo('#preview-banner'); - $('This is a preview of the documentation for the Cumulocity '+ docsPreview +' release.').appendTo('#preview-banner'); + $('This is a preview of the documentation for the '+ docsPreviewString +'.').appendTo('#preview-banner'); } //Toggle side navigation @@ -144,11 +144,11 @@ function buildToc() { if (tocLinks.length) { const existingTocContainer = article.querySelector('.list-group'); - + if (!existingTocContainer) { const tocContainer = document.createElement('div'); tocContainer.classList.add('toc-container'); - + const listGroup = document.createElement('div'); listGroup.classList.add('list-group'); listGroup.classList.add('toc'); @@ -161,10 +161,21 @@ function buildToc() { }); } else { let tocLinks = ''; + let month = ''; articles.forEach(article => { let h2 = article.querySelector('h5'); let target = h2.parentNode.nextElementSibling; if (target && h2.textContent.length) { + // Test if the text is a date string used for CD release (example: December 10, 2024) or a version string used for yearly release (example: 2024.12) + // Simple check of presence of whitespace in the string can help us check if the string is a date or a version + if (/\s/g.test(h2.textContent)) { + let curMonth = h2.textContent.split(' ')[0]; + let curYear = h2.textContent.split(' ')[2]; + if (month !== curMonth) { + tocLinks += `

${curMonth} ${curYear}

`; + month = curMonth; + } + } tocLinks += `
${h2.textContent}
`; } }); @@ -209,13 +220,13 @@ function buildToc() { const srcEl = document.getElementById(findVisibleElement(targetElement.id)); const rect = srcEl.getBoundingClientRect(); const windowHeight = window.innerHeight; - + // Calculate the top threshold for activation (top third of the viewport) const topThreshold = windowHeight / 3; - + // Check if the element's top position is within the top threshold const elementTopInTopThird = rect.top <= topThreshold; - + if (elementTopInTopThird) { let tempActive = document.querySelectorAll('.toc .active'); tempActive.forEach(temp => {