Comments (6)
Unfortunately I can't reproduce that error, what does your eleventyConfig
look like?
from eleventy-plugin-svelte.
Here it is (I have to admit to not knowing much about configuring either eleventy or rollup):
`const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight');
const markdownIt = require('markdown-it');
const markDownItClass = require('@toycode/markdown-it-class');
const EleventySvelte = require('eleventy-plugin-svelte');
const postcss = require('rollup-plugin-postcss');
const terser = require('rollup-plugin-terser').terser;
const dev = process.env.NODE_ENV === 'development'
const md = markdownIt({linkify: true, html: true});
module.exports = function (eleventyConfig) {
eleventyConfig.addWatchTarget("./_tmp/style.css");
eleventyConfig.addPassthroughCopy({ "./_tmp/style.css": "./css/style.css" });
eleventyConfig.addPassthroughCopy('src/css');
eleventyConfig.addPassthroughCopy('src/js');
eleventyConfig.addPassthroughCopy('src/img');
eleventyConfig.addPlugin(syntaxHighlight);
eleventyConfig.addPlugin(EleventySvelte, {
rollupPluginSvelteSSROptions: {
dev,
},
rollupPluginSvelteClientOptions: {
dev,
emitCss: true,
},
rollupClientPlugins: [postcss(), !dev && terser()],
});
eleventyConfig.addShortcode("version", function () {
return String(Date.now());
});
return {
dir: {
input: 'src',
// templateFormats: ['md', 'njk', 'svelte']
// includes: 'includes',
// layouts: 'layouts'
},
passthroughFileCopy: true
}
}`
from eleventy-plugin-svelte.
It looks like it's happening when I try to specify the main.njk
layout in the frontmatter of the md file. when I leave it out it processes the md file with no layout.
I've tried specifying a 11ty.svelte
file as a layout for the markdown, which I know is not a feature, but it does process the layout file with no templateContent data. So ... I'm guessing I need to figure out how to access templateContent
.
from eleventy-plugin-svelte.
Oh, hey, it's right there on data._templateContent
!
I think I just misunderstood how to specify templates for markdown files. As long as I provide a 11ty.svelte
file for the markdown template I should be able to access all of the template's data.
from eleventy-plugin-svelte.
Oh I could reproduce it now. You shouldn't have to jump through all these hoops to get there. The problem is, that the shortcode to load the svelte client tries to find the component but obviously can't find one for the md
file. I'll publish a fix!
from eleventy-plugin-svelte.
The fix is up in version 1.0.4
from eleventy-plugin-svelte.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eleventy-plugin-svelte.