Giter Club home page Giter Club logo

grunt-stencil's People

Contributors

elisehein avatar szymonrw avatar verdammelt 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grunt-stencil's Issues

Undefined dependencies

Hi!

After adding grunt-stencil to my package.json file and installing, I got several errors about some packages not being installed. Specifically: underscore, marked and dot. I fixed it by adding them to my package.json file. I'm not sure if those were meant to be runtime dependencies or not (I only see them under devDependencies in stencil's package.json). Just wanted to give you a heads up.

make partital file format configurable

at the moment all files for the dot.js parser has to end with .dot.html. plsease make this configurable so we can set dot.js templates to file ending .123 for example

well formatted html output?

hi, first thanks for stencil i like it :)
is there any way to get well formatted html out of stencil? with default settings it just generates a single line html file :(

Collapsed HTML

Stencil has made my day. One thing though...Is there a way to preserve the HTML indentation structure? When it generates the output file it collapses/minifies the HTML, but I need the markup to be formatted.

Thanks much.

Processing pages from root (including subdirectories)

I'm trying to get Stencil to work with a structure resembling that of Jekyll (which is a nice way of structuring a static site's source in my opinion). It involves prefixing all folders that are used for processing the templates with an underscore.

Everything seems to work, but the only part that's giving me trouble is the pages themselves. In my config I'm ignoring all folders prefixed with a dot or an underscore, which works. I'm trying to process all .dot.html files from the root onwards, but when I do this I get the following error message:

Warning: The file ./_includes/with_header.* cannot be found. Use --force to continue.

Which is strange since that include does not exist, and isn't even referenced anywhere in my code... When I set the cwd to _pages and include my .dot.html files there everything works just fine.

Any idea why this is? I've included my configuration below (I'm using load-grunt-config btw.):

module.exports = {
  main: {
    options: {
      env: {
        title: "Stencil"
      },
      templates: "./_templates",
      partials: "./_includes"
    },
    files: [{
        expand: true,
        cwd: "./_pages/",
        src: ["**/*.dot.html", "!_**/*", "!.**/*"],
        dest: "./_dist",
        ext: ".html",
        flatten: false
    }]
  }
};

Output indentation is breaking

I had a template: default-page.dot.html

<body>
  {{= it.document }}
</body>

A page: index.dot.html

{
  "template": "default-page"
}

<div>
  <h1>Title</h1>
</div>

And output this:

<body>
  <div>
  <h1>Title</h1>
</div>
</body>

I've tried different places for the {{= it.document }} but still breaks.

passing options to marked

@brainshave I want to enable GFM and Tables in marked. I can't create an issue on the Zetzer fork - can you transfer ownership/enable issues on brainshave/zetzer ? If you don't have this on your immediate roadmap I would be happy to fork and PR :)

Partials in pages isn't working

So I have my template which pulls in my page, then in my page I have:
{{ it.include("personal_step_one") }}

But that partial isn't getting pulled in, any ideas??

How to access meta-data from parent with partials

Okay, I'm doing something wrong when I'm trying to access the meta-data of the "main.dot.html" from the partial "product.dot.html"

main.dot.html

{
    "pTitle": "iddqd"
}

<div class="products">
    {{= it.include('partials/product.dot.html') }}
</div>

product.dot.html

<h1>{{= it.pTitle }}</h1>

Output

<div class="products">
    <h1>undefined</h1>
</div>

Documentation unclear with option meta_data_separator

I spent a couple hours trying to get this to work (on Windows) and was about to give up until I saw the meta_data_separator and was able to add in "\r\n\r\n" to get it to work in Windows.

I wonder somehow this option can be discarded since it'll cause a lot of cross-platform issues. I'd like to use grunt-stencil for some of our work but I'd like it work on both Windows and Mac/Linux.

Could an array work for that parameters so I could use:

meta_data_separator: ["\r\n\r\n", "\n\n"] so it's cross-platform compatible?

Access meta data fields in template

Hello,

I try to acces some meta data fields from a page into the layout (using it.document.var_name) but grunt keep throw an error:
* "Cannot read property 'page_title' of undefined Use".*

Any ideas ?

index.dot.html

{
  "template": "main",
  "page_title": "home"
}

<div class="page">
    <!-- Some Content -->
</div>

main.dot.html

<div class="{{= it.document.page_title }}">
    {{= it.document }}
</div>

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.