Skip to content

Commit 8a301d4

Browse files
Redesign personal webiste
1 parent 151d267 commit 8a301d4

File tree

180 files changed

+399
-9714
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+399
-9714
lines changed

.eleventy.js

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
const { DateTime, Settings } = require("luxon");
2+
const fs = require("fs");
3+
const pluginRss = require("@11ty/eleventy-plugin-rss");
4+
const readingTime = require('eleventy-plugin-reading-time');
5+
const path = require("path");
6+
7+
Settings.defaultLocale = 'en-US';
8+
9+
10+
module.exports = function (eleventyConfig) {
11+
eleventyConfig.addPlugin(pluginRss);
12+
eleventyConfig.addPlugin(readingTime);
13+
14+
eleventyConfig.setDataDeepMerge(true);
15+
16+
eleventyConfig.addFilter("readableDate", dateObj => {
17+
if (dateObj instanceof String) {
18+
dateObj = new Date(dateObj);
19+
}
20+
return DateTime.fromJSDate(dateObj, { zone: 'utc' }).toFormat("dd LLLL yyyy");
21+
});
22+
23+
eleventyConfig.addFilter("toISOString", dateObj => {
24+
if (dateObj instanceof String) {
25+
dateObj = new Date(dateObj)
26+
}
27+
return dateObj.toISOString();
28+
});
29+
30+
eleventyConfig.addFilter("getTime", dateObj => {
31+
if (dateObj instanceof String) {
32+
dateObj = new Date(dateObj)
33+
}
34+
return dateObj.getTime();
35+
});
36+
37+
// https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-date-string
38+
eleventyConfig.addFilter('htmlDateString', dateObj => {
39+
return DateTime.fromJSDate(dateObj, { zone: 'utc' }).toFormat('yyyy-LL-dd');
40+
});
41+
42+
eleventyConfig.addFilter('slugDate', dateObj => {
43+
return DateTime.fromJSDate(dateObj, { zone: 'utc' }).toFormat('yyyy/LL/dd');
44+
})
45+
46+
// Get the first `n` elements of a collection.
47+
eleventyConfig.addFilter("head", (array, n) => {
48+
if (n < 0) {
49+
return array.slice(n);
50+
}
51+
52+
return array.slice(0, n);
53+
});
54+
55+
// Filter source file names using a glob
56+
57+
eleventyConfig.addPassthroughCopy("img");
58+
eleventyConfig.addPassthroughCopy("css");
59+
eleventyConfig.addPassthroughCopy('robots.txt')
60+
eleventyConfig.addPassthroughCopy('humans.txt')
61+
eleventyConfig.addPassthroughCopy('manifest.json')
62+
eleventyConfig.addPassthroughCopy('.well-known')
63+
64+
// Browsersync Overrides
65+
eleventyConfig.setBrowserSyncConfig({
66+
callbacks: {
67+
ready: function (err, browserSync) {
68+
// browserSync.addMiddleware("*", (req, res) => {
69+
// const content_404 = fs.readFileSync('_site/404.html'));
70+
// res.writeHead(404, { "ContentType": "text/html; charset=UTF-8" })
71+
// res.write(content_404);
72+
// res.end();
73+
// });
74+
},
75+
},
76+
ui: false,
77+
ghostMode: false
78+
});
79+
80+
return {
81+
templateFormats: [
82+
"md",
83+
"njk",
84+
"html",
85+
"liquid"
86+
],
87+
88+
// If your site lives in a different subdirectory, change this.
89+
// Leading or trailing slashes are all normalized away, so don’t worry about those.
90+
91+
// If you don’t have a subdirectory, use "" or "/" (they do the same thing)
92+
// This is only used for link URLs (it does not affect your file structure)
93+
// Best paired with the `url` filter: https://www.11ty.io/docs/filters/url/
94+
95+
// You can also pass this in on the command line using `--pathprefix`
96+
// pathPrefix: "/",
97+
98+
markdownTemplateEngine: "njk",
99+
htmlTemplateEngine: "njk",
100+
dataTemplateEngine: "njk",
101+
102+
// These are all optional, defaults are shown:
103+
dir: {
104+
input: ".",
105+
includes: "_includes",
106+
data: "_data",
107+
output: "_site"
108+
}
109+
};
110+
};

.eleventyignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
README.md
2+
_11ty/

.gitignore

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
_site/
2-
.idea/
3-
.DS_store
2+
node_modules/
3+
package-lock.json
4+
credentials.json
5+
.env
6+
token.json
7+
.DS_Store
8+
9+
# Local Netlify folder
10+
.netlify
11+
12+
.idea/*

.vscode/settings.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

CNAME

Lines changed: 0 additions & 1 deletion
This file was deleted.

Gemfile

Lines changed: 0 additions & 3 deletions
This file was deleted.

Gemfile.lock

Lines changed: 0 additions & 249 deletions
This file was deleted.

0 commit comments

Comments
 (0)