upgrade to eleventy 3.0.0
This commit is contained in:
parent
246b0234cb
commit
f3bab3e9d6
8 changed files with 30 additions and 80 deletions
|
@ -1,11 +1,9 @@
|
||||||
module.exports = {
|
export const title = "nycki.net";
|
||||||
title: "nycki.net",
|
export const url = "https://nycki.net";
|
||||||
url: "https://nycki.net",
|
export const language = "en";
|
||||||
language: "en",
|
export const description = "nycki.net";
|
||||||
description: "nycki.net",
|
export const author = {
|
||||||
author: {
|
name: "Your Name Here",
|
||||||
name: "Your Name Here",
|
email: "youremailaddress@example.com",
|
||||||
email: "youremailaddress@example.com",
|
url: "https://example.com/about-me/"
|
||||||
url: "https://example.com/about-me/"
|
};
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,3 +1 @@
|
||||||
module.exports = {
|
export const eleventyExcludeFromCollections = true;
|
||||||
eleventyExcludeFromCollections: true
|
|
||||||
}
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ permalink: /blog/feed.xml
|
||||||
<title>{{ metadata.title }}</title>
|
<title>{{ metadata.title }}</title>
|
||||||
<subtitle>{{ metadata.description }}</subtitle>
|
<subtitle>{{ metadata.description }}</subtitle>
|
||||||
<link href="{{ permalink | htmlBaseUrl(metadata.url) }}" rel="self"/>
|
<link href="{{ permalink | htmlBaseUrl(metadata.url) }}" rel="self"/>
|
||||||
<link href="{{ metadata.url | addPathPrefixToFullUrl }}"/>
|
<link href="{{ metadata.url | htmlBaseUrl }}"/>
|
||||||
<updated>{{ collections.posts | getNewestCollectionItemDate | dateToRfc3339 }}</updated>
|
<updated>{{ collections.posts | getNewestCollectionItemDate | dateToRfc3339 }}</updated>
|
||||||
<id>{{ metadata.url }}</id>
|
<id>{{ metadata.url }}</id>
|
||||||
<author>
|
<author>
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
---
|
|
||||||
# Metadata comes from _data/metadata.js
|
|
||||||
permalink: /blog/feed.json
|
|
||||||
---
|
|
||||||
{
|
|
||||||
"version": "https://jsonfeed.org/version/1.1",
|
|
||||||
"title": "{{ metadata.title }}",
|
|
||||||
"language": "{{ metadata.language }}",
|
|
||||||
"home_page_url": "{{ metadata.url | addPathPrefixToFullUrl }}",
|
|
||||||
"feed_url": "{{ permalink | htmlBaseUrl(metadata.url) }}",
|
|
||||||
"description": "{{ metadata.description }}",
|
|
||||||
"author": {
|
|
||||||
"name": "{{ metadata.author.name }}",
|
|
||||||
"url": "{{ metadata.author.url }}"
|
|
||||||
},
|
|
||||||
"items": [
|
|
||||||
{%- for post in collections.posts | reverse %}
|
|
||||||
{%- set absolutePostUrl = post.url | htmlBaseUrl(metadata.url) %}
|
|
||||||
{
|
|
||||||
"id": "{{ absolutePostUrl }}",
|
|
||||||
"url": "{{ absolutePostUrl }}",
|
|
||||||
"title": "{{ post.data.title }}",
|
|
||||||
"content_html": {% if post.templateContent %}{{ post.templateContent | transformWithHtmlBase(absolutePostUrl, post.url) | dump | safe }}{% else %}""{% endif %},
|
|
||||||
"date_published": "{{ post.date | dateToRfc3339 }}"
|
|
||||||
}
|
|
||||||
{% if not loop.last %},{% endif %}
|
|
||||||
{%- endfor %}
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
module.exports = {
|
export default {
|
||||||
tags: [
|
tags: [
|
||||||
"posts"
|
"posts"
|
||||||
],
|
],
|
||||||
|
|
|
@ -24,10 +24,12 @@ function eleventyComputedExcludeFromCollections() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.eleventyComputedPermalink = eleventyComputedPermalink;
|
const _eleventyComputedPermalink = eleventyComputedPermalink;
|
||||||
module.exports.eleventyComputedExcludeFromCollections = eleventyComputedExcludeFromCollections;
|
export { _eleventyComputedPermalink as eleventyComputedPermalink };
|
||||||
|
const _eleventyComputedExcludeFromCollections = eleventyComputedExcludeFromCollections;
|
||||||
|
export { _eleventyComputedExcludeFromCollections as eleventyComputedExcludeFromCollections };
|
||||||
|
|
||||||
module.exports = eleventyConfig => {
|
export default eleventyConfig => {
|
||||||
eleventyConfig.addGlobalData("eleventyComputed.permalink", eleventyComputedPermalink);
|
eleventyConfig.addGlobalData("eleventyComputed.permalink", eleventyComputedPermalink);
|
||||||
eleventyConfig.addGlobalData("eleventyComputed.eleventyExcludeFromCollections", eleventyComputedExcludeFromCollections);
|
eleventyConfig.addGlobalData("eleventyComputed.eleventyExcludeFromCollections", eleventyComputedExcludeFromCollections);
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,13 @@
|
||||||
const { DateTime } = require("luxon");
|
import { DateTime } from "luxon";
|
||||||
const markdownItAnchor = require("markdown-it-anchor");
|
import pluginSyntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight";
|
||||||
|
import { EleventyHtmlBasePlugin } from "@11ty/eleventy";
|
||||||
|
import pluginRss from '@11ty/eleventy-plugin-rss';
|
||||||
|
import pluginUpgrade from '@11ty/eleventy-upgrade-help';
|
||||||
|
|
||||||
const pluginRss = require("@11ty/eleventy-plugin-rss");
|
import pluginDrafts from "./eleventy.config.drafts.js";
|
||||||
const pluginSyntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
|
|
||||||
const pluginBundle = require("@11ty/eleventy-plugin-bundle");
|
|
||||||
const pluginNavigation = require("@11ty/eleventy-navigation");
|
|
||||||
const { EleventyHtmlBasePlugin } = require("@11ty/eleventy");
|
|
||||||
|
|
||||||
const pluginDrafts = require("./eleventy.config.drafts.js");
|
|
||||||
|
|
||||||
/** @param {import('@11ty/eleventy').UserConfig} eleventyConfig */
|
/** @param {import('@11ty/eleventy').UserConfig} eleventyConfig */
|
||||||
module.exports = function(eleventyConfig) {
|
export default function(eleventyConfig) {
|
||||||
if (process.env.NODE_ENV === 'localhost') {
|
if (process.env.NODE_ENV === 'localhost') {
|
||||||
console.log('metadata override');
|
console.log('metadata override');
|
||||||
eleventyConfig.addGlobalData('metadata.url', 'http://localhost:8080');
|
eleventyConfig.addGlobalData('metadata.url', 'http://localhost:8080');
|
||||||
|
@ -30,16 +27,15 @@ module.exports = function(eleventyConfig) {
|
||||||
|
|
||||||
// App plugins
|
// App plugins
|
||||||
eleventyConfig.addPlugin(pluginDrafts);
|
eleventyConfig.addPlugin(pluginDrafts);
|
||||||
// eleventyConfig.addPlugin(pluginImages);
|
|
||||||
|
|
||||||
// Official plugins
|
// Official plugins
|
||||||
eleventyConfig.addPlugin(pluginRss);
|
eleventyConfig.addBundle('css');
|
||||||
eleventyConfig.addPlugin(pluginSyntaxHighlight, {
|
eleventyConfig.addPlugin(pluginSyntaxHighlight, {
|
||||||
preAttributes: { tabindex: 0 }
|
preAttributes: { tabindex: 0 }
|
||||||
});
|
});
|
||||||
eleventyConfig.addPlugin(pluginNavigation);
|
|
||||||
eleventyConfig.addPlugin(EleventyHtmlBasePlugin);
|
eleventyConfig.addPlugin(EleventyHtmlBasePlugin);
|
||||||
eleventyConfig.addPlugin(pluginBundle);
|
eleventyConfig.addPlugin(pluginRss);
|
||||||
|
eleventyConfig.addPlugin(pluginUpgrade);
|
||||||
|
|
||||||
// Filters
|
// Filters
|
||||||
eleventyConfig.addFilter("readableDate", (dateObj, format, zone) => {
|
eleventyConfig.addFilter("readableDate", (dateObj, format, zone) => {
|
||||||
|
@ -96,20 +92,6 @@ module.exports = function(eleventyConfig) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Customize Markdown library settings:
|
|
||||||
eleventyConfig.amendLibrary("md", mdLib => {
|
|
||||||
mdLib.use(markdownItAnchor, {
|
|
||||||
permalink: markdownItAnchor.permalink.ariaHidden({
|
|
||||||
placement: "after",
|
|
||||||
class: "header-anchor",
|
|
||||||
symbol: "#",
|
|
||||||
ariaHidden: false,
|
|
||||||
}),
|
|
||||||
level: [1,2,3,4],
|
|
||||||
slugify: eleventyConfig.getFilter("slugify")
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
eleventyConfig.addShortcode("currentBuildDate", () => {
|
eleventyConfig.addShortcode("currentBuildDate", () => {
|
||||||
return (new Date()).toISOString();
|
return (new Date()).toISOString();
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
"name": "eleventy-base-blog",
|
"name": "eleventy-base-blog",
|
||||||
"version": "8.0.0",
|
"version": "8.0.0",
|
||||||
"description": "A starter repository for a blog web site using the Eleventy site generator.",
|
"description": "A starter repository for a blog web site using the Eleventy site generator.",
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npx @11ty/eleventy",
|
"build": "npx @11ty/eleventy",
|
||||||
"build-ghpages": "npx @11ty/eleventy --pathprefix=/eleventy-base-blog/",
|
"build-ghpages": "npx @11ty/eleventy --pathprefix=/eleventy-base-blog/",
|
||||||
|
@ -33,12 +34,10 @@
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/11ty/eleventy-base-blog#readme",
|
"homepage": "https://github.com/11ty/eleventy-base-blog#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@11ty/eleventy": "^2.0.1",
|
"@11ty/eleventy": "^3.0.0",
|
||||||
"@11ty/eleventy-img": "^3.1.1",
|
|
||||||
"@11ty/eleventy-navigation": "^0.3.5",
|
|
||||||
"@11ty/eleventy-plugin-bundle": "^1.0.4",
|
|
||||||
"@11ty/eleventy-plugin-rss": "^1.2.0",
|
"@11ty/eleventy-plugin-rss": "^1.2.0",
|
||||||
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
|
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
|
||||||
|
"@11ty/eleventy-upgrade-help": "^3.0.1",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"luxon": "^3.3.0",
|
"luxon": "^3.3.0",
|
||||||
"markdown-it-anchor": "^8.6.7"
|
"markdown-it-anchor": "^8.6.7"
|
||||||
|
|
Loading…
Reference in a new issue