krasimir / techy

A flat file CMS based on Gulp and AbsurdJS
http://krasimir.github.io/techy
MIT License
250 stars 23 forks source link

Draft functionality #13

Closed zalun closed 10 years ago

zalun commented 10 years ago

It would be good to have a draft pages These would live, be rendered, but not returned via this.pages(...)

krasimir commented 10 years ago

That's good idea. What if we implement it that way: every page which has draft: true will not be returned by this.pages.

zalun commented 10 years ago

exactly what I suggested :) https://github.com/zalun/zalun.github.io/blob/master/articles/pianostairs.md

zalun commented 10 years ago

I've been lame and modified https://github.com/zalun/zalun.github.io/blob/master/lib/list.techy.js#L7 BTW is there a way to add default values with get - where to look for docs?

krasimir commented 10 years ago

Ok, great. I'll implement the draft property as you suggested. The get method is defined here. What you mean by default value? A value which is set to all the pages automatically?

zalun commented 10 years ago

Yes, system throws errors when a) too many pages are requested b) tags, preface or date is not provided title defaults to "techy" so it's build in.

krasimir commented 10 years ago

Yep, you are right. This is a must-have feature, so goes on the top of my list.

krasimir commented 10 years ago

I just realized that there is a way to define variables for all the pages: http://krasimir.github.io/techy/docs/#master-config Is that working for you?

zalun commented 10 years ago

Yes - cool - I'll do it there

krasimir commented 10 years ago

Ok, let me know if that works in your case.

krasimir commented 10 years ago

It's done. The new 0.0.44 version supports that feature. Here is the test case https://github.com/krasimir/techy/tree/master/tests/draft-pages

For example, a page containing the following code will be compiled but not returned by the pages method:

---
title: C page
draft: yes
---
# C page