Giter VIP home page Giter VIP logo

gulp-static-site's People

Contributors

ivanbrykov avatar timaschew avatar wires avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gulp-static-site's Issues

template caching doesn't work

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

specifying template in front matter

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?

plugin doesn't work if you're not working in the root

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')

How would you add dropdown nav?

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.