jaredly / hexo-renderer-handlebars Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
There's an additional line in the output: <script src="/[object Object].js" type="text/javascript"></script>
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:
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 to write a __('text') using Handlebars?
Apparently, {{> post/social}}
is incorrect.
^^
If I try to use the CSS or JS helpers I get an error.
{{css "css/styles.css"}}
The file is located in /themes/myTheme/source/css/styles.css
What am I doing wrong?
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.
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?
Following the examples from http://handlebarsjs.com, it seems like {{#calendarDate}}{{this.date}}{{/calendarDate}}
would work but I get "Invalid date" in the rendered HTML.
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.