From f4fdc604ed3c364dcebf5f64e2e98dbaf07a5064 Mon Sep 17 00:00:00 2001 From: Mikita Pilinka Date: Fri, 19 Apr 2024 11:49:51 +0200 Subject: [PATCH 01/27] fix: indent unordered lists in description Ticket: ENT-11532 Changelog: None Signed-off-by: Mikita Pilinka --- themes/cfbs-theme/styles/less/modulePage.less | 1 + 1 file changed, 1 insertion(+) diff --git a/themes/cfbs-theme/styles/less/modulePage.less b/themes/cfbs-theme/styles/less/modulePage.less index 544a6e8..d0553d1 100644 --- a/themes/cfbs-theme/styles/less/modulePage.less +++ b/themes/cfbs-theme/styles/less/modulePage.less @@ -253,6 +253,7 @@ ul { list-style: none; margin: 0.6rem 0; + padding-left: 3.2rem; li { margin-left: 2rem; list-style-image: url(/images/orange-list-icon.svg); From 7571262b164c1ed63f410524f17649f00324e887 Mon Sep 17 00:00:00 2001 From: olehermanse <4048546+olehermanse@users.noreply.github.com> Date: Sun, 21 Apr 2024 00:08:59 +0000 Subject: [PATCH 02/27] Upgraded Hugo version to 0.125.2 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7160f44..fba366c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM node:18-alpine AS build ARG GITHUB_USERNAME_TOKEN WORKDIR /build-website -ADD https://github.com/gohugoio/hugo/releases/download/v0.124.1/hugo_0.124.1_Linux-64bit.tar.gz hugo.tar.gz -RUN echo "b2b20fea637bc2a1e98b7ac93da0e4bb39ebb45ea73f261efb0de0a6f3ea87fd hugo.tar.gz" | sha256sum -c +ADD https://github.com/gohugoio/hugo/releases/download/v0.125.2/hugo_0.125.2_Linux-64bit.tar.gz hugo.tar.gz +RUN echo "8bb882ea84a37f89e6b53e12bc48eab05d0aeab4435aeb7e38ad2c0f257f38bc hugo.tar.gz" | sha256sum -c RUN tar -zxvf hugo.tar.gz COPY package-lock.json package.json ./ RUN npm ci From a4341ae6133730ebdcbf101ddae7c111ea235522 Mon Sep 17 00:00:00 2001 From: olehermanse <4048546+olehermanse@users.noreply.github.com> Date: Sun, 28 Apr 2024 00:09:24 +0000 Subject: [PATCH 03/27] Upgraded Hugo version to 0.125.4 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index fba366c..96fdbe1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM node:18-alpine AS build ARG GITHUB_USERNAME_TOKEN WORKDIR /build-website -ADD https://github.com/gohugoio/hugo/releases/download/v0.125.2/hugo_0.125.2_Linux-64bit.tar.gz hugo.tar.gz -RUN echo "8bb882ea84a37f89e6b53e12bc48eab05d0aeab4435aeb7e38ad2c0f257f38bc hugo.tar.gz" | sha256sum -c +ADD https://github.com/gohugoio/hugo/releases/download/v0.125.4/hugo_0.125.4_Linux-64bit.tar.gz hugo.tar.gz +RUN echo "00dc0674e458560dc7ee3310d1d4adb509208be867d9498d0055fd29e406e251 hugo.tar.gz" | sha256sum -c RUN tar -zxvf hugo.tar.gz COPY package-lock.json package.json ./ RUN npm ci From 5db40e23a03eaf610ac9e4506b74a8862696f27e Mon Sep 17 00:00:00 2001 From: olehermanse <4048546+olehermanse@users.noreply.github.com> Date: Sun, 5 May 2024 00:08:53 +0000 Subject: [PATCH 04/27] Upgraded Hugo version to 0.125.5 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 96fdbe1..2936c3d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM node:18-alpine AS build ARG GITHUB_USERNAME_TOKEN WORKDIR /build-website -ADD https://github.com/gohugoio/hugo/releases/download/v0.125.4/hugo_0.125.4_Linux-64bit.tar.gz hugo.tar.gz -RUN echo "00dc0674e458560dc7ee3310d1d4adb509208be867d9498d0055fd29e406e251 hugo.tar.gz" | sha256sum -c +ADD https://github.com/gohugoio/hugo/releases/download/v0.125.5/hugo_0.125.5_Linux-64bit.tar.gz hugo.tar.gz +RUN echo "94bb814bb6dc382095fd0f076d0f6d0d843beb2714d68041eea224b0789fd03d hugo.tar.gz" | sha256sum -c RUN tar -zxvf hugo.tar.gz COPY package-lock.json package.json ./ RUN npm ci From 1ec1adc168165debad5b4b503b4f97f5c7c30c43 Mon Sep 17 00:00:00 2001 From: olehermanse <4048546+olehermanse@users.noreply.github.com> Date: Sun, 12 May 2024 00:09:13 +0000 Subject: [PATCH 05/27] Upgraded Hugo version to 0.125.7 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2936c3d..c0728a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM node:18-alpine AS build ARG GITHUB_USERNAME_TOKEN WORKDIR /build-website -ADD https://github.com/gohugoio/hugo/releases/download/v0.125.5/hugo_0.125.5_Linux-64bit.tar.gz hugo.tar.gz -RUN echo "94bb814bb6dc382095fd0f076d0f6d0d843beb2714d68041eea224b0789fd03d hugo.tar.gz" | sha256sum -c +ADD https://github.com/gohugoio/hugo/releases/download/v0.125.7/hugo_0.125.7_Linux-64bit.tar.gz hugo.tar.gz +RUN echo "b235ad9442ccf0d0c2ec43cffb5d7961718b7eb03bdd7b8dc8df4a7da36a1777 hugo.tar.gz" | sha256sum -c RUN tar -zxvf hugo.tar.gz COPY package-lock.json package.json ./ RUN npm ci From ed28ef261e0ec9b0b3eb27e1aff3c1e35528f5d6 Mon Sep 17 00:00:00 2001 From: olehermanse <4048546+olehermanse@users.noreply.github.com> Date: Sun, 19 May 2024 00:09:21 +0000 Subject: [PATCH 06/27] Upgraded Hugo version to 0.126.1 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c0728a6..24cc784 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM node:18-alpine AS build ARG GITHUB_USERNAME_TOKEN WORKDIR /build-website -ADD https://github.com/gohugoio/hugo/releases/download/v0.125.7/hugo_0.125.7_Linux-64bit.tar.gz hugo.tar.gz -RUN echo "b235ad9442ccf0d0c2ec43cffb5d7961718b7eb03bdd7b8dc8df4a7da36a1777 hugo.tar.gz" | sha256sum -c +ADD https://github.com/gohugoio/hugo/releases/download/v0.126.1/hugo_0.126.1_Linux-64bit.tar.gz hugo.tar.gz +RUN echo "48d85fdfa6ac70831bd3207e328a6b274c55f76e40f9e7486380c3d72062469e hugo.tar.gz" | sha256sum -c RUN tar -zxvf hugo.tar.gz COPY package-lock.json package.json ./ RUN npm ci From 5cc1e186b7ce56e81a589eeb335152f13d3f554a Mon Sep 17 00:00:00 2001 From: olehermanse <4048546+olehermanse@users.noreply.github.com> Date: Sun, 2 Jun 2024 00:09:20 +0000 Subject: [PATCH 07/27] Upgraded Hugo version to 0.126.2 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 24cc784..25710df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM node:18-alpine AS build ARG GITHUB_USERNAME_TOKEN WORKDIR /build-website -ADD https://github.com/gohugoio/hugo/releases/download/v0.126.1/hugo_0.126.1_Linux-64bit.tar.gz hugo.tar.gz -RUN echo "48d85fdfa6ac70831bd3207e328a6b274c55f76e40f9e7486380c3d72062469e hugo.tar.gz" | sha256sum -c +ADD https://github.com/gohugoio/hugo/releases/download/v0.126.2/hugo_0.126.2_Linux-64bit.tar.gz hugo.tar.gz +RUN echo "5b48b23ad9738a4bdd8d28dd09d5e78b5c09edfd815d02a9608e9eea53b7762e hugo.tar.gz" | sha256sum -c RUN tar -zxvf hugo.tar.gz COPY package-lock.json package.json ./ RUN npm ci From 37a51987c35f0eeab87c8f73d44ee30df7a05e7c Mon Sep 17 00:00:00 2001 From: olehermanse <4048546+olehermanse@users.noreply.github.com> Date: Sun, 9 Jun 2024 00:10:10 +0000 Subject: [PATCH 08/27] Upgraded Hugo version to 0.127.0 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 25710df..d90d979 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM node:18-alpine AS build ARG GITHUB_USERNAME_TOKEN WORKDIR /build-website -ADD https://github.com/gohugoio/hugo/releases/download/v0.126.2/hugo_0.126.2_Linux-64bit.tar.gz hugo.tar.gz -RUN echo "5b48b23ad9738a4bdd8d28dd09d5e78b5c09edfd815d02a9608e9eea53b7762e hugo.tar.gz" | sha256sum -c +ADD https://github.com/gohugoio/hugo/releases/download/v0.127.0/hugo_0.127.0_Linux-64bit.tar.gz hugo.tar.gz +RUN echo "3cf961de9831c0f2ac0e67eabc83251916ae8729292fa85ffa140e59bcbea8c0 hugo.tar.gz" | sha256sum -c RUN tar -zxvf hugo.tar.gz COPY package-lock.json package.json ./ RUN npm ci From 8d1fc1c0d6dc56c1b73d5d2ec427c56995179a47 Mon Sep 17 00:00:00 2001 From: Mikita Pilinka Date: Tue, 25 Jun 2024 14:36:02 +0200 Subject: [PATCH 09/27] added CSP policy to headers in nginx config Ticket: SEC-1051 Changelog: None Signed-off-by: Mikita Pilinka --- nginx.conf | 3 +++ static/js/cookie-consent-listener.js | 17 +++++++++++++++++ .../cfbs-theme/layouts/partials/header.html | 19 +------------------ 3 files changed, 21 insertions(+), 18 deletions(-) create mode 100644 static/js/cookie-consent-listener.js diff --git a/nginx.conf b/nginx.conf index 9882e5e..5444638 100644 --- a/nginx.conf +++ b/nginx.conf @@ -73,6 +73,9 @@ http { add_header Strict-Transport-Security "max-age=31536000; includeSubdomains" always; add_header X-Content-Type-Options "nosniff" always; add_header 'Referrer-Policy' 'strict-origin'; + # 'sha256-ruKmkK0iwJgE/F4xuzLY3V2OuzVOOJISav7NURhCKsM=' hugo discuss template (https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/disqus.html) + add_header Content-Security-Policy "default-src 'none'; style-src 'self' 'unsafe-inline' cdn.jsdelivr.net; connect-src 'self' *.disqus.com *.disquscdn.com *.google-analytics.com; script-src 'self' 'sha256-ruKmkK0iwJgE/F4xuzLY3V2OuzVOOJISav7NURhCKsM=' *.disqus.com *.disquscdn.com *.googletagmanager.com; object-src 'self'; img-src 'self' data: https:; font-src 'self' https:; frame-src 'self' www.google.com www.youtube.com; manifest-src 'self'; base-uri 'self'; form-action 'self'; frame-ancestors 'self'; upgrade-insecure-requests;"; + #add_header Feature-Policy "speaker self;fullscreen self;"; ## Block common exploits ## https://www.howtoforge.com/nginx-how-to-block-exploits-sql-injections-file-injections-spam-user-agents-etc diff --git a/static/js/cookie-consent-listener.js b/static/js/cookie-consent-listener.js new file mode 100644 index 0000000..25ccaca --- /dev/null +++ b/static/js/cookie-consent-listener.js @@ -0,0 +1,17 @@ +let gaInitialized = false; +document.addEventListener('cookieconsent_allowed', () => { + console.log('allowed'); + if (gaInitialized === true) return; + const script = document.createElement('script'); + script.src = 'https://www.googletagmanager.com/gtag/js?id=G-TW89K2P8L4'; + document.head.appendChild(script); + script.addEventListener('load', function () { + window.dataLayer = window.dataLayer || []; + function gtag() { + dataLayer.push(arguments); + } + gtag('js', new Date()); + gtag('config', 'G-TW89K2P8L4'); + gaInitialized = true; + }); +}); diff --git a/themes/cfbs-theme/layouts/partials/header.html b/themes/cfbs-theme/layouts/partials/header.html index f1f27ff..905cfa0 100644 --- a/themes/cfbs-theme/layouts/partials/header.html +++ b/themes/cfbs-theme/layouts/partials/header.html @@ -24,24 +24,7 @@ - + From a995b3adef26e351f931ea0059ce87f809a29e9d Mon Sep 17 00:00:00 2001 From: Mikita Pilinka Date: Thu, 27 Jun 2024 15:44:00 +0200 Subject: [PATCH 10/27] refactored to comply with new CSP Ticket: SEC-1051 Changelog: None Signed-off-by: Mikita Pilinka --- static/js/cookie-consent-listener.js | 1 - static/js/cookie-consent.js | 6 +- static/js/main.js | 59 +++-- static/js/modules-list.js | 203 ++++++++++++------ themes/cfbs-theme/layouts/partials/list.html | 6 +- themes/cfbs-theme/layouts/partials/nav.html | 56 ++--- .../layouts/partials/publishModule.html | 5 +- themes/cfbs-theme/styles/less/header.less | 72 ++++--- themes/cfbs-theme/styles/less/modulePage.less | 2 +- themes/cfbs-theme/styles/less/modules.less | 3 +- 10 files changed, 260 insertions(+), 153 deletions(-) diff --git a/static/js/cookie-consent-listener.js b/static/js/cookie-consent-listener.js index 25ccaca..afa446c 100644 --- a/static/js/cookie-consent-listener.js +++ b/static/js/cookie-consent-listener.js @@ -1,6 +1,5 @@ let gaInitialized = false; document.addEventListener('cookieconsent_allowed', () => { - console.log('allowed'); if (gaInitialized === true) return; const script = document.createElement('script'); script.src = 'https://www.googletagmanager.com/gtag/js?id=G-TW89K2P8L4'; diff --git a/static/js/cookie-consent.js b/static/js/cookie-consent.js index 866b2fe..65ddb59 100644 --- a/static/js/cookie-consent.js +++ b/static/js/cookie-consent.js @@ -31,10 +31,10 @@ const cookieConsent = (function () { View our cookie policy @@ -49,6 +49,8 @@ const cookieConsent = (function () { const wrapper = document.createElement("div"); wrapper.innerHTML = modalHTML; document.body.appendChild(wrapper) + document.getElementById('cookie-decline').addEventListener('click', cookieConsent.deny); + document.getElementById('cookie-allow').addEventListener('click', cookieConsent.allow); } diff --git a/static/js/main.js b/static/js/main.js index e0012e4..12b17ba 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -1,5 +1,5 @@ document.querySelectorAll('[data-modal]').forEach(item => { - item.onclick = () => { + item.addEventListener('click', () => { const modal = document.getElementById(item.dataset.modal); modal.style.display = 'block'; modal.querySelector('.btn-primary').focus(); @@ -8,22 +8,23 @@ document.querySelectorAll('[data-modal]').forEach(item => { dc.classList.add('close'); setTimeout(() => dc.classList.remove('close'), 100); } - } + }) }) -window.onclick = e => { - if (e.target.classList.contains('modal')) { - e.target.style.display = "none"; +window.addEventListener('click', (e)=>{ + const {target} = e; + if (target.classList.contains('modal')) { + target.style.display = "none"; } - if (!e.target.closest('.dropdown-select') || e.target.parentElement.classList.contains('dropdown-select_options')) { + if (!target.closest('.dropdown-select') || target.parentElement.classList.contains('dropdown-select_options')) { document.querySelectorAll('.dropdown-select').forEach(item => item.classList.remove('opened')) } -} +}) -document.querySelectorAll('.dropdown-select span').forEach(item => item.onclick = () => { +document.querySelectorAll('.dropdown-select span').forEach(item => item.addEventListener('click', () => { item.closest('.dropdown-select').classList.toggle('opened') -}); +})); const versionsDropdown = document.querySelector('.dropdown-select.versions'); if (versionsDropdown) { @@ -39,7 +40,6 @@ document.onkeyup = e => { } } -const closeModal = (el) => el.closest('.modal').style.display = 'none'; const fakeLogin = (el) => { el.style.display = 'none'; @@ -47,32 +47,34 @@ const fakeLogin = (el) => { } document.querySelectorAll('.tabs div[data-tab]').forEach(item => { - item.onclick = function () { + item.addEventListener('click', () => { document.querySelector('div[data-tab].active').classList.remove('active'); item.classList.add('active'); document.querySelector('.tabs-content.opened').classList.remove('opened'); document.getElementById(`tab${item.dataset.tab}`).classList.add('opened'); - } + }) }) const collapse = document.querySelector('.collapse'); const dropDownHandler = function (element) { - const openedClass = "opened"; - document.querySelector('li.dropdown.opened').classList.remove('opened'); - const li = element.closest('li'); - if (li.className.indexOf(openedClass) == -1) { - li.className += ` ${openedClass}`; - } else { - li.className = li.className.replace(` ${openedClass}`, ""); + document.querySelectorAll('.dropdown-item-onclick.opened').forEach((el)=> el !== element && el.classList.toggle('opened') ); + + if(window.matchMedia("(pointer: coarse)").matches) { + element.classList.toggle('opened'); } } +document.querySelectorAll('.dropdown-item-onclick').forEach(element=>{ + element.addEventListener('click', (e)=>dropDownHandler(e.target)); +}) -const openMenuHandler = function (collapseMenu) { +const openMenuHandler = function () { + const collapseMenu = document.getElementById('openMenuToggle'); const menu = document.querySelector('.main-menu .links'); const openedClass = "opened"; + document.querySelectorAll('.dropdown-item-onclick.opened').forEach((element)=>element.classList.toggle('opened')); if (collapseMenu.className.indexOf(openedClass) == -1) { collapseMenu.className += ` ${openedClass}`; menu.className += ` d-b`; @@ -81,6 +83,7 @@ const openMenuHandler = function (collapseMenu) { menu.className = menu.className.replace(` d-b`, ""); } } +document.getElementById('openMenuToggle').addEventListener('click', () => openMenuHandler()); const allTags = el => { const tags = document.querySelector('.modules-right-tags_list'); @@ -92,6 +95,10 @@ const allTags = el => { tags.classList.add('opened'); } } +const allTagsElement = document.getElementById('all-tags'); +allTagsElement?.addEventListener('click',(e)=>{ + allTags(e.target); +}) let tm; const cl = document.querySelector('.copy-link.bi-link-45deg'); @@ -126,3 +133,15 @@ String.prototype.capitalize = function() { // remove all chars except alphanumeric, spaces and . , _ - const sanitizeString = str => str !== null ? str.replace(/[^a-z0-9\.\s,_-]/gim,"") : null; +const publishModalElement = document.querySelector('[data-modal="publishModal"]'); +publishModalElement.addEventListener('click', ()=>{ + const closeModal = (el) => el.closest('.modal').style.display = 'none'; + document.querySelectorAll('.close-modal-click').forEach(element => { + element.addEventListener('click', e=> closeModal(e.target)); + }) + document.querySelectorAll('.opened').forEach(element=>element.classList.toggle('opened')) + const menu = document.querySelector('.links.d-b'); + if (menu){ + menu.classList.toggle('d-b'); + } +}) \ No newline at end of file diff --git a/static/js/modules-list.js b/static/js/modules-list.js index 34ce8af..c171933 100644 --- a/static/js/modules-list.js +++ b/static/js/modules-list.js @@ -9,7 +9,25 @@ const sortOptions = { }; let sort = sortOptions.alphabetic; +const modulesList = function (query, tags = []) { + let ids = []; + modules = []; + if (query.length > 0) { + flexSearchIndex.search(query).forEach(item => ids.push(...item.result)); + [...new Set(ids)].map(key => { + modules.push(pagesIndex[key]) + }); + } else { + modules = Object.keys(pagesIndex).map(key => pagesIndex[key]); + } + if (tags.length > 0) { + // if we merge module tags and tags from the filter and unique array length will be the same as module tags length, + // then all filtered tags intersect with module tags + modules = modules.filter(item => [...new Set([...item.tags, ...tags])].length == (item.tags.length )) + } + return modules; +} // if sorting is selected from the dropdown then do not change it automatically const changeDefaultSorting = newSortOption => (getSearchParam('sort') == null) && (sort = newSortOption) @@ -76,18 +94,32 @@ const orderChanged = (e) => { document.querySelectorAll('.sort-by .dropdown-select_options div').forEach(item => item.addEventListener('click', orderChanged)) +const createTagElement = (tag, remove = false)=>{ + const li = document.createElement('li'); + const a = document.createElement('a'); + a.textContent = tag; + a.addEventListener('click',()=>remove ? removeTag(tag) : selectTag(tag)); + li.appendChild(a); + if (remove){ + const i = document.createElement('i'); + i.className = 'bi bi-x'; + li.appendChild(i); + } + return li; +} + document.addEventListener('TAGS_LOADED', function (e) { const selectedTags = getTags(); - let tagsHtml = ''; - tags.forEach(tag => tagsHtml += tag == 'Supported' ? '' : `
  • ${sanitizeString(tag)}
  • `); - document.querySelector('ul.tags').innerHTML = tagsHtml; - if (selectedTags.length) { - document.querySelector('.modules-applied-tags').style.display = 'block'; + const tagElements = [...tags].map(tag => tag === 'Supported' ? null : createTagElement(sanitizeString(tag))).filter(Boolean); + document.querySelector('ul.tags').append(...tagElements); + const appliedTagsElement = document.querySelector('.modules-applied-tags') + if (appliedTagsElement && selectedTags.length) { + appliedTagsElement.style.display = 'block'; searchParts.tags.push(...selectedTags); document.dispatchEvent(new Event('RENDER')) - document.querySelector('.modules-applied-tags ul').innerHTML = selectedTags.map(item => `
  • ${sanitizeString(item)}
  • `).join(''); - } else { - document.querySelector('.modules-applied-tags').style.display = 'none'; + document.querySelector('.modules-applied-tags ul').append(...selectedTags.map(item => createTagElement(sanitizeString(item, true)))); + } else if (appliedTagsElement) { + appliedTagsElement.style.display = 'none'; } }) @@ -145,6 +177,9 @@ const selectTag = function (tag) { tags.forEach(item => searchParams.append('tag', item)) location.search = searchParams.toString(); } +document.getElementById('supported-tag').addEventListener('click',(e)=>{ + selectTag('supported'); +}) const removeTag = function (tag) { const searchParams = new URLSearchParams(location.search); @@ -161,77 +196,115 @@ const removeAllTags = function () { searchParams.delete('tag') location.search = searchParams.toString(); } +document.getElementById('removeAllTags').addEventListener('click', removeAllTags) const getTags = () => (new URLSearchParams(location.search)).getAll('tag'); -const modulesList = function (query, tags = []) { - let ids = []; - modules = []; - if (query.length > 0) { - flexSearchIndex.search(query).forEach(item => ids.push(...item.result)); - [...new Set(ids)].map(key => { - modules.push(pagesIndex[key]) - }); - } else { - modules = Object.keys(pagesIndex).map(key => pagesIndex[key]); - } - if (tags.length > 0) { - // if we merge module tags and tags from the filter and unique array length will be the same as module tags length, - // then all filtered tags intersect with module tags - modules = modules.filter(item => [...new Set([...item.tags, ...tags])].length == (item.tags.length )) - } - return modules; -} function renderModules(results) { pagination.maxPage = Math.ceil(modules.length / pagination.perPage); - resultsWrapper.innerHTML = ''; - document.querySelectorAll('.pagesCount').forEach(item => item.innerHTML = modules.length); + resultsWrapper.replaceChildren(); + document.querySelectorAll('.pagesCount').forEach(item => item.textContent = modules.length); initPaginationHtml(); if (!results.length || !resultsWrapper) { return; } - resultsWrapper.innerHTML = ''; + resultsWrapper.replaceChildren(); let modulesHTML = ''; - results.forEach(function (result) { - modulesHTML += ` -
    -
    -
    -
    -
    -
    - -
    -
    - ${result.title} -
    by ${result.author.name}
    -
    -
    -
    -

    - ${result.description} -

    -
    -
      - ${result.tags.map(tag => `
    • - ${tag} -
    • `).join('')} -
    -
    -
    -
    -
    ${result.version ? 'Version: ' + result.version : ''}
    -
    Updated: ${result.updated}
    -
    Total downloads: ${result.downloads}
    -
    -
    -
    ` + results.forEach(function(result) { + const article = document.createElement('article'); + article.className = 'modules-item'; + + const flexDiv = document.createElement('div'); + flexDiv.className = 'flex flex-space-between'; + + const leftDiv = document.createElement('div'); + + const itemNameDiv = document.createElement('div'); + itemNameDiv.className = 'modules-item_name flex-grow'; + + const flexAlignDiv = document.createElement('div'); + flexAlignDiv.className = 'flex flex--align_center'; + + const avatarDiv = document.createElement('div'); + avatarDiv.className = 'modules-item_avatar'; + + const avatarImg = document.createElement('img'); + avatarImg.width = 32; + avatarImg.height = 32; + avatarImg.src = result.author.image; + avatarDiv.appendChild(avatarImg); + + const infoDiv = document.createElement('div'); + + const titleLink = document.createElement('a'); + titleLink.href = result.href; + titleLink.className = 'modules-item_title'; + titleLink.textContent = result.title; + + const authorDiv = document.createElement('div'); + authorDiv.className = 'modules-item_author'; + authorDiv.textContent = `by ${result.author.name}`; + + infoDiv.appendChild(titleLink); + infoDiv.appendChild(authorDiv); + + flexAlignDiv.appendChild(avatarDiv); + flexAlignDiv.appendChild(infoDiv); + itemNameDiv.appendChild(flexAlignDiv); + + const descriptionP = document.createElement('p'); + descriptionP.className = 'modules-item_description'; + descriptionP.textContent = result.description; + + const tagsDiv = document.createElement('div'); + tagsDiv.className = 'modules-item_tags tags'; + + const tagsUl = document.createElement('ul'); + result.tags.forEach(tag => { + const tagLi = document.createElement('li'); + tagLi.className = tag.toLowerCase(); + + const tagA = document.createElement('a'); + tagA.href = '#'; + tagA.addEventListener('click', ()=> selectTag(tag)); + tagA.textContent = tag; + tagLi.appendChild(tagA); + tagsUl.appendChild(tagLi); + }); + tagsDiv.appendChild(tagsUl); + + leftDiv.appendChild(itemNameDiv); + leftDiv.appendChild(descriptionP); + leftDiv.appendChild(tagsDiv); + + const rightDiv = document.createElement('div'); + rightDiv.className = 'right-info'; + + if (result.version) { + const versionDiv = document.createElement('div'); + versionDiv.textContent = `Version: ${result.version}`; + rightDiv.appendChild(versionDiv); + } + + const updatedDiv = document.createElement('div'); + updatedDiv.textContent = `Updated: ${result.updated}`; + rightDiv.appendChild(updatedDiv); + + const downloadsDiv = document.createElement('div'); + downloadsDiv.textContent = `Total downloads: ${result.downloads}`; + rightDiv.appendChild(downloadsDiv); + + flexDiv.appendChild(leftDiv); + flexDiv.appendChild(rightDiv); + + article.appendChild(flexDiv); + + resultsWrapper.appendChild(article); }); - resultsWrapper.innerHTML = modulesHTML; } const paginate = (items, perPage, page) => items.slice((page - 1) * perPage, page * perPage); @@ -324,5 +397,5 @@ const initPaginationHtml = () => { sortBy.querySelector('span > div').innerText = sort.capitalize().replace('-', ' '); } - perPageDropdown.querySelector('span > div').innerHTML = pagination.perPage; + perPageDropdown.querySelector('span > div').textContent = pagination.perPage; } diff --git a/themes/cfbs-theme/layouts/partials/list.html b/themes/cfbs-theme/layouts/partials/list.html index 03b413b..13bfb6e 100644 --- a/themes/cfbs-theme/layouts/partials/list.html +++ b/themes/cfbs-theme/layouts/partials/list.html @@ -26,7 +26,7 @@

    Applied tags

    - Clear all + Clear all
    @@ -56,12 +56,12 @@

    Applied tags

    Tags

    - +
    Modules that are supported and tested by CFEngine.
      diff --git a/themes/cfbs-theme/layouts/partials/nav.html b/themes/cfbs-theme/layouts/partials/nav.html index f0a7b93..a16c87e 100644 --- a/themes/cfbs-theme/layouts/partials/nav.html +++ b/themes/cfbs-theme/layouts/partials/nav.html @@ -13,7 +13,7 @@ -
      - - +
      + +
      diff --git a/themes/cfbs-theme/layouts/partials/publishModule.html b/themes/cfbs-theme/layouts/partials/publishModule.html index 9830b0e..9a38919 100644 --- a/themes/cfbs-theme/layouts/partials/publishModule.html +++ b/themes/cfbs-theme/layouts/partials/publishModule.html @@ -2,14 +2,15 @@
    + diff --git a/themes/cfbs-theme/styles/less/header.less b/themes/cfbs-theme/styles/less/header.less index 9fbfcc0..547d833 100644 --- a/themes/cfbs-theme/styles/less/header.less +++ b/themes/cfbs-theme/styles/less/header.less @@ -125,15 +125,16 @@ header { svg { vertical-align: middle; } - - > ul > li > a { - &:hover { - color: @orange; - } - @media @tablet-down { - &:focus { + @media (hover: hover){ + > ul > li > a { + &:hover { color: @orange; } + @media @tablet-down { + &:focus { + color: @orange; + } + } } } @@ -251,8 +252,7 @@ header { font-weight: bold; font-size: 1.6rem; line-height: 2rem; - padding-left: 2.5rem; - margin: 1.6rem 0; + padding: 1.6rem 0 1.6rem 2.5rem; } } @@ -279,6 +279,8 @@ header { font-size: 14px; line-height: 16px; color: @MainMenuTextColor; + padding: 0 0 0 2.5rem; + margin: 1.6rem 0; } } } @@ -460,38 +462,48 @@ header { margin-left: 1rem; vertical-align: sub; } - - &:hover &-content { - height: auto; - min-width: 16rem; - width: max-content; - overflow: visible; - } - - @media screen and @tablet-down { - &:focus &-content, &:focus-within &-content{ + @media (hover: hover) { + &:hover &-content { height: auto; min-width: 16rem; width: max-content; overflow: visible; } } - - &:hover { - > a { - color: @orange; - } - + &-item-onclick.opened{ + color: @orange; i.bi-chevron-down { transform: rotate(180deg); color: @orange; } + } + &-item-onclick.opened ~ i.bi-chevron-down{ + transform: rotate(180deg); + color: @orange; + } + &-item-onclick.opened ~ &-content { + height: auto; + min-width: 16rem; + width: max-content; + overflow: visible; + } + @media (hover: hover) { + &:hover { + > a { + color: @orange; + } + + i.bi-chevron-down { + transform: rotate(180deg); + color: @orange; + } - div.close { - height: 0; - width: 0; - min-width: 0; - overflow: hidden; + div.close { + height: 0; + width: 0; + min-width: 0; + overflow: hidden; + } } } } \ No newline at end of file diff --git a/themes/cfbs-theme/styles/less/modulePage.less b/themes/cfbs-theme/styles/less/modulePage.less index d0553d1..ea38db7 100644 --- a/themes/cfbs-theme/styles/less/modulePage.less +++ b/themes/cfbs-theme/styles/less/modulePage.less @@ -34,7 +34,7 @@ .module-desc { grid-area: description; } @media @phone-down { - padding-top: 9.2rem; + margin-top: 9.2rem; } .breadcrumbs { diff --git a/themes/cfbs-theme/styles/less/modules.less b/themes/cfbs-theme/styles/less/modules.less index b7e6f0a..e552949 100644 --- a/themes/cfbs-theme/styles/less/modules.less +++ b/themes/cfbs-theme/styles/less/modules.less @@ -14,7 +14,7 @@ } @media @phone-down { - padding-top: 9.2rem; + margin-top: 9.2rem; } @media @phone-down { @@ -73,6 +73,7 @@ a, i { color: @gray-400; text-decoration: none; + cursor: pointer; } a { line-height: 2rem; From 30b57f7d5eafc0b3f22d446a73547fdc31435f58 Mon Sep 17 00:00:00 2001 From: olehermanse <4048546+olehermanse@users.noreply.github.com> Date: Sun, 30 Jun 2024 00:09:40 +0000 Subject: [PATCH 11/27] Upgraded Hugo version to 0.128.0 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d90d979..f4537c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM node:18-alpine AS build ARG GITHUB_USERNAME_TOKEN WORKDIR /build-website -ADD https://github.com/gohugoio/hugo/releases/download/v0.127.0/hugo_0.127.0_Linux-64bit.tar.gz hugo.tar.gz -RUN echo "3cf961de9831c0f2ac0e67eabc83251916ae8729292fa85ffa140e59bcbea8c0 hugo.tar.gz" | sha256sum -c +ADD https://github.com/gohugoio/hugo/releases/download/v0.128.0/hugo_0.128.0_Linux-64bit.tar.gz hugo.tar.gz +RUN echo "4f1817edc84854d40ceea89fd18816e8de8e9a97074a0bd071782540edcc32e6 hugo.tar.gz" | sha256sum -c RUN tar -zxvf hugo.tar.gz COPY package-lock.json package.json ./ RUN npm ci From 3c9e28edc4d345e828ffad31739976e14cd171d8 Mon Sep 17 00:00:00 2001 From: Mikita Pilinka Date: Mon, 1 Jul 2024 13:59:06 +0200 Subject: [PATCH 12/27] fixed CSP related issues and bugs Ticket: SEC-1051 Changelog: None Signed-off-by: Mikita Pilinka --- nginx.conf | 2 +- static/js/cookie-consent.js | 52 +++++++++---------- static/js/modules-list.js | 15 +++--- themes/cfbs-theme/layouts/partials/list.html | 14 ++--- .../layouts/partials/publishModule.html | 1 - themes/cfbs-theme/styles/less/modules.less | 20 +++---- themes/cfbs-theme/styles/less/pagination.less | 4 +- 7 files changed, 56 insertions(+), 52 deletions(-) diff --git a/nginx.conf b/nginx.conf index 5444638..dd607c9 100644 --- a/nginx.conf +++ b/nginx.conf @@ -74,7 +74,7 @@ http { add_header X-Content-Type-Options "nosniff" always; add_header 'Referrer-Policy' 'strict-origin'; # 'sha256-ruKmkK0iwJgE/F4xuzLY3V2OuzVOOJISav7NURhCKsM=' hugo discuss template (https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/disqus.html) - add_header Content-Security-Policy "default-src 'none'; style-src 'self' 'unsafe-inline' cdn.jsdelivr.net; connect-src 'self' *.disqus.com *.disquscdn.com *.google-analytics.com; script-src 'self' 'sha256-ruKmkK0iwJgE/F4xuzLY3V2OuzVOOJISav7NURhCKsM=' *.disqus.com *.disquscdn.com *.googletagmanager.com; object-src 'self'; img-src 'self' data: https:; font-src 'self' https:; frame-src 'self' www.google.com www.youtube.com; manifest-src 'self'; base-uri 'self'; form-action 'self'; frame-ancestors 'self'; upgrade-insecure-requests;"; + add_header Content-Security-Policy "default-src 'none'; style-src 'self' 'unsafe-inline' cdn.jsdelivr.net; connect-src 'self' *.disqus.com *.disquscdn.com *.google-analytics.com; script-src 'self' 'sha256-ruKmkK0iwJgE/F4xuzLY3V2OuzVOOJISav7NURhCKsM=' *.disqus.com *.disquscdn.com *.googletagmanager.com; object-src 'self'; img-src 'self' data: https:; font-src 'self' https:; frame-src 'self' www.google.com www.youtube.com *.disqus.com; manifest-src 'self'; base-uri 'self'; form-action 'self'; frame-ancestors 'self'; upgrade-insecure-requests;"; #add_header Feature-Policy "speaker self;fullscreen self;"; ## Block common exploits diff --git a/static/js/cookie-consent.js b/static/js/cookie-consent.js index 65ddb59..2b82042 100644 --- a/static/js/cookie-consent.js +++ b/static/js/cookie-consent.js @@ -1,42 +1,40 @@ const cookieConsent = (function () { - const - variable = 'cookieconsent_status', - allowedEvent = new CustomEvent('cookieconsent_allowed'), - allowStatus = 'allow', - denyStatus = 'deny', + const variable = 'cookieconsent_status'; + const allowedEvent = new CustomEvent('cookieconsent_allowed'); + const allowStatus = 'allow'; + const denyStatus = 'deny'; - removeModal = () => { - document.querySelector('.cookie-consent').remove(); - }, - - allow = () => { - window.localStorage.setItem(variable, allowStatus); - document.dispatchEvent(allowedEvent); - removeModal(); - }, + const removeModal = () => { + document.querySelector('.cookie-consent').remove(); + }; + const allow = () => { + window.localStorage.setItem(variable, allowStatus); + document.dispatchEvent(allowedEvent); + removeModal(); + }; - deny = () => { - window.localStorage.setItem(variable, denyStatus); - removeModal(); - }, + const deny = () => { + window.localStorage.setItem(variable, denyStatus); + removeModal(); + }; - isAllowed = () => window.localStorage.getItem(variable) === allowStatus, + const isAllowed = () => window.localStorage.getItem(variable) === allowStatus; - isSet = () => window.localStorage.hasOwnProperty(variable), + const isSet = () => window.localStorage.hasOwnProperty(variable); - modalHTML = ` + const modalHTML = ` `; @@ -49,8 +47,8 @@ const cookieConsent = (function () { const wrapper = document.createElement("div"); wrapper.innerHTML = modalHTML; document.body.appendChild(wrapper) - document.getElementById('cookie-decline').addEventListener('click', cookieConsent.deny); - document.getElementById('cookie-allow').addEventListener('click', cookieConsent.allow); + document.getElementById('cookie-decline').addEventListener('click', deny); + document.getElementById('cookie-allow').addEventListener('click', allow); } diff --git a/static/js/modules-list.js b/static/js/modules-list.js index c171933..1de3616 100644 --- a/static/js/modules-list.js +++ b/static/js/modules-list.js @@ -94,17 +94,20 @@ const orderChanged = (e) => { document.querySelectorAll('.sort-by .dropdown-select_options div').forEach(item => item.addEventListener('click', orderChanged)) -const createTagElement = (tag, remove = false)=>{ +const createTagElement = (tag, remove = false) => { const li = document.createElement('li'); const a = document.createElement('a'); - a.textContent = tag; - a.addEventListener('click',()=>remove ? removeTag(tag) : selectTag(tag)); - li.appendChild(a); - if (remove){ + a.href="#"; + a.addEventListener('click', () => remove ? removeTag(tag) : selectTag(tag)); + if (remove) { + li.prepend(tag); const i = document.createElement('i'); i.className = 'bi bi-x'; - li.appendChild(i); + a.appendChild(i); + } else { + a.textContent = tag; } + li.appendChild(a); return li; } diff --git a/themes/cfbs-theme/layouts/partials/list.html b/themes/cfbs-theme/layouts/partials/list.html index 13bfb6e..297d286 100644 --- a/themes/cfbs-theme/layouts/partials/list.html +++ b/themes/cfbs-theme/layouts/partials/list.html @@ -26,7 +26,7 @@

    Applied tags

    - Clear all +
    @@ -56,8 +56,8 @@

    Applied tags

    Tags

    -

    Filter by Tag

    All tags +

    Filter by Tag

    @@ -91,16 +91,16 @@

    Filter by Tag

    All tags
    diff --git a/themes/cfbs-theme/layouts/partials/publishModule.html b/themes/cfbs-theme/layouts/partials/publishModule.html index 9a38919..d43bb48 100644 --- a/themes/cfbs-theme/layouts/partials/publishModule.html +++ b/themes/cfbs-theme/layouts/partials/publishModule.html @@ -13,4 +13,3 @@

    Publish a module

    - diff --git a/themes/cfbs-theme/styles/less/modules.less b/themes/cfbs-theme/styles/less/modules.less index e552949..375d994 100644 --- a/themes/cfbs-theme/styles/less/modules.less +++ b/themes/cfbs-theme/styles/less/modules.less @@ -69,15 +69,9 @@ background: none; color: @gray-600; font-size: 1.2rem; - - a, i { - color: @gray-400; - text-decoration: none; - cursor: pointer; - } - a { + button { + all: unset; line-height: 2rem; - padding: 0 .8rem; display: inline-block; padding: .6rem 1.5rem; &:hover { @@ -85,6 +79,11 @@ border-radius: .4rem; } } + button, i { + color: @gray-400; + text-decoration: none; + cursor: pointer; + } } } @@ -236,7 +235,9 @@ border-bottom: 1px solid @gray-300; } - a { + button { + all: unset; + cursor: pointer; font-size: 1.4rem; line-height: 2rem; font-weight: 500; @@ -313,6 +314,7 @@ a { color: #181929; text-decoration: none; + cursor: pointer; &:hover, &:focus { } diff --git a/themes/cfbs-theme/styles/less/pagination.less b/themes/cfbs-theme/styles/less/pagination.less index 7045287..8f26ce4 100644 --- a/themes/cfbs-theme/styles/less/pagination.less +++ b/themes/cfbs-theme/styles/less/pagination.less @@ -30,7 +30,9 @@ display: inline-block; margin-right: 2.5rem; } - a { + button { + all: unset; + cursor: pointer; color: @textColorDarkBlue; text-decoration: none; font-size: 1.6rem; From dff364b33f92dade081909ef6a67fb0dc6da9768 Mon Sep 17 00:00:00 2001 From: Mikita Pilinka Date: Wed, 3 Jul 2024 10:45:24 +0200 Subject: [PATCH 13/27] added disqus.com frame-src to csp Ticket: SEC-1051 Changelog: None Signed-off-by: Mikita Pilinka --- nginx.conf | 2 +- static/js/modules-list.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index dd607c9..ce5ab5c 100644 --- a/nginx.conf +++ b/nginx.conf @@ -74,7 +74,7 @@ http { add_header X-Content-Type-Options "nosniff" always; add_header 'Referrer-Policy' 'strict-origin'; # 'sha256-ruKmkK0iwJgE/F4xuzLY3V2OuzVOOJISav7NURhCKsM=' hugo discuss template (https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/disqus.html) - add_header Content-Security-Policy "default-src 'none'; style-src 'self' 'unsafe-inline' cdn.jsdelivr.net; connect-src 'self' *.disqus.com *.disquscdn.com *.google-analytics.com; script-src 'self' 'sha256-ruKmkK0iwJgE/F4xuzLY3V2OuzVOOJISav7NURhCKsM=' *.disqus.com *.disquscdn.com *.googletagmanager.com; object-src 'self'; img-src 'self' data: https:; font-src 'self' https:; frame-src 'self' www.google.com www.youtube.com *.disqus.com; manifest-src 'self'; base-uri 'self'; form-action 'self'; frame-ancestors 'self'; upgrade-insecure-requests;"; + add_header Content-Security-Policy "default-src 'none'; style-src 'self' 'unsafe-inline' cdn.jsdelivr.net; connect-src 'self' *.disqus.com *.disquscdn.com *.google-analytics.com; script-src 'self' 'sha256-ruKmkK0iwJgE/F4xuzLY3V2OuzVOOJISav7NURhCKsM=' *.disqus.com *.disquscdn.com *.googletagmanager.com; object-src 'self'; img-src 'self' data: https:; font-src 'self' https:; frame-src 'self' www.google.com www.youtube.com *.disqus.com disqus.com; manifest-src 'self'; base-uri 'self'; form-action 'self'; frame-ancestors 'self'; upgrade-insecure-requests;"; #add_header Feature-Policy "speaker self;fullscreen self;"; ## Block common exploits diff --git a/static/js/modules-list.js b/static/js/modules-list.js index 1de3616..cf505b8 100644 --- a/static/js/modules-list.js +++ b/static/js/modules-list.js @@ -120,7 +120,7 @@ document.addEventListener('TAGS_LOADED', function (e) { appliedTagsElement.style.display = 'block'; searchParts.tags.push(...selectedTags); document.dispatchEvent(new Event('RENDER')) - document.querySelector('.modules-applied-tags ul').append(...selectedTags.map(item => createTagElement(sanitizeString(item, true)))); + document.querySelector('.modules-applied-tags ul').append(...selectedTags.map(item => createTagElement(sanitizeString(item), true))); } else if (appliedTagsElement) { appliedTagsElement.style.display = 'none'; } From bf8ed0d671ff8915db8d4e829d90b0c96a7c0d7d Mon Sep 17 00:00:00 2001 From: olehermanse <4048546+olehermanse@users.noreply.github.com> Date: Sun, 7 Jul 2024 00:09:51 +0000 Subject: [PATCH 14/27] Upgraded Hugo version to 0.128.2 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f4537c5..f965299 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM node:18-alpine AS build ARG GITHUB_USERNAME_TOKEN WORKDIR /build-website -ADD https://github.com/gohugoio/hugo/releases/download/v0.128.0/hugo_0.128.0_Linux-64bit.tar.gz hugo.tar.gz -RUN echo "4f1817edc84854d40ceea89fd18816e8de8e9a97074a0bd071782540edcc32e6 hugo.tar.gz" | sha256sum -c +ADD https://github.com/gohugoio/hugo/releases/download/v0.128.2/hugo_0.128.2_Linux-64bit.tar.gz hugo.tar.gz +RUN echo "69396257858a90423618b9bddd3de649b91a921acf93f9af6ecd67534f2f651e hugo.tar.gz" | sha256sum -c RUN tar -zxvf hugo.tar.gz COPY package-lock.json package.json ./ RUN npm ci From 679d9614df302854a582d563016b26f1d369aec6 Mon Sep 17 00:00:00 2001 From: Mikita Pilinka Date: Wed, 10 Jul 2024 10:56:24 +0200 Subject: [PATCH 15/27] restricted inline-styles to improve CSP policy Ticket: SEC-1051 Changelog: None Signed-off-by: Mikita Pilinka --- config.toml | 4 + content/_index.html | 2 +- nginx.conf | 2 +- static/js/main.js | 18 ++-- static/js/modules-list.js | 12 ++- themes/cfbs-theme/layouts/404.html | 4 +- .../cfbs-theme/layouts/_default/single.html | 2 +- themes/cfbs-theme/layouts/partials/list.html | 4 +- themes/cfbs-theme/styles/cfbs.less | 1 + themes/cfbs-theme/styles/less/base.less | 22 +++++ themes/cfbs-theme/styles/less/syntax.less | 86 +++++++++++++++++++ 11 files changed, 138 insertions(+), 19 deletions(-) create mode 100644 themes/cfbs-theme/styles/less/syntax.less diff --git a/config.toml b/config.toml index 772377d..c770df3 100644 --- a/config.toml +++ b/config.toml @@ -7,6 +7,7 @@ theme = "cfbs-theme" Paginate = 10 enableRobotsTXT = true disqusShortname = 'cfengine-build' +syntaxCSS = true [params.info] homeTitle = "CFEngine Build" # Title for home page @@ -20,3 +21,6 @@ author = "author" [params.sitemap] baseUrl = "https://build.cfengine.com" +[markup] + [markup.highlight] + noClasses = false diff --git a/content/_index.html b/content/_index.html index d6cea6b..79f6c43 100644 --- a/content/_index.html +++ b/content/_index.html @@ -33,7 +33,7 @@

    Welcome to CFEngine Build

    -