add localImages plugin

This commit is contained in:
James Walker 2022-09-14 12:23:30 -04:00
parent 1289031973
commit c023d0e7e4
Signed by: walkah
GPG Key ID: 3C127179D6086E93
4 changed files with 2705 additions and 716 deletions

View File

@ -3,6 +3,7 @@ require("dotenv").config();
const GhostContentAPI = require("@tryghost/content-api");
const pluginNavigation = require("@11ty/eleventy-navigation");
const pluginRss = require("@11ty/eleventy-plugin-rss");
const localImages = require('eleventy-plugin-local-images');
const api = new GhostContentAPI({
url: process.env.GHOST_API_URL,
@ -14,12 +15,19 @@ const stripDomain = url => {
return url.replace(process.env.GHOST_API_URL, "");
};
module.exports = function(eleventyConfig) {
module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(pluginNavigation);
eleventyConfig.addPlugin(pluginRss);
eleventyConfig.addPassthroughCopy("css");
eleventyConfig.addPlugin(localImages, {
distPath: '_site',
assetPath: '/assets/images',
selector: 'img',
verbose: false
});
eleventyConfig.addCollection("posts", async function (collection) {
collection = await api.posts
.browse({

View File

@ -8,7 +8,7 @@ pagination:
{% block content %}
{% set postslist = collections.posts %}
<section class="h-feed prose">
<section class="h-feed prose dark:prose-invert">
{% for post in postslist %}
<article class="h-entry">
<h2 class="p-name">

3404
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -24,8 +24,9 @@
"@tailwindcss/typography": "^0.5.2",
"@tryghost/content-api": "^1.9.4",
"dotenv": "^16.0.1",
"eleventy-plugin-local-images": "^0.4.1",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.2",
"tailwindcss": "^3.0.24"
}
}
}