simplex-chat/website/.eleventy.js

446 lines
16 KiB
JavaScript
Raw Permalink 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')
const i18n = require('eleventy-plugin-i18n')
const fs = require("fs")
const path = require("path")
const matter = require('gray-matter')
const pluginRss = require('@11ty/eleventy-plugin-rss')
const { JSDOM } = require('jsdom')
// The implementation of Glossary feature
const md = new markdownIt()
const glossaryMarkdownContent = fs.readFileSync(path.resolve(__dirname, '../docs/GLOSSARY.md'), 'utf8')
const glossaryHtmlContent = md.render(glossaryMarkdownContent)
const glossaryDOM = new JSDOM(glossaryHtmlContent)
const glossaryDocument = glossaryDOM.window.document
const glossary = require('./src/_data/glossary.json')
glossary.forEach(item => {
const headers = Array.from(glossaryDocument.querySelectorAll("h2"))
const matchingHeader = headers.find(header => header.textContent.trim() === item.definition)
if (matchingHeader) {
let sibling = matchingHeader.nextElementSibling
let definition = ''
let firstParagraph = ''
let paragraphCount = 0
while (sibling && sibling.tagName !== 'H2') {
if (sibling.tagName === 'P') {
paragraphCount += 1
if (firstParagraph === '') {
firstParagraph = sibling.innerHTML
}
}
definition += sibling.outerHTML || sibling.textContent
sibling = sibling.nextElementSibling
}
item.definition = definition
item.tooltip = firstParagraph
item.hasMultipleParagraphs = paragraphCount > 1
}
})
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
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"
}
website internationalization (#1922) * website Internationalization (#1904) * added devcontainer config * internationalization under dev * internationalization of _data done * overlays internationalization done * improved routing * updated gitignore * remove .devcontainer * internationalization in progess deleted all the intermediate files added translation of few sections * remaining website strings are added to translation * done internationalization - fully converted to i18n plugin - wrote bash script for creating a combined translations.json * internationalization UI done * a quick fix * remove jq installation * Added translation using Weblate (German) * Translated using Weblate (French) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/ * Translated using Weblate (German) Currently translated at 42.9% (91 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * fixes of web Internationalization (#1925) * a quick fix * blog route for all languages is shifted to root blog route * wrote merge_translations.js * remove language label from dropdown * update language names * refactor scripts * remove catch from script * Added translation using Weblate (Dutch) * Added translation using Weblate (Norwegian Bokmål) * Translated using Weblate (Dutch) Currently translated at 33.0% (70 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/nl/ * website: internationalization fixes (#1931) * added devcontainer config * internationalization under dev * internationalization of _data done * overlays internationalization done * improved routing * updated gitignore * remove .devcontainer * internationalization in progess deleted all the intermediate files added translation of few sections * remaining website strings are added to translation * done internationalization - fully converted to i18n plugin - wrote bash script for creating a combined translations.json * internationalization UI done * a quick fix * blog route for all languages is shifted to root blog route * wrote merge_translations.js * remove flag from blog * updated nav stylings & logo links * add enabled key * updated nav dropdown styling * gave specific lang to i18n plugin. overlay translations are now working. * enable nl & nb_NO * updated nav stylings * updated contact.js --------- Co-authored-by: M Sarmad Qadeer <msarmadqadeer@gmail.com> * Translated using Weblate (German) Currently translated at 47.6% (101 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * fixed internationalization issues * updated strings, refactor contact.js * updated nav stylings for mobile * a bit smaller padding on mobile * Added translation using Weblate (Czech) * Translated using Weblate (Czech) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/cs/ * Translated using Weblate (French) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/ * Translated using Weblate (German) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * enabled languages * check/correct (#1949) --------- Co-authored-by: M Sarmad Qadeer <MSarmadQadeer@gmail.com> Co-authored-by: Ophiushi <Ophiushi@users.noreply.hosted.weblate.org> Co-authored-by: mlanp <github@lang.xyz> Co-authored-by: John m <jvanmanen@gmail.com> Co-authored-by: zenobit <zen@osowoso.xyz> Co-authored-by: Ophiushi <41908476+ishi-sama@users.noreply.github.com>
2023-02-24 21:03:57 +00:00
const translationsDirectoryPath = './langs'
const supportedRoutes = ["blog", "contact", "invitation", "docs", "fdroid", ""]
website internationalization (#1922) * website Internationalization (#1904) * added devcontainer config * internationalization under dev * internationalization of _data done * overlays internationalization done * improved routing * updated gitignore * remove .devcontainer * internationalization in progess deleted all the intermediate files added translation of few sections * remaining website strings are added to translation * done internationalization - fully converted to i18n plugin - wrote bash script for creating a combined translations.json * internationalization UI done * a quick fix * remove jq installation * Added translation using Weblate (German) * Translated using Weblate (French) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/ * Translated using Weblate (German) Currently translated at 42.9% (91 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * fixes of web Internationalization (#1925) * a quick fix * blog route for all languages is shifted to root blog route * wrote merge_translations.js * remove language label from dropdown * update language names * refactor scripts * remove catch from script * Added translation using Weblate (Dutch) * Added translation using Weblate (Norwegian Bokmål) * Translated using Weblate (Dutch) Currently translated at 33.0% (70 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/nl/ * website: internationalization fixes (#1931) * added devcontainer config * internationalization under dev * internationalization of _data done * overlays internationalization done * improved routing * updated gitignore * remove .devcontainer * internationalization in progess deleted all the intermediate files added translation of few sections * remaining website strings are added to translation * done internationalization - fully converted to i18n plugin - wrote bash script for creating a combined translations.json * internationalization UI done * a quick fix * blog route for all languages is shifted to root blog route * wrote merge_translations.js * remove flag from blog * updated nav stylings & logo links * add enabled key * updated nav dropdown styling * gave specific lang to i18n plugin. overlay translations are now working. * enable nl & nb_NO * updated nav stylings * updated contact.js --------- Co-authored-by: M Sarmad Qadeer <msarmadqadeer@gmail.com> * Translated using Weblate (German) Currently translated at 47.6% (101 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * fixed internationalization issues * updated strings, refactor contact.js * updated nav stylings for mobile * a bit smaller padding on mobile * Added translation using Weblate (Czech) * Translated using Weblate (Czech) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/cs/ * Translated using Weblate (French) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/ * Translated using Weblate (German) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * enabled languages * check/correct (#1949) --------- Co-authored-by: M Sarmad Qadeer <MSarmadQadeer@gmail.com> Co-authored-by: Ophiushi <Ophiushi@users.noreply.hosted.weblate.org> Co-authored-by: mlanp <github@lang.xyz> Co-authored-by: John m <jvanmanen@gmail.com> Co-authored-by: zenobit <zen@osowoso.xyz> Co-authored-by: Ophiushi <41908476+ishi-sama@users.noreply.github.com>
2023-02-24 21:03:57 +00:00
let supportedLangs = []
fs.readdir(translationsDirectoryPath, (err, files) => {
if (err) {
console.error('Could not list the directory.', err)
process.exit(1)
}
const jsonFileNames = files.filter(file => {
return file.endsWith('.json') && fs.statSync(translationsDirectoryPath + '/' + file).isFile()
})
supportedLangs = jsonFileNames.map(file => file.replace('.json', ''))
website: add docs to website (#2080) * website: add fontmatter & improve image URLs where necessary * website: add docs to website * website: add prismjs for code highlighting * website: change npm install position in web.sh * website: fix an image URL in lang/cs/README.md * website: improve image paths in lang/cs/translations.md * website: add responsiveness & improve stylings of docs * website: add dir to navbar in blog & docs * website: remove scroll in mobile dropdown menu * website: remove rfcs & add guide docs to website * website: remove file renaming script from web.sh * website: add menu to docs in nav * website: add hash list & add scroll to headers * website: customize docs frontmatter through JS * website: remove supported_languages.json * website: move merge_translations.js to JS folder * website: add the following changes to docs - add frontmatter to new doc merged from master - add ignoreForWeb property to frontmatter of README.md docs * website: remove package-lock.json from .gitignore * website: add package-lock.json from .gitignore * website: add no docs message to docs dropdown * website: improve the sidebar of docs * website: add revision date to docs * website: add script to add version to docs frontmatter * website: add layout to display message in docs if its version is old * website: improve nav responsiveness * website: remove frontmatter form main README & rfcs * website: remove rfcs from website folder * website: add ignore condition for rfcs in .eleventy * website: remove frontmatter from lang README docs * website: remove README from website's lang docs * website: add guides menu in nav * website: following changes - add docs_dropdown.json - extend reference menu in nav - remove docs menu from nav * website: fix in docs sidebar * website: revert main docs README.md files * website: revert main docs README.md files * website: move scripts out of js that are for build * website: remove displayAt form guide docs * website: create a docs_sidebar.json & shift to that approach * update navigation * website: set navbar * website: add icons to external links * website: change the approach for docs sidebar creation * website: update docs template * website: add some strings to en.json and map them accordingly * remove icon --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2023-05-01 02:31:23 +05:00
})
website internationalization (#1922) * website Internationalization (#1904) * added devcontainer config * internationalization under dev * internationalization of _data done * overlays internationalization done * improved routing * updated gitignore * remove .devcontainer * internationalization in progess deleted all the intermediate files added translation of few sections * remaining website strings are added to translation * done internationalization - fully converted to i18n plugin - wrote bash script for creating a combined translations.json * internationalization UI done * a quick fix * remove jq installation * Added translation using Weblate (German) * Translated using Weblate (French) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/ * Translated using Weblate (German) Currently translated at 42.9% (91 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * fixes of web Internationalization (#1925) * a quick fix * blog route for all languages is shifted to root blog route * wrote merge_translations.js * remove language label from dropdown * update language names * refactor scripts * remove catch from script * Added translation using Weblate (Dutch) * Added translation using Weblate (Norwegian Bokmål) * Translated using Weblate (Dutch) Currently translated at 33.0% (70 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/nl/ * website: internationalization fixes (#1931) * added devcontainer config * internationalization under dev * internationalization of _data done * overlays internationalization done * improved routing * updated gitignore * remove .devcontainer * internationalization in progess deleted all the intermediate files added translation of few sections * remaining website strings are added to translation * done internationalization - fully converted to i18n plugin - wrote bash script for creating a combined translations.json * internationalization UI done * a quick fix * blog route for all languages is shifted to root blog route * wrote merge_translations.js * remove flag from blog * updated nav stylings & logo links * add enabled key * updated nav dropdown styling * gave specific lang to i18n plugin. overlay translations are now working. * enable nl & nb_NO * updated nav stylings * updated contact.js --------- Co-authored-by: M Sarmad Qadeer <msarmadqadeer@gmail.com> * Translated using Weblate (German) Currently translated at 47.6% (101 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * fixed internationalization issues * updated strings, refactor contact.js * updated nav stylings for mobile * a bit smaller padding on mobile * Added translation using Weblate (Czech) * Translated using Weblate (Czech) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/cs/ * Translated using Weblate (French) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/ * Translated using Weblate (German) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * enabled languages * check/correct (#1949) --------- Co-authored-by: M Sarmad Qadeer <MSarmadQadeer@gmail.com> Co-authored-by: Ophiushi <Ophiushi@users.noreply.hosted.weblate.org> Co-authored-by: mlanp <github@lang.xyz> Co-authored-by: John m <jvanmanen@gmail.com> Co-authored-by: zenobit <zen@osowoso.xyz> Co-authored-by: Ophiushi <41908476+ishi-sama@users.noreply.github.com>
2023-02-24 21:03:57 +00:00
const translations = require("./translations.json")
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])
ty.addFilter("getlang", (path) => {
website internationalization (#1922) * website Internationalization (#1904) * added devcontainer config * internationalization under dev * internationalization of _data done * overlays internationalization done * improved routing * updated gitignore * remove .devcontainer * internationalization in progess deleted all the intermediate files added translation of few sections * remaining website strings are added to translation * done internationalization - fully converted to i18n plugin - wrote bash script for creating a combined translations.json * internationalization UI done * a quick fix * remove jq installation * Added translation using Weblate (German) * Translated using Weblate (French) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/ * Translated using Weblate (German) Currently translated at 42.9% (91 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * fixes of web Internationalization (#1925) * a quick fix * blog route for all languages is shifted to root blog route * wrote merge_translations.js * remove language label from dropdown * update language names * refactor scripts * remove catch from script * Added translation using Weblate (Dutch) * Added translation using Weblate (Norwegian Bokmål) * Translated using Weblate (Dutch) Currently translated at 33.0% (70 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/nl/ * website: internationalization fixes (#1931) * added devcontainer config * internationalization under dev * internationalization of _data done * overlays internationalization done * improved routing * updated gitignore * remove .devcontainer * internationalization in progess deleted all the intermediate files added translation of few sections * remaining website strings are added to translation * done internationalization - fully converted to i18n plugin - wrote bash script for creating a combined translations.json * internationalization UI done * a quick fix * blog route for all languages is shifted to root blog route * wrote merge_translations.js * remove flag from blog * updated nav stylings & logo links * add enabled key * updated nav dropdown styling * gave specific lang to i18n plugin. overlay translations are now working. * enable nl & nb_NO * updated nav stylings * updated contact.js --------- Co-authored-by: M Sarmad Qadeer <msarmadqadeer@gmail.com> * Translated using Weblate (German) Currently translated at 47.6% (101 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * fixed internationalization issues * updated strings, refactor contact.js * updated nav stylings for mobile * a bit smaller padding on mobile * Added translation using Weblate (Czech) * Translated using Weblate (Czech) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/cs/ * Translated using Weblate (French) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/ * Translated using Weblate (German) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * enabled languages * check/correct (#1949) --------- Co-authored-by: M Sarmad Qadeer <MSarmadQadeer@gmail.com> Co-authored-by: Ophiushi <Ophiushi@users.noreply.hosted.weblate.org> Co-authored-by: mlanp <github@lang.xyz> Co-authored-by: John m <jvanmanen@gmail.com> Co-authored-by: zenobit <zen@osowoso.xyz> Co-authored-by: Ophiushi <41908476+ishi-sama@users.noreply.github.com>
2023-02-24 21:03:57 +00:00
const lang = path.split("/")[1]
if (supportedRoutes.includes(lang)) return "en"
else if (supportedLangs.includes(lang)) return lang
return "en"
})
website: add docs to website (#2080) * website: add fontmatter & improve image URLs where necessary * website: add docs to website * website: add prismjs for code highlighting * website: change npm install position in web.sh * website: fix an image URL in lang/cs/README.md * website: improve image paths in lang/cs/translations.md * website: add responsiveness & improve stylings of docs * website: add dir to navbar in blog & docs * website: remove scroll in mobile dropdown menu * website: remove rfcs & add guide docs to website * website: remove file renaming script from web.sh * website: add menu to docs in nav * website: add hash list & add scroll to headers * website: customize docs frontmatter through JS * website: remove supported_languages.json * website: move merge_translations.js to JS folder * website: add the following changes to docs - add frontmatter to new doc merged from master - add ignoreForWeb property to frontmatter of README.md docs * website: remove package-lock.json from .gitignore * website: add package-lock.json from .gitignore * website: add no docs message to docs dropdown * website: improve the sidebar of docs * website: add revision date to docs * website: add script to add version to docs frontmatter * website: add layout to display message in docs if its version is old * website: improve nav responsiveness * website: remove frontmatter form main README & rfcs * website: remove rfcs from website folder * website: add ignore condition for rfcs in .eleventy * website: remove frontmatter from lang README docs * website: remove README from website's lang docs * website: add guides menu in nav * website: following changes - add docs_dropdown.json - extend reference menu in nav - remove docs menu from nav * website: fix in docs sidebar * website: revert main docs README.md files * website: revert main docs README.md files * website: move scripts out of js that are for build * website: remove displayAt form guide docs * website: create a docs_sidebar.json & shift to that approach * update navigation * website: set navbar * website: add icons to external links * website: change the approach for docs sidebar creation * website: update docs template * website: add some strings to en.json and map them accordingly * remove icon --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2023-05-01 02:31:23 +05:00
ty.addFilter("getlang", (path) => {
const urlParts = path.split("/")
if (urlParts[1] === "docs") {
if (urlParts[2] === "lang") {
return urlParts[3]
}
return "en"
}
else {
if (supportedRoutes.includes(urlParts[1])) return "en"
else if (supportedLangs.includes(urlParts[1])) return urlParts[1]
return "en"
}
website internationalization (#1922) * website Internationalization (#1904) * added devcontainer config * internationalization under dev * internationalization of _data done * overlays internationalization done * improved routing * updated gitignore * remove .devcontainer * internationalization in progess deleted all the intermediate files added translation of few sections * remaining website strings are added to translation * done internationalization - fully converted to i18n plugin - wrote bash script for creating a combined translations.json * internationalization UI done * a quick fix * remove jq installation * Added translation using Weblate (German) * Translated using Weblate (French) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/ * Translated using Weblate (German) Currently translated at 42.9% (91 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * fixes of web Internationalization (#1925) * a quick fix * blog route for all languages is shifted to root blog route * wrote merge_translations.js * remove language label from dropdown * update language names * refactor scripts * remove catch from script * Added translation using Weblate (Dutch) * Added translation using Weblate (Norwegian Bokmål) * Translated using Weblate (Dutch) Currently translated at 33.0% (70 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/nl/ * website: internationalization fixes (#1931) * added devcontainer config * internationalization under dev * internationalization of _data done * overlays internationalization done * improved routing * updated gitignore * remove .devcontainer * internationalization in progess deleted all the intermediate files added translation of few sections * remaining website strings are added to translation * done internationalization - fully converted to i18n plugin - wrote bash script for creating a combined translations.json * internationalization UI done * a quick fix * blog route for all languages is shifted to root blog route * wrote merge_translations.js * remove flag from blog * updated nav stylings & logo links * add enabled key * updated nav dropdown styling * gave specific lang to i18n plugin. overlay translations are now working. * enable nl & nb_NO * updated nav stylings * updated contact.js --------- Co-authored-by: M Sarmad Qadeer <msarmadqadeer@gmail.com> * Translated using Weblate (German) Currently translated at 47.6% (101 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * fixed internationalization issues * updated strings, refactor contact.js * updated nav stylings for mobile * a bit smaller padding on mobile * Added translation using Weblate (Czech) * Translated using Weblate (Czech) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/cs/ * Translated using Weblate (French) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/ * Translated using Weblate (German) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * enabled languages * check/correct (#1949) --------- Co-authored-by: M Sarmad Qadeer <MSarmadQadeer@gmail.com> Co-authored-by: Ophiushi <Ophiushi@users.noreply.hosted.weblate.org> Co-authored-by: mlanp <github@lang.xyz> Co-authored-by: John m <jvanmanen@gmail.com> Co-authored-by: zenobit <zen@osowoso.xyz> Co-authored-by: Ophiushi <41908476+ishi-sama@users.noreply.github.com>
2023-02-24 21:03:57 +00:00
})
ty.addFilter('applyGlossary', function (content) {
const dom = new JSDOM(content)
const { document } = dom.window
const body = document.querySelector('body')
const allContentNodes = document.querySelectorAll('p, td, a, h1, h2, h3, h4')
const overlayIds = []
glossary.forEach((term, index) => {
let changeNoted = false
const id = term.term.toLowerCase().replace(/\s/g, '-')
allContentNodes.forEach((node) => {
const regex = new RegExp(`(?<![/#])\\b${term.term}\\b`, 'gi')
const replacement = `<span data-glossary="tooltip-${id}" class="glossary-term">${term.term}</span>`
const beforeContent = node.innerHTML
node.innerHTML = node.innerHTML.replace(regex, replacement)
if (beforeContent !== node.innerHTML && !changeNoted) {
changeNoted = true
}
})
if (changeNoted) {
const definitionTooltipDiv = document.createElement('div')
definitionTooltipDiv.id = `tooltip-${id}`
definitionTooltipDiv.className = "glossary-tooltip"
const titleH4 = document.createElement('h4')
titleH4.innerHTML = term.term
titleH4.className = "tooltip-title"
const p = document.createElement('p')
p.innerHTML = term.tooltip
const innerDiv = document.createElement('div')
innerDiv.appendChild(titleH4)
innerDiv.appendChild(p)
if (term.hasMultipleParagraphs) {
const readMoreBtn = document.createElement('button')
readMoreBtn.innerHTML = "Read more"
readMoreBtn.className = "read-more-btn open-overlay-btn"
readMoreBtn.setAttribute('data-show-overlay', id)
innerDiv.appendChild(readMoreBtn)
}
innerDiv.className = "tooltip-content"
definitionTooltipDiv.appendChild(innerDiv)
body.appendChild(definitionTooltipDiv)
}
let tooltipDom = new JSDOM(term.definition)
let tooltipDocument = tooltipDom.window.document
const hashList = [term.term.toLowerCase().replace(/\s/g, '-')]
tooltipDocument.querySelectorAll('a[href*="#"]').forEach(a => {
let hashIndex = a.href.indexOf("#")
if (hashIndex !== -1) {
let hash = a.href.substring(hashIndex + 1)
hashList.push(hash)
}
})
hashList.forEach(hash => {
if (!overlayIds.includes(hash)) {
let termFromHash = glossary.find(term => term.term.toLowerCase().replace(/\s/g, '-') === hash)
if (!termFromHash) return
const overlayDiv = document.createElement('div')
overlayDiv.id = hash
overlayDiv.className = "overlay glossary-overlay hidden"
const overlayCardDiv = document.createElement('div')
overlayCardDiv.className = "overlay-card"
const overlayTitleH1 = document.createElement('h1')
overlayTitleH1.className = "overlay-title"
overlayTitleH1.innerHTML = termFromHash.term
const overlayContent = document.createElement('div')
overlayContent.className = "overlay-content"
overlayContent.innerHTML = termFromHash.definition
const crossSVG = document.createElementNS("http://www.w3.org/2000/svg", "svg")
crossSVG.setAttribute('class', 'close-overlay-btn')
crossSVG.setAttribute('id', 'cross')
crossSVG.setAttribute('width', '16')
crossSVG.setAttribute('height', '16')
crossSVG.setAttribute('viewBox', '0 0 13 13')
crossSVG.setAttribute('xmlns', 'http://www.w3.org/2000/svg')
const crossPath = document.createElementNS("http://www.w3.org/2000/svg", "path")
crossPath.setAttribute('d', 'M12.7973 11.5525L7.59762 6.49833L12.7947 1.44675C13.055 1.19371 13.0658 0.771991 12.8188 0.505331C12.5718 0.238674 12.1602 0.227644 11.8999 0.480681L6.65343 5.58028L1.09979 0.182228C0.805 0.002228 0.430001 0.002228 0.135211 0.182228C-0.159579 0.362228 -0.159579 0.697228 0.135211 0.877228L5.68885 6.27528L0.4918 11.3295C0.231501 11.5825 0.220703 12.0042 0.467664 12.2709C0.714625 12.5376 1.12625 12.5486 1.38655 12.2956L6.63302 7.196L12.1867 12.5941C12.4815 12.7741 12.8565 12.7741 13.1513 12.5941C13.4461 12.4141 13.4461 12.0791 13.1513 11.8991L12.7973 11.5525Z')
crossSVG.appendChild(crossPath)
overlayCardDiv.appendChild(overlayTitleH1)
overlayCardDiv.appendChild(overlayContent)
overlayCardDiv.appendChild(crossSVG)
overlayDiv.appendChild(overlayCardDiv)
body.appendChild(overlayDiv)
overlayIds.push(hash)
}
})
})
return dom.serialize()
})
ty.addFilter('wrapH3s', function (content, page) {
if (!page.url.includes("/jobs/")) {
return content
}
const dom = new JSDOM(content)
const document = dom.window.document
const makeBlock = (block) => {
const jobTab = document.createElement('div')
jobTab.className = "job-tab"
const flexDiv = document.createElement('div')
flexDiv.className = "flex items-center justify-between job-tab-btn cursor-pointer"
flexDiv.innerHTML = `
<${block.tagName}>${block.innerHTML}</${block.tagName}>
<svg class="fill-grey-black dark:fill-white" width="10" height="5" viewBox="0 0 10 5" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.40813 4.79332C8.69689 5.06889 9.16507 5.06889 9.45384 4.79332C9.7426 4.51775 9.7426 4.07097 9.45384 3.7954L5.69327 0.206676C5.65717 0.17223 5.61827 0.142089 5.57727 0.116255C5.29026 -0.064587 4.90023 -0.0344467 4.64756 0.206676L0.886983 3.7954C0.598219 4.07097 0.598219 4.51775 0.886983 4.79332C1.17575 5.06889 1.64393 5.06889 1.93269 4.79332L5.17041 1.70356L8.40813 4.79332Z"></path>
</svg>
`
jobTab.appendChild(flexDiv)
const jobContent = document.createElement('div')
jobContent.className = "job-tab-content"
jobTab.appendChild(jobContent)
block.parentNode.insertBefore(jobTab, block)
block.remove()
let sibling = jobTab.nextElementSibling
const siblingsToMove = []
while (sibling && !['H3', 'H2'].includes(sibling.tagName)) {
siblingsToMove.push(sibling)
sibling = sibling.nextElementSibling
}
siblingsToMove.forEach(el => jobContent.appendChild(el))
}
Array.from(document.querySelectorAll("h3")).forEach(makeBlock)
return dom.serialize()
})
website internationalization (#1922) * website Internationalization (#1904) * added devcontainer config * internationalization under dev * internationalization of _data done * overlays internationalization done * improved routing * updated gitignore * remove .devcontainer * internationalization in progess deleted all the intermediate files added translation of few sections * remaining website strings are added to translation * done internationalization - fully converted to i18n plugin - wrote bash script for creating a combined translations.json * internationalization UI done * a quick fix * remove jq installation * Added translation using Weblate (German) * Translated using Weblate (French) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/ * Translated using Weblate (German) Currently translated at 42.9% (91 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * fixes of web Internationalization (#1925) * a quick fix * blog route for all languages is shifted to root blog route * wrote merge_translations.js * remove language label from dropdown * update language names * refactor scripts * remove catch from script * Added translation using Weblate (Dutch) * Added translation using Weblate (Norwegian Bokmål) * Translated using Weblate (Dutch) Currently translated at 33.0% (70 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/nl/ * website: internationalization fixes (#1931) * added devcontainer config * internationalization under dev * internationalization of _data done * overlays internationalization done * improved routing * updated gitignore * remove .devcontainer * internationalization in progess deleted all the intermediate files added translation of few sections * remaining website strings are added to translation * done internationalization - fully converted to i18n plugin - wrote bash script for creating a combined translations.json * internationalization UI done * a quick fix * blog route for all languages is shifted to root blog route * wrote merge_translations.js * remove flag from blog * updated nav stylings & logo links * add enabled key * updated nav dropdown styling * gave specific lang to i18n plugin. overlay translations are now working. * enable nl & nb_NO * updated nav stylings * updated contact.js --------- Co-authored-by: M Sarmad Qadeer <msarmadqadeer@gmail.com> * Translated using Weblate (German) Currently translated at 47.6% (101 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * fixed internationalization issues * updated strings, refactor contact.js * updated nav stylings for mobile * a bit smaller padding on mobile * Added translation using Weblate (Czech) * Translated using Weblate (Czech) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/cs/ * Translated using Weblate (French) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/ * Translated using Weblate (German) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * enabled languages * check/correct (#1949) --------- Co-authored-by: M Sarmad Qadeer <MSarmadQadeer@gmail.com> Co-authored-by: Ophiushi <Ophiushi@users.noreply.hosted.weblate.org> Co-authored-by: mlanp <github@lang.xyz> Co-authored-by: John m <jvanmanen@gmail.com> Co-authored-by: zenobit <zen@osowoso.xyz> Co-authored-by: Ophiushi <41908476+ishi-sama@users.noreply.github.com>
2023-02-24 21:03:57 +00:00
ty.addShortcode("completeRoute", (obj) => {
const urlParts = obj.url.split("/")
website: add docs to website (#2080) * website: add fontmatter & improve image URLs where necessary * website: add docs to website * website: add prismjs for code highlighting * website: change npm install position in web.sh * website: fix an image URL in lang/cs/README.md * website: improve image paths in lang/cs/translations.md * website: add responsiveness & improve stylings of docs * website: add dir to navbar in blog & docs * website: remove scroll in mobile dropdown menu * website: remove rfcs & add guide docs to website * website: remove file renaming script from web.sh * website: add menu to docs in nav * website: add hash list & add scroll to headers * website: customize docs frontmatter through JS * website: remove supported_languages.json * website: move merge_translations.js to JS folder * website: add the following changes to docs - add frontmatter to new doc merged from master - add ignoreForWeb property to frontmatter of README.md docs * website: remove package-lock.json from .gitignore * website: add package-lock.json from .gitignore * website: add no docs message to docs dropdown * website: improve the sidebar of docs * website: add revision date to docs * website: add script to add version to docs frontmatter * website: add layout to display message in docs if its version is old * website: improve nav responsiveness * website: remove frontmatter form main README & rfcs * website: remove rfcs from website folder * website: add ignore condition for rfcs in .eleventy * website: remove frontmatter from lang README docs * website: remove README from website's lang docs * website: add guides menu in nav * website: following changes - add docs_dropdown.json - extend reference menu in nav - remove docs menu from nav * website: fix in docs sidebar * website: revert main docs README.md files * website: revert main docs README.md files * website: move scripts out of js that are for build * website: remove displayAt form guide docs * website: create a docs_sidebar.json & shift to that approach * update navigation * website: set navbar * website: add icons to external links * website: change the approach for docs sidebar creation * website: update docs template * website: add some strings to en.json and map them accordingly * remove icon --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2023-05-01 02:31:23 +05:00
website internationalization (#1922) * website Internationalization (#1904) * added devcontainer config * internationalization under dev * internationalization of _data done * overlays internationalization done * improved routing * updated gitignore * remove .devcontainer * internationalization in progess deleted all the intermediate files added translation of few sections * remaining website strings are added to translation * done internationalization - fully converted to i18n plugin - wrote bash script for creating a combined translations.json * internationalization UI done * a quick fix * remove jq installation * Added translation using Weblate (German) * Translated using Weblate (French) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/ * Translated using Weblate (German) Currently translated at 42.9% (91 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * fixes of web Internationalization (#1925) * a quick fix * blog route for all languages is shifted to root blog route * wrote merge_translations.js * remove language label from dropdown * update language names * refactor scripts * remove catch from script * Added translation using Weblate (Dutch) * Added translation using Weblate (Norwegian Bokmål) * Translated using Weblate (Dutch) Currently translated at 33.0% (70 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/nl/ * website: internationalization fixes (#1931) * added devcontainer config * internationalization under dev * internationalization of _data done * overlays internationalization done * improved routing * updated gitignore * remove .devcontainer * internationalization in progess deleted all the intermediate files added translation of few sections * remaining website strings are added to translation * done internationalization - fully converted to i18n plugin - wrote bash script for creating a combined translations.json * internationalization UI done * a quick fix * blog route for all languages is shifted to root blog route * wrote merge_translations.js * remove flag from blog * updated nav stylings & logo links * add enabled key * updated nav dropdown styling * gave specific lang to i18n plugin. overlay translations are now working. * enable nl & nb_NO * updated nav stylings * updated contact.js --------- Co-authored-by: M Sarmad Qadeer <msarmadqadeer@gmail.com> * Translated using Weblate (German) Currently translated at 47.6% (101 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * fixed internationalization issues * updated strings, refactor contact.js * updated nav stylings for mobile * a bit smaller padding on mobile * Added translation using Weblate (Czech) * Translated using Weblate (Czech) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/cs/ * Translated using Weblate (French) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/ * Translated using Weblate (German) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * enabled languages * check/correct (#1949) --------- Co-authored-by: M Sarmad Qadeer <MSarmadQadeer@gmail.com> Co-authored-by: Ophiushi <Ophiushi@users.noreply.hosted.weblate.org> Co-authored-by: mlanp <github@lang.xyz> Co-authored-by: John m <jvanmanen@gmail.com> Co-authored-by: zenobit <zen@osowoso.xyz> Co-authored-by: Ophiushi <41908476+ishi-sama@users.noreply.github.com>
2023-02-24 21:03:57 +00:00
if (supportedRoutes.includes(urlParts[1])) {
if (urlParts[1] == "blog")
return `/blog`
website: add docs to website (#2080) * website: add fontmatter & improve image URLs where necessary * website: add docs to website * website: add prismjs for code highlighting * website: change npm install position in web.sh * website: fix an image URL in lang/cs/README.md * website: improve image paths in lang/cs/translations.md * website: add responsiveness & improve stylings of docs * website: add dir to navbar in blog & docs * website: remove scroll in mobile dropdown menu * website: remove rfcs & add guide docs to website * website: remove file renaming script from web.sh * website: add menu to docs in nav * website: add hash list & add scroll to headers * website: customize docs frontmatter through JS * website: remove supported_languages.json * website: move merge_translations.js to JS folder * website: add the following changes to docs - add frontmatter to new doc merged from master - add ignoreForWeb property to frontmatter of README.md docs * website: remove package-lock.json from .gitignore * website: add package-lock.json from .gitignore * website: add no docs message to docs dropdown * website: improve the sidebar of docs * website: add revision date to docs * website: add script to add version to docs frontmatter * website: add layout to display message in docs if its version is old * website: improve nav responsiveness * website: remove frontmatter form main README & rfcs * website: remove rfcs from website folder * website: add ignore condition for rfcs in .eleventy * website: remove frontmatter from lang README docs * website: remove README from website's lang docs * website: add guides menu in nav * website: following changes - add docs_dropdown.json - extend reference menu in nav - remove docs menu from nav * website: fix in docs sidebar * website: revert main docs README.md files * website: revert main docs README.md files * website: move scripts out of js that are for build * website: remove displayAt form guide docs * website: create a docs_sidebar.json & shift to that approach * update navigation * website: set navbar * website: add icons to external links * website: change the approach for docs sidebar creation * website: update docs template * website: add some strings to en.json and map them accordingly * remove icon --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2023-05-01 02:31:23 +05:00
else if (urlParts[1] === "docs") {
if (urlParts[2] === "lang") {
if (obj.lang === "en")
return `/docs/${urlParts.slice(4).join('/')}`
return `/docs/lang/${obj.lang}/${urlParts.slice(4).join('/')}`
}
else {
if (obj.lang === "en")
return `${obj.url}`
return `/docs/lang/${obj.lang}/${urlParts.slice(2).join('/')}`
}
}
website internationalization (#1922) * website Internationalization (#1904) * added devcontainer config * internationalization under dev * internationalization of _data done * overlays internationalization done * improved routing * updated gitignore * remove .devcontainer * internationalization in progess deleted all the intermediate files added translation of few sections * remaining website strings are added to translation * done internationalization - fully converted to i18n plugin - wrote bash script for creating a combined translations.json * internationalization UI done * a quick fix * remove jq installation * Added translation using Weblate (German) * Translated using Weblate (French) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/ * Translated using Weblate (German) Currently translated at 42.9% (91 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * fixes of web Internationalization (#1925) * a quick fix * blog route for all languages is shifted to root blog route * wrote merge_translations.js * remove language label from dropdown * update language names * refactor scripts * remove catch from script * Added translation using Weblate (Dutch) * Added translation using Weblate (Norwegian Bokmål) * Translated using Weblate (Dutch) Currently translated at 33.0% (70 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/nl/ * website: internationalization fixes (#1931) * added devcontainer config * internationalization under dev * internationalization of _data done * overlays internationalization done * improved routing * updated gitignore * remove .devcontainer * internationalization in progess deleted all the intermediate files added translation of few sections * remaining website strings are added to translation * done internationalization - fully converted to i18n plugin - wrote bash script for creating a combined translations.json * internationalization UI done * a quick fix * blog route for all languages is shifted to root blog route * wrote merge_translations.js * remove flag from blog * updated nav stylings & logo links * add enabled key * updated nav dropdown styling * gave specific lang to i18n plugin. overlay translations are now working. * enable nl & nb_NO * updated nav stylings * updated contact.js --------- Co-authored-by: M Sarmad Qadeer <msarmadqadeer@gmail.com> * Translated using Weblate (German) Currently translated at 47.6% (101 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * fixed internationalization issues * updated strings, refactor contact.js * updated nav stylings for mobile * a bit smaller padding on mobile * Added translation using Weblate (Czech) * Translated using Weblate (Czech) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/cs/ * Translated using Weblate (French) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/ * Translated using Weblate (German) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * enabled languages * check/correct (#1949) --------- Co-authored-by: M Sarmad Qadeer <MSarmadQadeer@gmail.com> Co-authored-by: Ophiushi <Ophiushi@users.noreply.hosted.weblate.org> Co-authored-by: mlanp <github@lang.xyz> Co-authored-by: John m <jvanmanen@gmail.com> Co-authored-by: zenobit <zen@osowoso.xyz> Co-authored-by: Ophiushi <41908476+ishi-sama@users.noreply.github.com>
2023-02-24 21:03:57 +00:00
else if (obj.lang === "en")
return `${obj.url}`
return `/${obj.lang}${obj.url}`
}
else if (supportedLangs.includes(urlParts[1])) {
if (urlParts[2] == "blog")
return `/blog`
else if (obj.lang === "en")
return `/${urlParts.slice(2).join('/')}`
return `/${obj.lang}/${urlParts.slice(2).join('/')}`
}
})
ty.addPlugin(pluginRss)
website internationalization (#1922) * website Internationalization (#1904) * added devcontainer config * internationalization under dev * internationalization of _data done * overlays internationalization done * improved routing * updated gitignore * remove .devcontainer * internationalization in progess deleted all the intermediate files added translation of few sections * remaining website strings are added to translation * done internationalization - fully converted to i18n plugin - wrote bash script for creating a combined translations.json * internationalization UI done * a quick fix * remove jq installation * Added translation using Weblate (German) * Translated using Weblate (French) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/ * Translated using Weblate (German) Currently translated at 42.9% (91 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * fixes of web Internationalization (#1925) * a quick fix * blog route for all languages is shifted to root blog route * wrote merge_translations.js * remove language label from dropdown * update language names * refactor scripts * remove catch from script * Added translation using Weblate (Dutch) * Added translation using Weblate (Norwegian Bokmål) * Translated using Weblate (Dutch) Currently translated at 33.0% (70 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/nl/ * website: internationalization fixes (#1931) * added devcontainer config * internationalization under dev * internationalization of _data done * overlays internationalization done * improved routing * updated gitignore * remove .devcontainer * internationalization in progess deleted all the intermediate files added translation of few sections * remaining website strings are added to translation * done internationalization - fully converted to i18n plugin - wrote bash script for creating a combined translations.json * internationalization UI done * a quick fix * blog route for all languages is shifted to root blog route * wrote merge_translations.js * remove flag from blog * updated nav stylings & logo links * add enabled key * updated nav dropdown styling * gave specific lang to i18n plugin. overlay translations are now working. * enable nl & nb_NO * updated nav stylings * updated contact.js --------- Co-authored-by: M Sarmad Qadeer <msarmadqadeer@gmail.com> * Translated using Weblate (German) Currently translated at 47.6% (101 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * fixed internationalization issues * updated strings, refactor contact.js * updated nav stylings for mobile * a bit smaller padding on mobile * Added translation using Weblate (Czech) * Translated using Weblate (Czech) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/cs/ * Translated using Weblate (French) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/ * Translated using Weblate (German) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * enabled languages * check/correct (#1949) --------- Co-authored-by: M Sarmad Qadeer <MSarmadQadeer@gmail.com> Co-authored-by: Ophiushi <Ophiushi@users.noreply.hosted.weblate.org> Co-authored-by: mlanp <github@lang.xyz> Co-authored-by: John m <jvanmanen@gmail.com> Co-authored-by: zenobit <zen@osowoso.xyz> Co-authored-by: Ophiushi <41908476+ishi-sama@users.noreply.github.com>
2023-02-24 21:03:57 +00:00
ty.addPlugin(i18n, {
translations,
fallbackLocales: {
'*': 'en'
},
defaultLocale: 'en',
website: add docs to website (#2080) * website: add fontmatter & improve image URLs where necessary * website: add docs to website * website: add prismjs for code highlighting * website: change npm install position in web.sh * website: fix an image URL in lang/cs/README.md * website: improve image paths in lang/cs/translations.md * website: add responsiveness & improve stylings of docs * website: add dir to navbar in blog & docs * website: remove scroll in mobile dropdown menu * website: remove rfcs & add guide docs to website * website: remove file renaming script from web.sh * website: add menu to docs in nav * website: add hash list & add scroll to headers * website: customize docs frontmatter through JS * website: remove supported_languages.json * website: move merge_translations.js to JS folder * website: add the following changes to docs - add frontmatter to new doc merged from master - add ignoreForWeb property to frontmatter of README.md docs * website: remove package-lock.json from .gitignore * website: add package-lock.json from .gitignore * website: add no docs message to docs dropdown * website: improve the sidebar of docs * website: add revision date to docs * website: add script to add version to docs frontmatter * website: add layout to display message in docs if its version is old * website: improve nav responsiveness * website: remove frontmatter form main README & rfcs * website: remove rfcs from website folder * website: add ignore condition for rfcs in .eleventy * website: remove frontmatter from lang README docs * website: remove README from website's lang docs * website: add guides menu in nav * website: following changes - add docs_dropdown.json - extend reference menu in nav - remove docs menu from nav * website: fix in docs sidebar * website: revert main docs README.md files * website: revert main docs README.md files * website: move scripts out of js that are for build * website: remove displayAt form guide docs * website: create a docs_sidebar.json & shift to that approach * update navigation * website: set navbar * website: add icons to external links * website: change the approach for docs sidebar creation * website: update docs template * website: add some strings to en.json and map them accordingly * remove icon --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2023-05-01 02:31:23 +05:00
})
website internationalization (#1922) * website Internationalization (#1904) * added devcontainer config * internationalization under dev * internationalization of _data done * overlays internationalization done * improved routing * updated gitignore * remove .devcontainer * internationalization in progess deleted all the intermediate files added translation of few sections * remaining website strings are added to translation * done internationalization - fully converted to i18n plugin - wrote bash script for creating a combined translations.json * internationalization UI done * a quick fix * remove jq installation * Added translation using Weblate (German) * Translated using Weblate (French) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/ * Translated using Weblate (German) Currently translated at 42.9% (91 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * fixes of web Internationalization (#1925) * a quick fix * blog route for all languages is shifted to root blog route * wrote merge_translations.js * remove language label from dropdown * update language names * refactor scripts * remove catch from script * Added translation using Weblate (Dutch) * Added translation using Weblate (Norwegian Bokmål) * Translated using Weblate (Dutch) Currently translated at 33.0% (70 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/nl/ * website: internationalization fixes (#1931) * added devcontainer config * internationalization under dev * internationalization of _data done * overlays internationalization done * improved routing * updated gitignore * remove .devcontainer * internationalization in progess deleted all the intermediate files added translation of few sections * remaining website strings are added to translation * done internationalization - fully converted to i18n plugin - wrote bash script for creating a combined translations.json * internationalization UI done * a quick fix * blog route for all languages is shifted to root blog route * wrote merge_translations.js * remove flag from blog * updated nav stylings & logo links * add enabled key * updated nav dropdown styling * gave specific lang to i18n plugin. overlay translations are now working. * enable nl & nb_NO * updated nav stylings * updated contact.js --------- Co-authored-by: M Sarmad Qadeer <msarmadqadeer@gmail.com> * Translated using Weblate (German) Currently translated at 47.6% (101 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * fixed internationalization issues * updated strings, refactor contact.js * updated nav stylings for mobile * a bit smaller padding on mobile * Added translation using Weblate (Czech) * Translated using Weblate (Czech) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/cs/ * Translated using Weblate (French) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/fr/ * Translated using Weblate (German) Currently translated at 100.0% (212 of 212 strings) Translation: SimpleX Chat/SimpleX Chat website Translate-URL: https://hosted.weblate.org/projects/simplex-chat/website/de/ * enabled languages * check/correct (#1949) --------- Co-authored-by: M Sarmad Qadeer <MSarmadQadeer@gmail.com> Co-authored-by: Ophiushi <Ophiushi@users.noreply.hosted.weblate.org> Co-authored-by: mlanp <github@lang.xyz> Co-authored-by: John m <jvanmanen@gmail.com> Co-authored-by: zenobit <zen@osowoso.xyz> Co-authored-by: Ophiushi <41908476+ishi-sama@users.noreply.github.com>
2023-02-24 21:03:57 +00:00
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")
ty.addPassthroughCopy("src/lottie_file")
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")
website: add docs to website (#2080) * website: add fontmatter & improve image URLs where necessary * website: add docs to website * website: add prismjs for code highlighting * website: change npm install position in web.sh * website: fix an image URL in lang/cs/README.md * website: improve image paths in lang/cs/translations.md * website: add responsiveness & improve stylings of docs * website: add dir to navbar in blog & docs * website: remove scroll in mobile dropdown menu * website: remove rfcs & add guide docs to website * website: remove file renaming script from web.sh * website: add menu to docs in nav * website: add hash list & add scroll to headers * website: customize docs frontmatter through JS * website: remove supported_languages.json * website: move merge_translations.js to JS folder * website: add the following changes to docs - add frontmatter to new doc merged from master - add ignoreForWeb property to frontmatter of README.md docs * website: remove package-lock.json from .gitignore * website: add package-lock.json from .gitignore * website: add no docs message to docs dropdown * website: improve the sidebar of docs * website: add revision date to docs * website: add script to add version to docs frontmatter * website: add layout to display message in docs if its version is old * website: improve nav responsiveness * website: remove frontmatter form main README & rfcs * website: remove rfcs from website folder * website: add ignore condition for rfcs in .eleventy * website: remove frontmatter from lang README docs * website: remove README from website's lang docs * website: add guides menu in nav * website: following changes - add docs_dropdown.json - extend reference menu in nav - remove docs menu from nav * website: fix in docs sidebar * website: revert main docs README.md files * website: revert main docs README.md files * website: move scripts out of js that are for build * website: remove displayAt form guide docs * website: create a docs_sidebar.json & shift to that approach * update navigation * website: set navbar * website: add icons to external links * website: change the approach for docs sidebar creation * website: update docs template * website: add some strings to en.json and map them accordingly * remove icon --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2023-05-01 02:31:23 +05:00
ty.addPassthroughCopy("src/docs/*.png")
ty.addPassthroughCopy("src/docs/images")
ty.addPassthroughCopy("src/docs/protocol/diagrams")
ty.addPassthroughCopy("src/docs/protocol/*.json")
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/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()
})
website: add docs to website (#2080) * website: add fontmatter & improve image URLs where necessary * website: add docs to website * website: add prismjs for code highlighting * website: change npm install position in web.sh * website: fix an image URL in lang/cs/README.md * website: improve image paths in lang/cs/translations.md * website: add responsiveness & improve stylings of docs * website: add dir to navbar in blog & docs * website: remove scroll in mobile dropdown menu * website: remove rfcs & add guide docs to website * website: remove file renaming script from web.sh * website: add menu to docs in nav * website: add hash list & add scroll to headers * website: customize docs frontmatter through JS * website: remove supported_languages.json * website: move merge_translations.js to JS folder * website: add the following changes to docs - add frontmatter to new doc merged from master - add ignoreForWeb property to frontmatter of README.md docs * website: remove package-lock.json from .gitignore * website: add package-lock.json from .gitignore * website: add no docs message to docs dropdown * website: improve the sidebar of docs * website: add revision date to docs * website: add script to add version to docs frontmatter * website: add layout to display message in docs if its version is old * website: improve nav responsiveness * website: remove frontmatter form main README & rfcs * website: remove rfcs from website folder * website: add ignore condition for rfcs in .eleventy * website: remove frontmatter from lang README docs * website: remove README from website's lang docs * website: add guides menu in nav * website: following changes - add docs_dropdown.json - extend reference menu in nav - remove docs menu from nav * website: fix in docs sidebar * website: revert main docs README.md files * website: revert main docs README.md files * website: move scripts out of js that are for build * website: remove displayAt form guide docs * website: create a docs_sidebar.json & shift to that approach * update navigation * website: set navbar * website: add icons to external links * website: change the approach for docs sidebar creation * website: update docs template * website: add some strings to en.json and map them accordingly * remove icon --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2023-05-01 02:31:23 +05:00
ty.addCollection('docs', function (collection) {
const docs = collection.getFilteredByGlob('src/docs/**/*.md')
.map(doc => {
return { url: doc.url, title: doc.data.title, inputPath: doc.inputPath }
})
let referenceContent = fs.readFileSync(path.resolve(__dirname, 'src/_data/docs_sidebar.json'), 'utf-8')
referenceContent = JSON.parse(referenceContent).items
const newDocs = []
referenceContent.forEach(referenceMenu => {
referenceMenu.data.forEach(referenceSubmenu => {
docs.forEach(doc => {
const url = doc.url.replace("/docs/", "")
let urlParts = url.split("/")
urlParts = urlParts.filter((ele) => ele !== "")
website: add docs to website (#2080) * website: add fontmatter & improve image URLs where necessary * website: add docs to website * website: add prismjs for code highlighting * website: change npm install position in web.sh * website: fix an image URL in lang/cs/README.md * website: improve image paths in lang/cs/translations.md * website: add responsiveness & improve stylings of docs * website: add dir to navbar in blog & docs * website: remove scroll in mobile dropdown menu * website: remove rfcs & add guide docs to website * website: remove file renaming script from web.sh * website: add menu to docs in nav * website: add hash list & add scroll to headers * website: customize docs frontmatter through JS * website: remove supported_languages.json * website: move merge_translations.js to JS folder * website: add the following changes to docs - add frontmatter to new doc merged from master - add ignoreForWeb property to frontmatter of README.md docs * website: remove package-lock.json from .gitignore * website: add package-lock.json from .gitignore * website: add no docs message to docs dropdown * website: improve the sidebar of docs * website: add revision date to docs * website: add script to add version to docs frontmatter * website: add layout to display message in docs if its version is old * website: improve nav responsiveness * website: remove frontmatter form main README & rfcs * website: remove rfcs from website folder * website: add ignore condition for rfcs in .eleventy * website: remove frontmatter from lang README docs * website: remove README from website's lang docs * website: add guides menu in nav * website: following changes - add docs_dropdown.json - extend reference menu in nav - remove docs menu from nav * website: fix in docs sidebar * website: revert main docs README.md files * website: revert main docs README.md files * website: move scripts out of js that are for build * website: remove displayAt form guide docs * website: create a docs_sidebar.json & shift to that approach * update navigation * website: set navbar * website: add icons to external links * website: change the approach for docs sidebar creation * website: update docs template * website: add some strings to en.json and map them accordingly * remove icon --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2023-05-01 02:31:23 +05:00
if (doc.inputPath.split('/').includes(referenceSubmenu)) {
website: add docs to website (#2080) * website: add fontmatter & improve image URLs where necessary * website: add docs to website * website: add prismjs for code highlighting * website: change npm install position in web.sh * website: fix an image URL in lang/cs/README.md * website: improve image paths in lang/cs/translations.md * website: add responsiveness & improve stylings of docs * website: add dir to navbar in blog & docs * website: remove scroll in mobile dropdown menu * website: remove rfcs & add guide docs to website * website: remove file renaming script from web.sh * website: add menu to docs in nav * website: add hash list & add scroll to headers * website: customize docs frontmatter through JS * website: remove supported_languages.json * website: move merge_translations.js to JS folder * website: add the following changes to docs - add frontmatter to new doc merged from master - add ignoreForWeb property to frontmatter of README.md docs * website: remove package-lock.json from .gitignore * website: add package-lock.json from .gitignore * website: add no docs message to docs dropdown * website: improve the sidebar of docs * website: add revision date to docs * website: add script to add version to docs frontmatter * website: add layout to display message in docs if its version is old * website: improve nav responsiveness * website: remove frontmatter form main README & rfcs * website: remove rfcs from website folder * website: add ignore condition for rfcs in .eleventy * website: remove frontmatter from lang README docs * website: remove README from website's lang docs * website: add guides menu in nav * website: following changes - add docs_dropdown.json - extend reference menu in nav - remove docs menu from nav * website: fix in docs sidebar * website: revert main docs README.md files * website: revert main docs README.md files * website: move scripts out of js that are for build * website: remove displayAt form guide docs * website: create a docs_sidebar.json & shift to that approach * update navigation * website: set navbar * website: add icons to external links * website: change the approach for docs sidebar creation * website: update docs template * website: add some strings to en.json and map them accordingly * remove icon --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2023-05-01 02:31:23 +05:00
if (urlParts.length === 1 && urlParts[0] !== "") {
const index = newDocs.findIndex((ele) => ele.lang === 'en' && ele.menu === referenceMenu.menu)
if (index !== -1) {
newDocs[index].data.push(doc)
}
else {
newDocs.push({
lang: 'en',
menu: referenceMenu.menu,
data: [doc],
})
}
}
else if (urlParts.length > 1 && urlParts[0] !== "" && urlParts[0] !== "lang") {
const index = newDocs.findIndex((ele) => ele.lang === 'en' && ele.menu === referenceMenu.menu)
if (index !== -1) {
newDocs[index].data.push(doc)
} else {
newDocs.push({
lang: 'en',
menu: referenceMenu.menu,
data: [doc],
})
}
}
else if (urlParts.length === 3 && urlParts[0] === "lang" && urlParts[2] !== '') {
const index = newDocs.findIndex((ele) => ele.lang === urlParts[1] && ele.menu === referenceMenu.menu)
if (index !== -1) {
newDocs[index].data.push(doc)
}
else {
newDocs.push({
lang: urlParts[1],
menu: referenceMenu.menu,
data: [doc],
})
}
}
else if (urlParts.length > 3 && urlParts[0] === "lang" && urlParts[2] !== '') {
const index = newDocs.findIndex((ele) => ele.lang === urlParts[1] && ele.menu === referenceMenu.menu)
if (index !== -1) {
newDocs[index].data.push(doc)
}
else {
newDocs.push({
lang: urlParts[1],
menu: referenceMenu.menu,
data: [doc],
})
}
}
}
})
})
})
return newDocs
})
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.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) return link
let hostFile = path.resolve(_env.page.inputPath)
let linkFile = path.resolve(hostFile, '..', parsed.path)
if (parsed.path.startsWith('/')) {
let srcIndex = hostFile.indexOf("/src")
if (srcIndex !== -1) {
linkFile = path.join(hostFile.slice(0, srcIndex + 4), parsed.path)
}
}
if (fs.existsSync(linkFile) && fs.statSync(linkFile).isFile()) {
// this condition works if the link is a valid website file
const fileContent = fs.readFileSync(linkFile, 'utf8')
parsed.path = (matter(fileContent).data?.permalink || parsed.path).replace(/\.md$/, ".html").toLowerCase()
} else if (!fs.existsSync(linkFile)) {
linkFile = linkFile.replace('/website/src', '')
if (fs.existsSync(linkFile)) {
// this condition works if the link is a valid project file
const githubUrl = "https://github.com/simplex-chat/simplex-chat/blob/stable"
const keyword = "/simplex-chat"
index = linkFile.indexOf(keyword)
linkFile = linkFile.substring(index + keyword.length)
parsed.path = `${githubUrl}${linkFile}`
} else {
// if the link is not a valid website file or project file
throw new Error(`Broken link: ${parsed.path} in ${hostFile}`)
}
}
return uri.serialize(parsed)
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
}
}).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',
}
}