SimpleX-Chat/website/.eleventy.js

74 lines
2.1 KiB
JavaScript
Raw Normal View History

migrate website to 11ty site generator (#913) * readme: fix link * add 11ty files to website folder * add web.yml * add simplex web files * add font matter to some blogs * remove unnecessary things * change few settings * add a web script * update web.yml * update image format & add an image * add font matter to blogs * update blog.html * add article layout & give that layout to blogs * update the location of _includes * update article layout * change original blog links * add styling to blog * improve the links of blogs * update web.sh * add favicon * update a tag in a blog * improve stylings of article page * improve styling of blog page * update the theme * update font matter and update links in new blog. * add style changes * apply reverse chronology sort on articles * shift blogs links back to hashes * add ids to headers & smooth scrolling * make all blog links relative * add smooth scrolling & add relative to absolute links converter * add navigation * improve mobile nav * change desktop header style * convert blogs link text to "Read More" * change desktop header style * style mobile nav * fix landing page styling * update web workflow * update web workflow * nav setting * add tailwind links * update web workflow * remove app demo folder * remove special characters from the links * fix the issue of links * make web.sh executable * update blog links * move web.sh to website folder * code style * EOLs * format index.css & contact.css * add markdown-it configuration * add outline none on focus * remove extra Javascript * make mobile nav display none by default * add permalinks to markdown files * update 11ty config * update web.sh * update article * resolve issue of special characters in header ids introduce slugify * add target _blank to whitepaper link * add last post * EOLs * try to resolve bullets issue * use markdown-it-replace-link to convert relative .md extension to .html extension * add missing images, simpligy link parsing * add CNAME file * add CNAME file, rename config * fix jumping table issue Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2022-09-10 14:26:21 +05:00
const markdownIt = require("markdown-it")
const markdownItAnchor = require("markdown-it-anchor")
const markdownItReplaceLink = require('markdown-it-replace-link')
const slugify = require("slugify")
const uri = require('fast-uri')
2022-11-12 12:04:23 +00:00
const globalConfig = {
2022-11-12 12:08:37 +00:00
onionLocation: "http://isdb4l77sjqoy2qq7ipum6x3at6hyn3jmxfx4zdhc72ufbmuq4ilwkqd.onion",
2022-11-12 12:04:23 +00:00
siteLocation: "https://simplex.chat"
}
migrate website to 11ty site generator (#913) * readme: fix link * add 11ty files to website folder * add web.yml * add simplex web files * add font matter to some blogs * remove unnecessary things * change few settings * add a web script * update web.yml * update image format & add an image * add font matter to blogs * update blog.html * add article layout & give that layout to blogs * update the location of _includes * update article layout * change original blog links * add styling to blog * improve the links of blogs * update web.sh * add favicon * update a tag in a blog * improve stylings of article page * improve styling of blog page * update the theme * update font matter and update links in new blog. * add style changes * apply reverse chronology sort on articles * shift blogs links back to hashes * add ids to headers & smooth scrolling * make all blog links relative * add smooth scrolling & add relative to absolute links converter * add navigation * improve mobile nav * change desktop header style * convert blogs link text to "Read More" * change desktop header style * style mobile nav * fix landing page styling * update web workflow * update web workflow * nav setting * add tailwind links * update web workflow * remove app demo folder * remove special characters from the links * fix the issue of links * make web.sh executable * update blog links * move web.sh to website folder * code style * EOLs * format index.css & contact.css * add markdown-it configuration * add outline none on focus * remove extra Javascript * make mobile nav display none by default * add permalinks to markdown files * update 11ty config * update web.sh * update article * resolve issue of special characters in header ids introduce slugify * add target _blank to whitepaper link * add last post * EOLs * try to resolve bullets issue * use markdown-it-replace-link to convert relative .md extension to .html extension * add missing images, simpligy link parsing * add CNAME file * add CNAME file, rename config * fix jumping table issue Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2022-09-10 14:26:21 +05:00
module.exports = function (ty) {
2022-11-12 12:04:23 +00:00
ty.addShortcode("cfg", (name) => globalConfig[name])
migrate website to 11ty site generator (#913) * readme: fix link * add 11ty files to website folder * add web.yml * add simplex web files * add font matter to some blogs * remove unnecessary things * change few settings * add a web script * update web.yml * update image format & add an image * add font matter to blogs * update blog.html * add article layout & give that layout to blogs * update the location of _includes * update article layout * change original blog links * add styling to blog * improve the links of blogs * update web.sh * add favicon * update a tag in a blog * improve stylings of article page * improve styling of blog page * update the theme * update font matter and update links in new blog. * add style changes * apply reverse chronology sort on articles * shift blogs links back to hashes * add ids to headers & smooth scrolling * make all blog links relative * add smooth scrolling & add relative to absolute links converter * add navigation * improve mobile nav * change desktop header style * convert blogs link text to "Read More" * change desktop header style * style mobile nav * fix landing page styling * update web workflow * update web workflow * nav setting * add tailwind links * update web workflow * remove app demo folder * remove special characters from the links * fix the issue of links * make web.sh executable * update blog links * move web.sh to website folder * code style * EOLs * format index.css & contact.css * add markdown-it configuration * add outline none on focus * remove extra Javascript * make mobile nav display none by default * add permalinks to markdown files * update 11ty config * update web.sh * update article * resolve issue of special characters in header ids introduce slugify * add target _blank to whitepaper link * add last post * EOLs * try to resolve bullets issue * use markdown-it-replace-link to convert relative .md extension to .html extension * add missing images, simpligy link parsing * add CNAME file * add CNAME file, rename config * fix jumping table issue Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2022-09-10 14:26:21 +05:00
// Keeps the same directory structure.
ty.addPassthroughCopy("src/assets/")
new website (#1307) * nav in process * edited web.yml * navbar issue fixed * added theme switcher * added privacy matters section * added features section * updated nav padding * added network section * improved sidebar dark mode colors * added footer * simplex private section added * added some improvements * nav issue fixed * simplex unique section added * a small fix * added overlay & data to some sections * added overlay to simplex unique section added some improvements to other sections too * added a small fix * updated CNAME * markdown files for why simplex is unique * Revert "markdown files for why simplex is unique" This reverts commit ef728218f758c3d0b05b6ec794e257f80110e788. * added hero section * added comparison and simplex explained section * added blogs page * added articles page * a small fix in hero section * added contact page * updated contact * created files for overlay content * a light update * hero animation * working on hero * added responsiveness for mobile * a quick fix * added responsiveness to tablet screen * added responsiveness for desktop screen on hero section * switch theme of hero * nav color update * set comparisons sections * switch theme of comparisons section * added responsiveness in simplex explained section * add logic to simplex explained * added theme switcher to simplex explained * manage join simplex section * update what makes simplex private * a quick update * add improvements * a bit update * add improvements * texts for why privacy matters section * update headers * texts for "why unique" and "features" sections * EOLs * update swipers * update & add transitions to simplex unique section * updated overlays * increase the size of cross on overlays * add overlays to hero * website: texts for "private" and "explained" sections (#5) * website: texts for "private" section * texts for simplex explained * blog previews and images (#6) * blog previews and images * text for dark mode * add link style * add overlay to -> unlike p2p networks * add picture with blue arrows to simplex explained * update blog list layout * remove extra css * bigger navigation circles & center positions * make bullets (dots) bigger * make private scroll thicker * update hero & footer mobile download btns * fix dark mode animation files (#7) * improved contrast for light animation in hero section (#8) * remove old animation * Made Hero Pixel Perfect to Desktop * texts in hero section overlays (#10) * texts in hero section overlays * replace hero video * eol * update footer links (#11) * update footer links * eol * texts, links, fix layout (#12) * mailchimp form (#13) * site meta tags (#14) * site meta tags * update blog og:url * amend texts * font * update text * contact page * Making things Polished in Hero (#15) * Made Video Responsive on Tablet * Fixed the issues * remove extra files for home & contact page * update invitation * refactoring * fix nav for dark * quick fix * update blog list layout * refactoring * disable inactive nav circles * contact page * fix mobile * detect platform & show btns according to it * contact & invitation page setting * complete contact/invitation page * create variables for download btns * fixes for hero - for tablet & mobile * update hero layout * update footer layout * increase the size of logo in navbar * updated nav & footer logos * add links to join simplex section * text for p2p networks section * text on contact page about link * add touchstart handler to close popup * update APK links * update CNAME Co-authored-by: M Sarmad Qadeer <MSarmadQadeer@gmail.com> Co-authored-by: Ojas Shukla <54703305+whizzbbig@users.noreply.github.com>
2022-11-08 11:04:02 +00:00
ty.addPassthroughCopy("src/fonts")
migrate website to 11ty site generator (#913) * readme: fix link * add 11ty files to website folder * add web.yml * add simplex web files * add font matter to some blogs * remove unnecessary things * change few settings * add a web script * update web.yml * update image format & add an image * add font matter to blogs * update blog.html * add article layout & give that layout to blogs * update the location of _includes * update article layout * change original blog links * add styling to blog * improve the links of blogs * update web.sh * add favicon * update a tag in a blog * improve stylings of article page * improve styling of blog page * update the theme * update font matter and update links in new blog. * add style changes * apply reverse chronology sort on articles * shift blogs links back to hashes * add ids to headers & smooth scrolling * make all blog links relative * add smooth scrolling & add relative to absolute links converter * add navigation * improve mobile nav * change desktop header style * convert blogs link text to "Read More" * change desktop header style * style mobile nav * fix landing page styling * update web workflow * update web workflow * nav setting * add tailwind links * update web workflow * remove app demo folder * remove special characters from the links * fix the issue of links * make web.sh executable * update blog links * move web.sh to website folder * code style * EOLs * format index.css & contact.css * add markdown-it configuration * add outline none on focus * remove extra Javascript * make mobile nav display none by default * add permalinks to markdown files * update 11ty config * update web.sh * update article * resolve issue of special characters in header ids introduce slugify * add target _blank to whitepaper link * add last post * EOLs * try to resolve bullets issue * use markdown-it-replace-link to convert relative .md extension to .html extension * add missing images, simpligy link parsing * add CNAME file * add CNAME file, rename config * fix jumping table issue Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2022-09-10 14:26:21 +05:00
ty.addPassthroughCopy("src/img")
new website (#1307) * nav in process * edited web.yml * navbar issue fixed * added theme switcher * added privacy matters section * added features section * updated nav padding * added network section * improved sidebar dark mode colors * added footer * simplex private section added * added some improvements * nav issue fixed * simplex unique section added * a small fix * added overlay & data to some sections * added overlay to simplex unique section added some improvements to other sections too * added a small fix * updated CNAME * markdown files for why simplex is unique * Revert "markdown files for why simplex is unique" This reverts commit ef728218f758c3d0b05b6ec794e257f80110e788. * added hero section * added comparison and simplex explained section * added blogs page * added articles page * a small fix in hero section * added contact page * updated contact * created files for overlay content * a light update * hero animation * working on hero * added responsiveness for mobile * a quick fix * added responsiveness to tablet screen * added responsiveness for desktop screen on hero section * switch theme of hero * nav color update * set comparisons sections * switch theme of comparisons section * added responsiveness in simplex explained section * add logic to simplex explained * added theme switcher to simplex explained * manage join simplex section * update what makes simplex private * a quick update * add improvements * a bit update * add improvements * texts for why privacy matters section * update headers * texts for "why unique" and "features" sections * EOLs * update swipers * update & add transitions to simplex unique section * updated overlays * increase the size of cross on overlays * add overlays to hero * website: texts for "private" and "explained" sections (#5) * website: texts for "private" section * texts for simplex explained * blog previews and images (#6) * blog previews and images * text for dark mode * add link style * add overlay to -> unlike p2p networks * add picture with blue arrows to simplex explained * update blog list layout * remove extra css * bigger navigation circles & center positions * make bullets (dots) bigger * make private scroll thicker * update hero & footer mobile download btns * fix dark mode animation files (#7) * improved contrast for light animation in hero section (#8) * remove old animation * Made Hero Pixel Perfect to Desktop * texts in hero section overlays (#10) * texts in hero section overlays * replace hero video * eol * update footer links (#11) * update footer links * eol * texts, links, fix layout (#12) * mailchimp form (#13) * site meta tags (#14) * site meta tags * update blog og:url * amend texts * font * update text * contact page * Making things Polished in Hero (#15) * Made Video Responsive on Tablet * Fixed the issues * remove extra files for home & contact page * update invitation * refactoring * fix nav for dark * quick fix * update blog list layout * refactoring * disable inactive nav circles * contact page * fix mobile * detect platform & show btns according to it * contact & invitation page setting * complete contact/invitation page * create variables for download btns * fixes for hero - for tablet & mobile * update hero layout * update footer layout * increase the size of logo in navbar * updated nav & footer logos * add links to join simplex section * text for p2p networks section * text on contact page about link * add touchstart handler to close popup * update APK links * update CNAME Co-authored-by: M Sarmad Qadeer <MSarmadQadeer@gmail.com> Co-authored-by: Ojas Shukla <54703305+whizzbbig@users.noreply.github.com>
2022-11-08 11:04:02 +00:00
ty.addPassthroughCopy("src/video")
migrate website to 11ty site generator (#913) * readme: fix link * add 11ty files to website folder * add web.yml * add simplex web files * add font matter to some blogs * remove unnecessary things * change few settings * add a web script * update web.yml * update image format & add an image * add font matter to blogs * update blog.html * add article layout & give that layout to blogs * update the location of _includes * update article layout * change original blog links * add styling to blog * improve the links of blogs * update web.sh * add favicon * update a tag in a blog * improve stylings of article page * improve styling of blog page * update the theme * update font matter and update links in new blog. * add style changes * apply reverse chronology sort on articles * shift blogs links back to hashes * add ids to headers & smooth scrolling * make all blog links relative * add smooth scrolling & add relative to absolute links converter * add navigation * improve mobile nav * change desktop header style * convert blogs link text to "Read More" * change desktop header style * style mobile nav * fix landing page styling * update web workflow * update web workflow * nav setting * add tailwind links * update web workflow * remove app demo folder * remove special characters from the links * fix the issue of links * make web.sh executable * update blog links * move web.sh to website folder * code style * EOLs * format index.css & contact.css * add markdown-it configuration * add outline none on focus * remove extra Javascript * make mobile nav display none by default * add permalinks to markdown files * update 11ty config * update web.sh * update article * resolve issue of special characters in header ids introduce slugify * add target _blank to whitepaper link * add last post * EOLs * try to resolve bullets issue * use markdown-it-replace-link to convert relative .md extension to .html extension * add missing images, simpligy link parsing * add CNAME file * add CNAME file, rename config * fix jumping table issue Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2022-09-10 14:26:21 +05:00
ty.addPassthroughCopy("src/css")
ty.addPassthroughCopy("src/js")
2022-10-12 17:16:10 +01:00
ty.addPassthroughCopy("src/contact/*.js")
2022-09-25 11:16:28 +01:00
ty.addPassthroughCopy("src/call")
ty.addPassthroughCopy("src/hero-phone")
ty.addPassthroughCopy("src/hero-phone-dark")
migrate website to 11ty site generator (#913) * readme: fix link * add 11ty files to website folder * add web.yml * add simplex web files * add font matter to some blogs * remove unnecessary things * change few settings * add a web script * update web.yml * update image format & add an image * add font matter to blogs * update blog.html * add article layout & give that layout to blogs * update the location of _includes * update article layout * change original blog links * add styling to blog * improve the links of blogs * update web.sh * add favicon * update a tag in a blog * improve stylings of article page * improve styling of blog page * update the theme * update font matter and update links in new blog. * add style changes * apply reverse chronology sort on articles * shift blogs links back to hashes * add ids to headers & smooth scrolling * make all blog links relative * add smooth scrolling & add relative to absolute links converter * add navigation * improve mobile nav * change desktop header style * convert blogs link text to "Read More" * change desktop header style * style mobile nav * fix landing page styling * update web workflow * update web workflow * nav setting * add tailwind links * update web workflow * remove app demo folder * remove special characters from the links * fix the issue of links * make web.sh executable * update blog links * move web.sh to website folder * code style * EOLs * format index.css & contact.css * add markdown-it configuration * add outline none on focus * remove extra Javascript * make mobile nav display none by default * add permalinks to markdown files * update 11ty config * update web.sh * update article * resolve issue of special characters in header ids introduce slugify * add target _blank to whitepaper link * add last post * EOLs * try to resolve bullets issue * use markdown-it-replace-link to convert relative .md extension to .html extension * add missing images, simpligy link parsing * add CNAME file * add CNAME file, rename config * fix jumping table issue Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2022-09-10 14:26:21 +05:00
ty.addPassthroughCopy("src/blog/images")
ty.addPassthroughCopy("src/images")
ty.addPassthroughCopy("src/CNAME")
ty.addPassthroughCopy("src/.well-known")
migrate website to 11ty site generator (#913) * readme: fix link * add 11ty files to website folder * add web.yml * add simplex web files * add font matter to some blogs * remove unnecessary things * change few settings * add a web script * update web.yml * update image format & add an image * add font matter to blogs * update blog.html * add article layout & give that layout to blogs * update the location of _includes * update article layout * change original blog links * add styling to blog * improve the links of blogs * update web.sh * add favicon * update a tag in a blog * improve stylings of article page * improve styling of blog page * update the theme * update font matter and update links in new blog. * add style changes * apply reverse chronology sort on articles * shift blogs links back to hashes * add ids to headers & smooth scrolling * make all blog links relative * add smooth scrolling & add relative to absolute links converter * add navigation * improve mobile nav * change desktop header style * convert blogs link text to "Read More" * change desktop header style * style mobile nav * fix landing page styling * update web workflow * update web workflow * nav setting * add tailwind links * update web workflow * remove app demo folder * remove special characters from the links * fix the issue of links * make web.sh executable * update blog links * move web.sh to website folder * code style * EOLs * format index.css & contact.css * add markdown-it configuration * add outline none on focus * remove extra Javascript * make mobile nav display none by default * add permalinks to markdown files * update 11ty config * update web.sh * update article * resolve issue of special characters in header ids introduce slugify * add target _blank to whitepaper link * add last post * EOLs * try to resolve bullets issue * use markdown-it-replace-link to convert relative .md extension to .html extension * add missing images, simpligy link parsing * add CNAME file * add CNAME file, rename config * fix jumping table issue Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2022-09-10 14:26:21 +05:00
ty.addCollection('blogs', function (collection) {
return collection.getFilteredByGlob('src/blog/*.md').reverse()
})
ty.addWatchTarget("src/css")
ty.addWatchTarget("markdown/")
ty.addWatchTarget("components/Card.js")
const markdownLib = markdownIt({
html: true,
breaks: true,
linkify: true,
replaceLink: function (link, _env) {
let parsed = uri.parse(link)
if (parsed.scheme || parsed.host || !parsed.path.endsWith(".md")) {
return link
}
parsed.path = parsed.path.replace(/\.md$/, ".html")
return uri.serialize(parsed)
}
}).use(markdownItAnchor, {
slugify: (str) =>
slugify(str, {
lower: true,
strict: true,
})
}).use(markdownItReplaceLink)
// replace the default markdown-it instance
ty.setLibrary("md", markdownLib)
return {
dir: {
input: 'src',
includes: '_includes',
output: '_site',
},
templateFormats: ['md', 'njk', 'html'],
markdownTemplateEngine: 'njk',
htmlTemplateEngine: 'njk',
dataTemplateEngine: 'njk',
}
}