@wernerglinka_twitter
because the CTO wanted a large community and active development
Yes that is unfortunately the circular argument which prevents me too from working with the technologies I like to use, again and again. (circular because if every CTO uses it, ofc. adoption will never grow)
@wernerglinka_twitter I am aware, and I am working on that. See my second post in this room:
[...] resume build example for metalsmith: https://github.com/webketje/metalsmith-starter-resume
you can totally fiddle with it without installing anything: https://repl.it/@webketje/metalsmith-starter-resume
Also for my plugin metalsmith-taxonomy, there are some pretty elaborate up-to-date examples: https://github.com/webketje/metalsmith-taxonomy/tree/master/example
const metalsmith = { path, src, dest }
)I can't give you the reason/ solution right away, but I will test it and report here. In the meantime, it would be good to see more about your setup. You could set up a .replit and paste the link here.
When you choose a new project, you can import your local folder, just don't import the node_modules. Instead add a file at the root called .replit
with these contents:
language = "nodejs"
run = "PORT=8080 HOST='0.0.0.0' npm start"
(and make sure npm start script executes your metalsmith file)
index.html
is one folder up because it is the default language. Hit the Run button to re-build: https://repl.it/@webketje/Metalsmith-blog-2
markdowndata
with an object with the filenames [src/posts/post1.md
=> post1
] of all markdown files as keys, and assign their frontmatter (=metadata) to it:.use((files, metalsmith, done) {
const path = require('path');
const metadata = metalsmith.metadata();
metadata.markdowndata = {};
function filename(filepath) { return path.basename(filepath, '.md'); }
Object.keys(files)
.filter(key => key.endsWith('.md'))
.forEach(key => {
const filemetadata = Object.assign({}, files[key]);
delete filemetadata.contents;
delete filemetadata.stats;
metadata.markdowndata[filename(key)] = filemetadata;
});
});
done();
});
:tada: Great news @webketje ! Thanks so much for taking the initiative on this :pray: Keep us posted and let us know if/how we can meaningfully help.
(I just found the DevRant post I guess you and @BurgundyIsAPublicEnemy were talking about: https://devrant.com/rants/2935556/metalsmith-is-an-older-but-still-awesome-nodejs-static-site-generator-due-to-met )