Giter VIP home page Giter VIP logo

waffel's Introduction

Waffel

Static site generation done right tasty.

Yet another static generator, here to help you with more concrete use cases than just your personal blog.

Getting Started

I strongly recommend you to use Waffel with Brunch, starting with the brunch-with-waffel skeleton:

# in case you do not have Brunch installed yet
$ npm install brunch -g

$ brunch new path/to/project --skeleton https://github.com/moonwave99/brunch-with-waffel
$ cd path/to/project
$ npm install
$ bower install
$ npm start

Visit http://localhost:3333 and you ready to go!

Please have a look at the examples here above or at the doc, in order to get a better grasp on how can Waffel be useful to you.


FAQ

Does Waffel work with different front matter formats (e.g. JSON, TOML,โ€ฆ) rather than YAML?

Not at the moment, though I would be glad to receive a PR in order to make front matter format configurable!

Is there any CLI tool?

No, because brunch, gulp and grunt all make a wonderful job at that.

Does Waffel handle the compilation/concatenation/minification of my CSS/JS code?

No, because brunch, gulp and grunt all make a wonderful job at that.

Can I change template language?

Not at the moment, because I like Nunjucks's expressiveness a lot, and the possibility to chain filters (that allows me to use more logic in templates, since there is no controller layer actually).

Does Waffel provide support for a complex relational model?

Waffel doesn't know anything about your data schema. But as all the loaded data is exposed in the templates via the data property, you can deal with any sort of composition (e.g. data.users[post.author]). It is the price to pay for not having to write a schema, but I don't find it very expensive : ))

In case you really need a complex query mechanism, chances are that you need a different stack.

Are there plugins? Is there a way to write any?

Writing a plugin for such a specific tool usually ends up in following a narrow DSL, with no real benefit on top of the hassle.
You can include even complicate filters and helpers, that can be used all over the HTML template codes.

Nevertheless, have a look at the examples up here, they may help you to achieve your goal!


Test

Stare at the green fields via:

$ npm run test

License

The MIT License (MIT)

Copyright (c) 2019 Diego Caponera

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

waffel's People

Contributors

dependabot[bot] avatar moonwave99 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

waffel's Issues

Jekyll example doesn't render `/blog` sources

Tried following the article listed regarding a blog-like rendering experience in Waffel, but it fails to generate any of my /data/blog/... contents into the /public directory. Below is the site.yml I'm using per the Jekyll example instructions on http://moonwave99.github.io/waffel/examples/cinema-blog-ala-jekyll/

config:
    title:                  Your Awesome Website
    google_analytics:       UA-XXXXXXX-Y
    google_webmaster_tools: xyz
    google_fonts:
        Ubuntu: 400,700,400italic
        Arvo:   400,700,400italic
structure:
    home:
        template:   home
        url:        /
    about:
        template:   about
        url:        /about
    blog:
        collection: posts
        pages:
            index:
                template:   blog/index
                url:        /blog
                priority:   0.5
                sort:
                    field: date
                    order: desc
            categories:
                template:   blog/category
                url:        /blog/category/:category
                groupBy:    category
                priority:   0.5
                sort:
                    field: date
                    order: desc
            tags:
                template:   blog/tag
                url:        /blog/tag/:tag
                groupBy:    tags
                changefreq: weekly
                priority: 0.7
                sort:
                    field: date
                    order: desc
            single:
                template:   blog/post
                url:        /blog/posts/:slug
                priority:   0.8
    404:
        template:   '404'
        url:        /404
        sitemap:    false

site.yml configuration semantics

The configuration file site.yml has lots of options, as indicated by the few examples.

Nothing I have tried seems to work, though.

brunch build vs watch

The waffle html pipelines only seem active with brunch watch --server -- that is, brunch build does not generate any html files in the public directory.

Or is this only on my 'puter?

`data.pages` property is named `data.undefined` for some reason

Testing out Waffel for the first time and have followed the documentation to get a working site together. The problem I've run into is the about page content from the brunch-with-waffel base repo disappeared from the rendered page... wrote up a simple |json filter and dumped the data object, and it seems that the data.PROPERTY names are getting garbled and returning undefined...

{
  "undefined": {   // <--- this guy should be `pages` per the documentation I'm referencing
    "about": {
      "title": "About me",
      "description": "custom page description here DKDKDLSJFKSLFD",
      "__content": "\r\nThis is the about page.\r\n\r\n- it renders\r\n- some [**markdown**](http://daringfireball.net/projects/markdown/syntax)\r\n- _and not much more else_.\r\n\r\n~~strikethrough is cool~~\r\n\r\n`code too`\r\n\r\n> I swear!\r\n",
      "slug": "about"
    }
  }
}

Folder structure provided by brunch-with-waffel:

|-- /my-app
|   |-- /app
|   |-- /data
|   |   \-- /pages
|   |       \-- about.md
|   |-- /lib
|   |-- /locales
|   |-- /public
|   |-- /views
|   \-- ...

Generate slow

Sorry, I do not know English [gg translate]

Generate slow

I have about 2000 files .md takes about 10 minutes to generate.

Ubuntu 14.04
Nodejs: v6.2.1

Thanks.

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.