wires / gulp-static-site Goto Github PK
View Code? Open in Web Editor NEWGulp plugin to render static site
Gulp plugin to render static site
This plugin is a duplicate of gulp-jade
I recommend Unpublishing this plugin.
templates are not cached properly
[14:17:41] File tree
.
├── Gulp.html
├── NODE.html
└── index.html
[14:17:41] loading template: templates/default.jade
[14:17:41] loading template: templates/default.jade
[14:17:41] loading template: templates/default.jade
[14:17:41] compiled template: templates/default.jade
[14:17:41] rendering [default] "Gulp.html"
[14:17:42] compiled template: templates/default.jade
[14:17:42] rendering [default] "NODE.html"
[14:17:42] compiled template: templates/default.jade
[14:17:42] rendering [default] "index.html"
stuff still works fine, but it's slow
I was messing around with this last weekend and pretty quickly figured out that the frontmatter isn't being parsed or used at the moment. I hacked it to work for me (to specify the template to use), but would you welcome a PR to get it working in this repo?
Hi. How can I pass data to the jade template with your plugin?
I have all my files in a src
directory. So I start it with this lines:
gulp.task('site', function () {
gulp.src('src/contents/**/*.md')
.pipe(static_site())
.pipe(gulp.dest('build/'))
});
But the problem occurs when your plugin tries to load the template which is assumed to be located always in the (gulp) root directory?
https://github.com/wires/gulp-static-site/blob/master/index.js#L90
I tried to change the exporting module, add an options argument:
var options = {}
module.exports = function(opts) {
options = opts;
.pipe($.marked)
lazypipe()
.pipe($.map, extended_attributes)
.pipe($.marked)
//// .pipe(resolve_wiki_links)
.pipe($.filetree)
.pipe(show_tree_once)
.pipe(render_tmpl)
.pipe($.size)
but even If I bind the context of lazypipe
to the outer scope, it doesn't work, I get this error:
[10:13:25] 'site' errored after 12 ms
[10:13:25] TypeError: Cannot read property 'on' of undefined
at DestroyableTransform.Readable.pipe (/Users/awilhelm/dev/musik-kuntschule/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:516:7)
at Gulp.<anonymous> (/Users/awilhelm/dev/musik-kuntschule/gulp/index.js:41:10)
at module.exports (/Users/awilhelm/dev/musik-kuntschule/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/Users/awilhelm/dev/musik-kuntschule/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/Users/awilhelm/dev/musik-kuntschule/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/Users/awilhelm/dev/musik-kuntschule/node_modules/orchestrator/index.js:134:8)
at runNextSet (/Users/awilhelm/dev/musik-kuntschule/node_modules/run-sequence/index.js:88:16)
at runSequence (/Users/awilhelm/dev/musik-kuntschule/node_modules/run-sequence/index.js:99:2)
at Gulp.<anonymous> (/Users/awilhelm/dev/musik-kuntschule/gulp/index.js:15:2)
at module.exports (/Users/awilhelm/dev/musik-kuntschule/node_modules/orchestrator/lib/runTask.js:34:7)
[10:13:25] 'dev' errored after 18 ms
So for now I fixed it via a hardcoded line:
//TODO: how to make this configurable?
var baseDir = 'src/'
return compile_template(baseDir + 'templates/' + t + '.jade')
Here you have a linear nav option
each node in page.tree.nodes
if node.leaf
li
a(href=node.leaf.href)= node.leaf.shortName
If there were sub folders in content/, how would you put a ul inside of an li?
tree:
-content/
–index.md
–company.md
–company/
– –about.md
– –newsroom.md
– –newsroom.md
–services.md
each node in page.tree.nodes
if node.leaf
li
a(href=node.leaf.href)= node.leaf.shortName
if node.nodes.leaf
ul
li
a(href=node.leaf.href)= node.leaf.shortName
Support different template rendering mechanisms, not sure yet how to fit it in
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.