Open nanotime opened 10 years ago
Ahh nice catch! Thank you - and very clear writeup as well. Will try to have this resolved in the next release!
Thanks! I just try to be useful (?) I don't know what (or how) say that xD
Anyway
Haha "Just trying to be helpful" I think would be the right call! I also speak spanish if that's easier or quicker for you as well, although I'm sure your english is better than my spanish
Google translate is better for spanish-english ... so let me speak english, maybe someday i can speak that well... i hope.
So, if you want to close this issue, go ahead... or maybe when the bug got fixed.
Damn i need to have more practice...
Hey, i have a "solution"... isn't a real solution but just need to create a dummie file, like dummie.jade
in the root folder of your dynamic content file and put inside one line of front matter: _render: false
.
And this is it, you can call all() method and render it... the dummie content will not rendered
It came to my mind just the day I posted the bug, but I forgot to mention.
Cheers! :beers:
Yup, that should be a great workaround for now, but I will definitely try to have this issue resolved for the next release as well :grinning:
I have been struggling with this issue for quite some time now, for some reason even with the _render: false YAML front-matter it still gets rendered. Also, post._categories[-1]
returns undefined, meaning I have to set it to [1] which is correct for all but the dummie.jade file, which then becomes undefined. I only just understood why that happens too!
Ah I'm sorry, I totally forgot about this. I'll take a look into it soon. This is just a small bug that should be fixable in the code. If you want to take a look feel free -- if not I'll get to it as soon as I can!
I wish I could, I am very much a newcomer to js and node and have not much of an idea as to where to begin to look in the code, I'm sorry that I can't save you the time!
EDIT: I fixed this with some basic Jade logic using unless
:
each post in site.posts.all()
if site.posts.all(category)
unless post.title === undefined
... content
Well, hello hello! I just come here to say hi (?) ... not really, but Hi! xD
Yup, the issue persists, bad juju, and one little thing, now when i put _render: false
on the front matter in the dummie content, it's rendered anyway.
For all other things, all fine.
PD: Wow, @jenius, roots has become something awesome!
edit:
Easy cheap trick, just make a jade fool's hacking and adding some extra front matter, like this:
Post that will show:
title: 'Primer post en ocio'
date: 18/04/2015
_content: false
_render: true
---
The ugly but necessary guy:
title: 'dummie'
date: 18/04/2015
_content: false
_render: false
---
The judge
each post in site.posts.all()
article.post(style=post._render ? '' : 'display: none')
//- bleh code
+1
Guys, i found a new issue on the all() method. When someone try to get all posts or some nested dynamic content, like:
If the post folder don't have a .jade file to render out of nested folders, the prompt return:
So, more clear:
Will be: ERAAAWWWRRR! Bitch
Will be: Fuck yeah!
Annd, I realized that the test (in dynamic-content project) is not covered the case of a nest without .jade files above.
So, this is it, If I can, I will write a test just to prove that part ... I just need to read the documentation and I pray that everything goes well, I have never written tests.
Cheers!!!