Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 37 additions & 3 deletions .eleventy.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,44 @@ module.exports = function(eleventyConfig) {
* @link https://www.11ty.io/docs/shortcodes/
*/
Object.keys(shortcodes).forEach((shortcodeName) => {
eleventyConfig.addNunjucksAsyncShortcode("image", shortcodes[shortcodeName]);
eleventyConfig.addLiquidShortcode("image", shortcodes[shortcodeName]);
eleventyConfig.addJavaScriptFunction("image", shortcodes[shortcodeName]);
eleventyConfig.addNunjucksAsyncShortcode(shortcodeName, shortcodes[shortcodeName]);
eleventyConfig.addLiquidShortcode(shortcodeName, shortcodes[shortcodeName]);
eleventyConfig.addJavaScriptFunction(shortcodeName, shortcodes[shortcodeName]);
})

eleventyConfig.addUrlTransform(({url}) => {
const postsFolderName = '/posts'

if(url.startsWith(postsFolderName)) {
return url.slice(postsFolderName.length)
}
});

eleventyConfig.addUrlTransform(({url}) => {
console.log(url)
const postsFolderName = 'privacy'

if(url.startsWith(postsFolderName)) {
return url.slice(postsFolderName.length)
}
});

// eleventyConfig.addUrlTransform(({url}) => {
// // `url` is guaranteed to be a string here even if you're using `permalink: false`
// const postsFolderName = 'posts'
// const defaultFileName = 'index'
// const postfixLocalisation = '\.[a-z]{2}'
// const reLocalisedIndexFile = new RegExp(`(${postsFolderName}\/)?(.+)\/(${defaultFileName})?${postfixLocalisation}\.html`)
// const matchLocalisedPosts = url.match(reLocalisedIndexFile)
// const hasLocalisedIndexFile = matchLocalisedPosts.length === 3
// const hasLocalisation = matchLocalisedPosts.length === 1 || hasLocalisedIndexFile

// if(hasLocalisation) {
// console.log()
// }
// // Returning undefined skips the url transform.
// });

eleventyConfig.addDataExtension("csv", async (contents) => {
const rows = []

Expand Down Expand Up @@ -83,6 +116,7 @@ module.exports = function(eleventyConfig) {
eleventyConfig.setDataDeepMerge(true);

eleventyConfig.addWatchTarget('./src/assets/css/**/*.css');
eleventyConfig.addWatchTarget('./src/utils/**/*.js');

/**
* Override BrowserSync Server options
Expand Down
1 change: 1 addition & 0 deletions .frontmatter/content/mediaDb.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
8 changes: 8 additions & 0 deletions .frontmatter/templates/post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title:
description:
date:
tags:
-
draft: true
---
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules/
.cache/
.vercel/
.env
.DS_Store
Empty file modified api/music/index.js
100644 → 100755
Empty file.
Empty file added csv2md.js
Empty file.
15 changes: 4 additions & 11 deletions frontmatter.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@
"$schema": "https://frontmatter.codes/frontmatter.schema.json",
"frontMatter.content.pageFolders": [
{
"title": "blog",
"path": "[[workspace]]/src/blog"
},
{
"title": "code",
"path": "[[workspace]]/src/code"
},
{
"title": "speeches",
"path": "[[workspace]]/src/speeches"
"title": "posts",
"path": "[[workspace]]/src/en/posts"
}
]
],
"frontMatter.framework.id": "11ty"
}
Loading