добавил генерацию /notes/
This commit is contained in:
parent
ee9527214f
commit
51adcae75d
@ -4,6 +4,8 @@ const svgContents = require('eleventy-plugin-svg-contents')
|
||||
const faviconPlugin = require('eleventy-favicon')
|
||||
|
||||
module.exports = (eleventyConfig) => {
|
||||
eleventyConfig.setUseGitIgnore(false)
|
||||
|
||||
eleventyConfig.addPlugin(cagovBuildSystem, {
|
||||
processors: {
|
||||
rollup: {
|
||||
@ -27,6 +29,10 @@ module.exports = (eleventyConfig) => {
|
||||
destination: './dist'
|
||||
})
|
||||
|
||||
eleventyConfig.addCollection('notes', function (collectionApi) {
|
||||
return collectionApi.getFilteredByGlob('src/notes/**/*.md')
|
||||
})
|
||||
|
||||
return {
|
||||
dir: {
|
||||
input: 'src',
|
||||
|
1
src/data/permalink.js
Normal file
1
src/data/permalink.js
Normal file
@ -0,0 +1 @@
|
||||
module.exports = false
|
5
src/pages/index.11tydata.js
Normal file
5
src/pages/index.11tydata.js
Normal file
@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
layout: 'base.njk',
|
||||
|
||||
permalink: '/index.html'
|
||||
}
|
@ -1,7 +1,3 @@
|
||||
---
|
||||
permalink: '/'
|
||||
layout: 'base.njk'
|
||||
---
|
||||
<header class="flex justify-center w-full px-10 py-4">
|
||||
<a href="/" class="block rounded-xl p-1">
|
||||
{{ '/src/images/logo.svg' | svgContents("max-h-24 block w-[50vw]") | safe }}
|
||||
|
11
src/pages/note.11tydata.js
Normal file
11
src/pages/note.11tydata.js
Normal file
@ -0,0 +1,11 @@
|
||||
module.exports = {
|
||||
layout: 'base.njk',
|
||||
|
||||
pagination: {
|
||||
data: 'collections.notes',
|
||||
size: 1,
|
||||
alias: 'note'
|
||||
},
|
||||
|
||||
permalink: '/{{note.filePathStem}}.html'
|
||||
}
|
1
src/pages/note.njk
Normal file
1
src/pages/note.njk
Normal file
@ -0,0 +1 @@
|
||||
{{ note.templateContent | safe }}
|
Reference in New Issue
Block a user