mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-22 05:50:11 +00:00
add missing images, simpligy link parsing
This commit is contained in:
@@ -49,6 +49,7 @@ logs/
|
||||
website/node_modules/
|
||||
website/src/blog/
|
||||
website/src/img/images/
|
||||
website/src/images/
|
||||
# Generated files
|
||||
website/package/generated*
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ Some links to answer the most common questions:
|
||||
|
||||
[Technical details and limitations](./20220723-simplex-chat-v3.1-tor-groups-efficiency.md#privacy-technical-details-and-limitations).
|
||||
|
||||
[How SimpleX is different from Session, Matrix, Signal, etc.](../README.md#frequently-asked-questions).
|
||||
[How SimpleX is different from Session, Matrix, Signal, etc.](https://github.com/simplex-chat/simplex-chat/blob/stable/README.md#frequently-asked-questions).
|
||||
|
||||
## We ask you to help us pay for 3rd party security audit
|
||||
|
||||
|
||||
+27
-44
@@ -1,56 +1,39 @@
|
||||
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')
|
||||
|
||||
module.exports = function (eleventyConfig) {
|
||||
// Keeps the same directory structure.
|
||||
eleventyConfig.addPassthroughCopy("src/assets/");
|
||||
eleventyConfig.addPassthroughCopy("src/img");
|
||||
eleventyConfig.addPassthroughCopy("src/css");
|
||||
eleventyConfig.addPassthroughCopy("src/js");
|
||||
eleventyConfig.addPassthroughCopy("src/contact");
|
||||
eleventyConfig.addPassthroughCopy("src/app-demo");
|
||||
eleventyConfig.addPassthroughCopy("src/blog/images");
|
||||
eleventyConfig.addPassthroughCopy("src/assets/")
|
||||
eleventyConfig.addPassthroughCopy("src/img")
|
||||
eleventyConfig.addPassthroughCopy("src/css")
|
||||
eleventyConfig.addPassthroughCopy("src/js")
|
||||
eleventyConfig.addPassthroughCopy("src/contact")
|
||||
eleventyConfig.addPassthroughCopy("src/app-demo")
|
||||
eleventyConfig.addPassthroughCopy("src/blog/images")
|
||||
eleventyConfig.addPassthroughCopy("src/images")
|
||||
|
||||
eleventyConfig.addCollection('blogs', function (collection) {
|
||||
return collection.getFilteredByGlob('src/blog/*.md').reverse();
|
||||
});
|
||||
return collection.getFilteredByGlob('src/blog/*.md').reverse()
|
||||
})
|
||||
|
||||
eleventyConfig.addWatchTarget("src/css");
|
||||
eleventyConfig.addWatchTarget("markdown/");
|
||||
eleventyConfig.addWatchTarget("components/Card.js");
|
||||
|
||||
const markdownIt = require("markdown-it");
|
||||
const markdownItAnchor = require("markdown-it-anchor");
|
||||
const markdownItReplaceLink = require('markdown-it-replace-link');
|
||||
const slugify = require("slugify");
|
||||
eleventyConfig.addWatchTarget("src/css")
|
||||
eleventyConfig.addWatchTarget("markdown/")
|
||||
eleventyConfig.addWatchTarget("components/Card.js")
|
||||
|
||||
const markdownLib = markdownIt({
|
||||
html: true,
|
||||
breaks: true,
|
||||
linkify: true,
|
||||
replaceLink: function (link, env) {
|
||||
const dotSepList = link.split(".");
|
||||
if (dotSepList[0] == "") {
|
||||
const hashSepList = dotSepList[dotSepList.length - 1].split("#")
|
||||
if (hashSepList[0] == "md") {
|
||||
let str = `.${dotSepList[1]}`;
|
||||
for (let i = 2; i < dotSepList.length; i++) {
|
||||
if (dotSepList[i].substring(0, 2) != "md") {
|
||||
str += "." + dotSepList[i];
|
||||
} else {
|
||||
str += ".html";
|
||||
break;
|
||||
};
|
||||
}
|
||||
if (hashSepList[1]) {
|
||||
str += "#" + hashSepList[1];
|
||||
}
|
||||
return str;
|
||||
}
|
||||
else {
|
||||
return link;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return link;
|
||||
replaceLink: function (link, _env) {
|
||||
let parsed = uri.parse(link)
|
||||
if (parsed.scheme || parsed.host || !parsed.path.endsWith(".md")) {
|
||||
return link
|
||||
}
|
||||
parsed.path = parsed.path.replace(/\.md$/, ".html")
|
||||
return uri.serialize(parsed)
|
||||
}
|
||||
}).use(markdownItAnchor, {
|
||||
slugify: (str) =>
|
||||
@@ -58,10 +41,10 @@ module.exports = function (eleventyConfig) {
|
||||
lower: true,
|
||||
strict: true,
|
||||
})
|
||||
}).use(markdownItReplaceLink);
|
||||
}).use(markdownItReplaceLink)
|
||||
|
||||
// replace the default markdown-it instance
|
||||
eleventyConfig.setLibrary("md", markdownLib);
|
||||
eleventyConfig.setLibrary("md", markdownLib)
|
||||
|
||||
return {
|
||||
dir: {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
"devDependencies": {
|
||||
"@11ty/eleventy": "^1.0.1",
|
||||
"common-tags": "^1.8.2",
|
||||
"fast-uri": "^2.1.0",
|
||||
"markdown-it-anchor": "^8.6.4",
|
||||
"slugify": "^1.6.5",
|
||||
"tailwindcss": "^3.0.24"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
cp -R blog website/src
|
||||
cp -R images website/src
|
||||
rm website/src/blog/README.md
|
||||
cd website
|
||||
npm install
|
||||
|
||||
Reference in New Issue
Block a user