Skip to content

Commit

Permalink
update release y2024 with latest theme changes
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosceia committed Jan 8, 2025
1 parent 5a697da commit 7cb2750
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 32 deletions.
9 changes: 4 additions & 5 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand All @@ -84,4 +83,4 @@ relativeURLs = true
# Customize
[params.footer]
copyright = "Cumulocity GmbH | <a href='/legal-notices/imprint/'> Imprint</a> | <a href='/legal-notices/privacy-notice/'>Privacy notice</a>"
c8ylink = "https://cumulocity.com"
c8ylink = "https://www.cumulocity.com"
12 changes: 0 additions & 12 deletions content/rest_api/rest_api.md

This file was deleted.

3 changes: 1 addition & 2 deletions develop.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -42,4 +41,4 @@ buildFuture = true
# Customize
[params.footer]
copyright = "Cumulocity GmbH | All rights reserved"
c8ylink = "https://cumulocity.com"
c8ylink = "https://www.cumulocity.com"
8 changes: 4 additions & 4 deletions themes/c8ydocs/assets/scss/_admonitions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 3 additions & 0 deletions themes/c8ydocs/assets/scss/_dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions themes/c8ydocs/layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<body data-spy="scroll" data-target="#main-nav" data-offset="400" {{if .IsHome }} class="isHome" {{end}}>
<script type="text/javascript">
const docsPreview = {{.Site.Params.docsPreview}};
const docsPreviewString = {{.Site.Params.product_c8y_iot}} + ' ' + docsPreview + ' ' + {{if not site.Data.date_settings.yearly_release}} 'deployments' {{else}} 'release' {{end}};
</script>
{{- partial "header.html" . -}}
{{- partial "to-the-top.html" . -}}
Expand Down
2 changes: 1 addition & 1 deletion themes/c8ydocs/layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
<link rel="stylesheet" href="{{ $style.Permalink }}">
<!--STYLES END-->

Expand Down
2 changes: 1 addition & 1 deletion themes/c8ydocs/layouts/shortcodes/link-c8y-github.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{- "https://github.com/Cumulocity-IoT" -}}
{{- "https://github.com/Cumulocity-IoT/" -}}
2 changes: 1 addition & 1 deletion themes/c8ydocs/static/js/cl-filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
23 changes: 17 additions & 6 deletions themes/c8ydocs/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var main = (function ($) {
class: 'admonition preview'
}).insertAfter(elem);
$('<h4 class="title">Preview</h4>').appendTo('#preview-banner');
$('<span>This is a preview of the documentation for the Cumulocity '+ docsPreview +' release.</span>').appendTo('#preview-banner');
$('<span>This is a preview of the documentation for the '+ docsPreviewString +'.</span>').appendTo('#preview-banner');
}

//Toggle side navigation
Expand Down Expand Up @@ -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');
Expand All @@ -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 += `<div class="list-group-item p-t-16"><p><strong>${curMonth} ${curYear}</strong></p></div>`;
month = curMonth;
}
}
tocLinks += `<div class="list-group-item"><a class="toc-link" href="#${target.id}" data-refid="${h2.parentNode.id}" title="${h2.textContent}">${h2.textContent}</a></div>`;
}
});
Expand Down Expand Up @@ -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 => {
Expand Down

0 comments on commit 7cb2750

Please sign in to comment.