Skip to content

Commit

Permalink
feat: add resume to website
Browse files Browse the repository at this point in the history
wip

wip

feat: adjustable length
  • Loading branch information
jpoehnelt committed Dec 9, 2023
1 parent 6fa18e8 commit cbc02bb
Show file tree
Hide file tree
Showing 11 changed files with 1,207 additions and 55 deletions.
55 changes: 32 additions & 23 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const htmlmin = require("html-minifier");
const externalLinks = require("@aloskutov/eleventy-plugin-external-links");
const workbox = require("workbox-build");
const htmlParser = require("node-html-parser");
const qrCode = require("qrcode");

module.exports = (config) => {
config.addPassthroughCopy({ "src/static/*": "/" });
Expand All @@ -26,7 +27,11 @@ module.exports = (config) => {
});

config.addFilter("relatedPosts", function (doc, docs) {
return related(doc, docs).filter(({ relative }) => relative > 0.1);
return []; //related(doc, docs).filter(({ relative }) => relative > 0.1);
});

config.addFilter("qrcode", async function (value) {
return await qrCode.toDataURL(value);
});

config.addTransform("htmlmin", (content, outputPath) => {
Expand All @@ -47,7 +52,7 @@ module.exports = (config) => {

root.querySelectorAll("pre").forEach((el) => {
const language = [...el.classList.values()].filter((c) =>
c.startsWith(prefix)
c.startsWith(prefix),
)[0];

el.innerHTML = `<code class="${language}">${el.innerText
Expand Down Expand Up @@ -77,6 +82,10 @@ module.exports = (config) => {

config.setLibrary("md", markdownIt);

config.addFilter("markdownit", function (value) {
return markdownIt.renderInline(value);
});

config.addPlugin(require("eleventy-plugin-nesting-toc"), {
tags: ["h2", "h3", "h4"],
});
Expand All @@ -102,27 +111,27 @@ module.exports = (config) => {
config.addWatchTarget("./public/assets/*");
config.addWatchTarget("./shortcodes/*");

config.on("eleventy.after", async () => {
const options = {
cacheId: "sw",
skipWaiting: true,
clientsClaim: true,
swDest: `public/sw.js`,
globDirectory: "public",
globPatterns: [
"**/*.{html,css,js,mjs,map,jpg,png,gif,webp,ico,svg,woff2,woff,eot,ttf,otf,ttc,json}",
],
runtimeCaching: [
{
urlPattern:
/^.*\.(html|jpg|png|gif|webp|ico|svg|woff2|woff|eot|ttf|otf|ttc|json)$/,
handler: `NetworkOnly`,
},
],
};

await workbox.generateSW(options);
});
// config.on("eleventy.after", async () => {
// const options = {
// cacheId: "sw",
// skipWaiting: true,
// clientsClaim: true,
// swDest: `public/sw.js`,
// globDirectory: "public",
// globPatterns: [
// "**/*.{html,css,js,mjs,map,jpg,png,gif,webp,ico,svg,woff2,woff,eot,ttf,otf,ttc,json}",
// ],
// runtimeCaching: [
// {
// urlPattern:
// /^.*\.(html|jpg|png|gif|webp|ico|svg|woff2|woff|eot|ttf|otf|ttc|json)$/,
// handler: `NetworkOnly`,
// },
// ],
// };

// await workbox.generateSW(options);
// });

return {
markdownTemplateEngine: "njk",
Expand Down
Loading

0 comments on commit cbc02bb

Please sign in to comment.