Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertJGabriel committed Jun 25, 2021
1 parent 3948ac7 commit 5557bbd
Show file tree
Hide file tree
Showing 62 changed files with 8,318 additions and 12,235 deletions.
66 changes: 66 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
const socialImages = require("@11tyrocks/eleventy-plugin-social-images");
const emojiRegex = require("emoji-regex");
const slugify = require("slugify");
const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
const pluginRss = require("@11ty/eleventy-plugin-rss");
const markdownIt = require("markdown-it");
const markdownItAnchor = require("markdown-it-anchor");
const packageVersion = require("./package.json").version;

module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(socialImages);
eleventyConfig.addPlugin(syntaxHighlight);
eleventyConfig.addPlugin(pluginRss);

eleventyConfig.addWatchTarget("./src/sass/");

eleventyConfig.addPassthroughCopy("./src/css");
eleventyConfig.addPassthroughCopy("./src/fonts");
eleventyConfig.addPassthroughCopy("./src/img");
eleventyConfig.addPassthroughCopy("./src/favicon.png");

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

eleventyConfig.addFilter("slug", (str) => {
if (!str) {
return;
}

const regex = emojiRegex();
// Remove Emoji first
let string = str.replace(regex, "");

return slugify(string, {
lower: true,
replacement: "-",
remove: /[*+~·,()'"`´%!?¿:@\/]/g,
});
});

/* Markdown Overrides */
let markdownLibrary = markdownIt({
html: true,
}).use(markdownItAnchor, {
permalink: true,
permalinkClass: "tdbc-anchor",
permalinkSymbol: "#",
permalinkSpace: false,
level: [1, 2, 3],
slugify: (s) =>
s
.trim()
.toLowerCase()
.replace(/[\s+~\/]/g, "-")
.replace(/[().`,%·'"!?¿:@*]/g, ""),
});
eleventyConfig.setLibrary("md", markdownLibrary);

return {
passthroughFileCopy: true,
dir: {
input: "src",
output: "public",
},
};
};
1 change: 1 addition & 0 deletions .env-sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
URL=http://localhost:8080
23 changes: 0 additions & 23 deletions .github/workflows/build.yml

This file was deleted.

17 changes: 15 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
# dependencies installed by npm
node_modules
docs/assets/images/.DS_Store

# build artefacts
public
src/css
social

# secrets and errors
.env
.log

# macOS related files
.DS_Store
docs/

#IDE
.idea
1 change: 1 addition & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
printWidth: 100
8 changes: 8 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**/node_modules
_reset.scss
_typography.scss
_prism.scss
public/
src/css/
functions/template.html
*.md
Loading

0 comments on commit 5557bbd

Please sign in to comment.