Hide pages that have publish=false property

1 view
Skip to first unread message

Karsten Heymann

unread,
Jun 4, 2009, 1:14:08 AM6/4/09
to Webby
Hi,

what would be the easiest way to hide all pages that have the property
publish: false set in the metadata header?

Yours
Karsten

Tim Pease

unread,
Jun 7, 2009, 10:31:35 PM6/7/09
to webby...@googlegroups.com
On Jun 3, 2009, at 11:14 PM, Karsten Heymann wrote:

>
> Hi,
>
> what would be the easiest way to hide all pages that have the property
> publish: false set in the metadata header?
>

Can you clarify a little bit your intended meaning for "hide all pages"?

Do you not want these pages to be rendered at all into the output
folder? Or do you want to prevent these pages from being pushed to
your webserver when you deploy? Or do you mean apply some CSS styling
to this page so the contents are hidden (such as display=none)?

Blessings,
TwP

Karsten Heymann

unread,
Jun 16, 2009, 1:35:43 PM6/16/09
to Webby
Hi,

On 8 Jun., 04:31, Tim Pease <tim.pe...@gmail.com> wrote:
> On Jun 3, 2009, at 11:14 PM, Karsten Heymann wrote:
> > what would be the easiest way to hide all pages that have the property
> > publish: false set in the metadata header?
>
> Can you clarify a little bit your intended meaning for "hide all pages"?

My intention was to prevent webby from creating any output files for
files with the property set. This is mainly for drafting blog entries,
which sometimes take some days to be written, and I don't want to
publish half-written articles to my blog. But, as I learned since
posting my question, this approach is not really practical at all
since the article stays in the year/month/day-folder it was created in
and the timestamp has to be adjusted as well. So I resorted to store
my article drafts elsewhere and insert them into a new created blog
page when they're done. This is not a perfect solution, too, since it
includes some manual copy and paste, but I'll sort that out later.

Yours
Karsten

Sven Sporer

unread,
Jul 6, 2009, 8:23:24 AM7/6/09
to Webby
Hi Karsten,
I also needed that feature, and solved it for me with an attribute
called "blog_post". If that is set to true, the article gets
displayed. It looks like this:

# head section of file:
# /content/blog/2009/04/07/hello-world.txt
---
title: Hello World v4
created_at: 2009-04-07 09:57:38.014905 +02:00
blog_post: true
filter:
- erb
- textile
---

Then, in index.txt, I only fetch those posts:
# /content/index.txt
<% posts = @pages.find(
:all,
:in_directory => @page.dir,
:recursive => true,
:sort_by => 'created_at',
:reverse => true,
:blog_post => true)

first = posts.shift
%>

Hope that helps,
Sven

Alpha Chen

unread,
Jul 6, 2009, 7:21:50 PM7/6/09
to webby...@googlegroups.com
On Tue, Jun 16, 2009 at 10:35 AM, Karsten
Heymann<karsten...@googlemail.com> wrote:
>
> My intention was to prevent webby from creating any output files for
> files with the property set. This is mainly for drafting blog entries,
> which sometimes take some days to be written, and I don't want to
> publish half-written articles to my blog. But, as I learned since
> posting my question, this approach is not really practical at all
> since the article stays in the year/month/day-folder it was created in
> and the timestamp has to be adjusted as well. So I resorted to store
> my article drafts elsewhere and insert them into a new created blog
> page when they're done. This is not a perfect solution, too, since it
> includes some manual copy and paste, but I'll sort that out later.

I had a similar problem, and created some tasks in blog.rake to help
out with that. You can take a look at them here if you're interested:

http://github.com/kejadlen/the_alpha_newswire/blob/61dda49459f70554be4101fd831a0095e92779eb/tasks/blog.rake

Regards,
Alpha

Ana Nelson

unread,
Jul 8, 2009, 4:49:13 AM7/8/09
to Webby
I dealt with this using a combination of page metadata + htaccess

See the "Drafts in Webby" section halfway down:
http://ananelson.com/blog/2008/06/in-touch-with-htaccess/



On Jul 7, 12:21 am, Alpha Chen <alpha.c...@gmail.com> wrote:
> On Tue, Jun 16, 2009 at 10:35 AM, Karsten
>
> Heymann<karsten.heym...@googlemail.com> wrote:
>
> > My intention was to prevent webby from creating any output files for
> > files with the property set. This is mainly for drafting blog entries,
> > which sometimes take some days to be written, and I don't want to
> > publish half-written articles to my blog. But, as I learned since
> > posting my question, this approach is not really practical at all
> > since the article stays in the year/month/day-folder it was created in
> > and the timestamp has to be adjusted as well. So I resorted to store
> > my article drafts elsewhere and insert them into a new created blog
> > page when they're done. This is not a perfect solution, too, since it
> > includes some manual copy and paste, but I'll sort that out later.
>
> I had a similar problem, and created some tasks in blog.rake to help
> out with that. You can take a look at them here if you're interested:
>
> http://github.com/kejadlen/the_alpha_newswire/blob/61dda49459f70554be...
>
> Regards,
> Alpha
Reply all
Reply to author
Forward
0 new messages