|
1 | | -const { DateTime } = require('luxon') |
2 | | - |
3 | | -const pluginSyntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight') |
4 | | -const pluginBundle = require('@11ty/eleventy-plugin-bundle') |
5 | | -const pluginNavigation = require('@11ty/eleventy-navigation') |
6 | | -const { EleventyHtmlBasePlugin } = require('@11ty/eleventy') |
7 | | -const pluginFavicon = require('eleventy-favicon') |
8 | | -const CleanCSS = require('clean-css') |
9 | | -const fs = require('node:fs') |
10 | | -const path = require('node:path') |
11 | | -const { exec } = require('node:child_process') |
12 | | - |
13 | | -const pluginImages = require('./eleventy.config.images.js') |
14 | | -const tracToHTML = require('./eleventy.config.tracToHTML.js') |
15 | | - |
16 | | -module.exports = function (eleventyConfig) { |
| 1 | +import { EleventyHtmlBasePlugin } from '@11ty/eleventy' |
| 2 | +import pluginNavigation from '@11ty/eleventy-navigation' |
| 3 | +import pluginBundle from '@11ty/eleventy-plugin-bundle' |
| 4 | +import pluginSyntaxHighlight from '@11ty/eleventy-plugin-syntaxhighlight' |
| 5 | +import CleanCSS from 'clean-css' |
| 6 | +import pluginFavicon from 'eleventy-favicon' |
| 7 | +import { DateTime } from 'luxon' |
| 8 | +import { exec } from 'node:child_process' |
| 9 | +import fs from 'node:fs' |
| 10 | +import path from 'node:path' |
| 11 | +import pluginImages from './eleventy.config.images.js' |
| 12 | +import tracToHTML from './eleventy.config.tracToHTML.js' |
| 13 | + |
| 14 | +export default function config(eleventyConfig) { |
17 | 15 | // Copy the contents of the `public` folder to the output folder |
18 | 16 | // For example, `./public/css/` ends up in `_site/css/` |
19 | 17 | eleventyConfig.addPassthroughCopy({ |
@@ -157,7 +155,7 @@ module.exports = function (eleventyConfig) { |
157 | 155 |
|
158 | 156 | eleventyConfig.addAsyncShortcode('attachment', async (ticketId, filename) => { |
159 | 157 | const content = await fs.promises.readFile( |
160 | | - path.join(__dirname, `raw-attachment/ticket/${ticketId}`, filename) |
| 158 | + path.resolve(`./raw-attachment/ticket/${ticketId}`, filename) |
161 | 159 | ) |
162 | 160 | return content.toString() |
163 | 161 | }) |
|
0 commit comments