Code Monkey home page Code Monkey logo

hexo-renderer-handlebars's People

Contributors

briangonzalez avatar jaredly avatar klaronix 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hexo-renderer-handlebars's Issues

Can't pass `class` to `link_to` helper

The built-in link_to helper allows a class to be passed into it, but it doesn't appear the Handlebars version allows that to happen. I would like to be able to do something like this:

{{link_to page.next "Next" class="next"}}

old version on npm

Hey @jaredly,

seems like the "latest" additions of #6 are not published to npm, there's still the Hexo 2.x version with handlebars 1.3 available.

Would be great if you can bump the version and publish it to npm!

Thanks

Iterating over posts complicated

Just for curiosity: how do you iterate over page.posts/site.posts/tags, ...? After trying a lot of different ways, I ended up with two possibilities:

{{#with page.posts}}
{{#each ../page.posts.toArray}}
...
{{/each}
{/with}}

This works if you don't want to limit posts; you will iterate over all of them (can't change ordering either). Other possiblity: create a helper which converts query objects to an array:

{{#each (to_array page.posts) }}
...
{{/each}}

or

{{#each (to_array get_posts count=3 order=date) }}
...
{{/each}}

I would suggest adding this "to_array" as a standard helper. Any other possibilities?

How exactly am I supposed to use partials?

I was using hexo-renderer-hbs but needed more functionality so I decided to try this plugin. However, the documentation is sparse and gives only one weird example of calling partials: {{theme.author}}.

I changed the name of my partials folder (I had an underscore, which gave plenty of errors saying partials couldn't be found), but now I don't see any of my partials. The rest of my blog renders though.

Hexo 3 Compatibility

I'm running the render with hexo 3.x and having this issue:

ReferenceError: hexo is not defined
    at Object.<anonymous> (/opt/cashpickup.hexo/node_modules/hexo-renderer-handlebars/helpers/date.js:2:17)

Do you try the render with hexo 3 version?
Any suggestions?

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.