Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into gstout52-patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
joepavitt committed Dec 18, 2024
2 parents d249eb7 + eb56058 commit a8cfb3e
Show file tree
Hide file tree
Showing 354 changed files with 8,604 additions and 8,293 deletions.
41 changes: 41 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ module.exports = function(eleventyConfig) {
eleventyConfig.addLayoutAlias('page', 'layouts/page.njk');
eleventyConfig.addLayoutAlias('nohero', 'layouts/nohero.njk');
eleventyConfig.addLayoutAlias('solution', 'layouts/solution.njk');
eleventyConfig.addLayoutAlias('catalog', 'layouts/catalog.njk');
eleventyConfig.addLayoutAlias('redirect', 'layouts/redirect.njk');

// Copy the contents of the `public` folder to the output folder
Expand All @@ -86,6 +87,7 @@ module.exports = function(eleventyConfig) {

// Naive copy of images for backwards compatibility of non short-code image handling (use of <img or in CSS)
eleventyConfig.addPassthroughCopy("src/**/images/**/*");
eleventyConfig.addPassthroughCopy("src/blueprints/**/flow.json");

// Watch content images for the image pipeline
eleventyConfig.addWatchTarget("src/**/*.{svg,webp,png,jpeg,gif}");
Expand Down Expand Up @@ -229,6 +231,15 @@ module.exports = function(eleventyConfig) {
}
});

eleventyConfig.addFilter("truncate", function(text, maxWordCount) {
const split = text.split(" ");
if (split.length <= maxWordCount) {
return text;
}
return text.split(" ").splice(0, maxWordCount).join(" ") + "..."
});


eleventyConfig.addFilter("excerpt", function(str) {
const content = new String(str);
return content.split("\n<!--more-->\n")[0]
Expand Down Expand Up @@ -368,6 +379,20 @@ module.exports = function(eleventyConfig) {
</div>`
});

eleventyConfig.addShortcode("renderCompanyTile", function (company) {
return `<div class="company-tile">
<img class="company-tile-logo" src="${company.img}" />
<label>${company.name}</label>
</div>`
});

eleventyConfig.addShortcode("renderIntegration", function (integration) {
return `<div class="integration-tile">
<img class="integration-tile-icon" src="${integration.img}" />
<label>${integration.name}</label>
</div>`
});

eleventyConfig.addShortcode("year", () => `${new Date().getFullYear()}`);

function loadSVG (file) {
Expand Down Expand Up @@ -603,6 +628,22 @@ module.exports = function(eleventyConfig) {
return nav;
});

eleventyConfig.addCollection("publications", function(collectionApi) {
return collectionApi.getAll().filter(item => {
return item.data.tags && (item.data.tags.includes("whitepaper") || item.data.tags.includes("ebook"));
}).map(item => {
item.data.tags = item.data.tags.map(tag => {
if (tag.toLowerCase() === 'whitepaper') {
return 'Whitepaper';
} else if (tag.toLowerCase() === 'ebook') {
return 'eBook';
}
return tag;
});
return item;
});
});

// Plugins
eleventyConfig.addPlugin(EleventyRenderPlugin)
eleventyConfig.addPlugin(pluginRSS)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: 'FlowFuse/flowfuse'
ref: maintenance
ref: main
path: 'flowfuse'
- name: Generate a token
id: generate_token
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Build the forge
run: npm run build:skip-images
working-directory: 'website'
- uses: untitaker/hyperlink@0.1.32
- uses: untitaker/hyperlink@0.1.43
with:
args: website/_site/ --check-anchors --sources website/src
- name: Test the website
Expand Down
Loading

0 comments on commit a8cfb3e

Please sign in to comment.