librelist archives

« back to archive

Fwd: Show all posts at example.com/b/*

Fwd: Show all posts at example.com/b/*

From:
Michal Forys
Date:
2012-12-04 @ 19:48
Hello,
I'd like to have posts displayed on example.com/b/, and rest of the
posts at example.com/b/*. How I can achieve something like that with
nesta?



~Michal

Re: [nesta] Fwd: Show all posts at example.com/b/*

From:
Brett Chalupa
Date:
2012-12-04 @ 20:54
Hi Michal,

Just created a file called b.haml in /content/pages/ and add this:

%section.articles = article_summaries(latest_articles(100))

That'll show the 100 most recent articles on example.com/b

Of course you can change the number and what else is displayed in the haml
file, but that should be enough to get you going.

Cheers, 

Brett Chalupa

brettchalupa@gmail.com (mailto:brettchalupa@gmail.com) | (908) 652-1140 | 
http://brettchalupa.com


On Tuesday, December 4, 2012 at 2:48 PM, Michal Forys wrote:

> Hello,
> I'd like to have posts displayed on example.com/b/ 
(http://example.com/b/), and rest of the
> posts at example.com/b/* (http://example.com/b/*). How I can achieve 
something like that with
> nesta?
> 
> 
> 
> ~Michal 

Re: [nesta] Fwd: Show all posts at example.com/b/*

From:
Brett Chalupa
Date:
2012-12-04 @ 20:55
Michal,

You'll also need to keep your updates/blog posts in the content/pages/b directory.

Cheers, 

Brett Chalupa

brettchalupa@gmail.com (mailto:brettchalupa@gmail.com) | (908) 652-1140 | 
http://brettchalupa.com


On Tuesday, December 4, 2012 at 2:48 PM, Michal Forys wrote:

> Hello,
> I'd like to have posts displayed on example.com/b/ 
(http://example.com/b/), and rest of the
> posts at example.com/b/* (http://example.com/b/*). How I can achieve 
something like that with
> nesta?
> 
> 
> 
> ~Michal 

Re: [nesta] Fwd: Show all posts at example.com/b/*

From:
Michal Forys
Date:
2012-12-05 @ 22:11
I've created github repo.
https://github.com/arathunku/arathunku.com

and still got 2(for now?) problems I can't solve. Almost everything
works but.. Firstly, when I push which is working at local host to
heroku it gives me error: "undefined method `path_to' for #" -- I use
that method in nav.erb to get absolute paths since I use as you can
see in app.rb
get '/#{custom page} do
 #stuff
end

Secondly. I'm not sure why it cant generate array with categories.
(page_meta_categories.erb) Method doesn't return anything, I mean,
empty array. Why's that?

Thank you in advance for help!

On Tue, Dec 4, 2012 at 9:55 PM, Brett Chalupa <brettchalupa@gmail.com> wrote:
> Michal,
>
> You'll also need to keep your updates/blog posts in the content/pages/b
> directory.
>
> Cheers,
>
> Brett Chalupa
>
> brettchalupa@gmail.com | (908) 652-1140 | http://brettchalupa.com
>
> On Tuesday, December 4, 2012 at 2:48 PM, Michal Forys wrote:
>
> Hello,
> I'd like to have posts displayed on example.com/b/, and rest of the
> posts at example.com/b/*. How I can achieve something like that with
> nesta?
>
>
>
> ~Michal
>
>

Re: [nesta] Show all posts at example.com/b/*

From:
Graham Ashton
Date:
2012-12-06 @ 23:30
On 5 Dec 2012, at 22:11, Michal Forys <arathunku@gmail.com> wrote:

> I've created github repo.
> https://github.com/arathunku/arathunku.com

Very helpful, thanks.

Sorry I didn't get to this earlier today.

> Firstly, when I push which is working at local host to
> heroku it gives me error: "undefined method `path_to' for #" -- I use
> that method in nav.erb to get absolute paths since I use as you can
> see in app.rb

Where did you find the path_to method? On GitHub? It's a new method, added
since version 0.9.13 was released. Perhaps you've installed Nesta locally 
from GitHub, but installed version 0.9.13 of the gem?

Here's the version of helpers.rb (where path_to is defined) that shipped 
in 0.9.13:


https://github.com/gma/nesta/blob/131eacf23a0ebdd93575c1377c290aa371adbc34/lib/nesta/helpers.rb

Given that you've used API that's coming up in the next version (probably 
0.10.0) I recommend you install Nesta from GitHub directly, on your public
site. It's quite stable, I just haven't gotten around to squashing a 
couple of issues with changes to the API/write release notes/etc., and I 
feel like I need to set quite a few hours aside to do it.

This article will tell you how to do that:

http://nestacms.com/docs/recipes/running-the-latest-code

I also noticed that you've got Sinatra handlers for pages like /b. Did you
know you could just drop an Erb file in content/pages that would do the 
same thing? Call it content/pages/b.erb or content/pages/b/index.erb and 
it should work like a Markdown page would (so long as you remove the 
handler in app.rb).

> Secondly. I'm not sure why it cant generate array with categories.
> (page_meta_categories.erb) Method doesn't return anything, I mean,
> empty array. Why's that?

The paths that you've specified in the Categories metadata don't 
correspond to real pages (there's nothing in content/pages called 
tag1.mdown, for example).

The Page#categories method filters out anything that doesn't exist 
(they're not tags, they're real pages that know how to list other pages on
them).

In other words, at the very least you'll need to create a file called 
tag1.mdown with a heading in it. I'd recommend sticking a paragraph of 
introductory text at the top of the tag1.mdown page too (which is why 
category pages, not tags).

> Thank you in advance for help!

No problem.

Cheers,
Graham

--
Graham Ashton
Founder, The Agile Planner
http://www.theagileplanner.com | @agileplanner | @grahamashton

Re: [nesta] Show all posts at example.com/b/*

From:
Michal Forys
Date:
2012-12-07 @ 21:18
I don't think using /b and then content/pages/b.erb will work because
of that code:

    FORMATS = [:mdown, :haml, :textile]

https://github.com/gma/nesta/blob/master/lib/nesta/models.rb#L15

About categories.. I've updated github repo and I've added methods to
support tags. I'm completny new to Ruby but somehow managed to make
tags work but only on localhost.;/

I've uploaded repo to heroku and it doesn't display posts. logs don't
show anything useful, any ideas?

~Michal

On Fri, Dec 7, 2012 at 12:30 AM, Graham Ashton <graham@effectif.com> wrote:
> On 5 Dec 2012, at 22:11, Michal Forys <arathunku@gmail.com> wrote:
>
>> I've created github repo.
>> https://github.com/arathunku/arathunku.com
>
> Very helpful, thanks.
>
> Sorry I didn't get to this earlier today.
>
>> Firstly, when I push which is working at local host to
>> heroku it gives me error: "undefined method `path_to' for #" -- I use
>> that method in nav.erb to get absolute paths since I use as you can
>> see in app.rb
>
> Where did you find the path_to method? On GitHub? It's a new method, 
added since version 0.9.13 was released. Perhaps you've installed Nesta 
locally from GitHub, but installed version 0.9.13 of the gem?
>
> Here's the version of helpers.rb (where path_to is defined) that shipped
in 0.9.13:
>
> 
https://github.com/gma/nesta/blob/131eacf23a0ebdd93575c1377c290aa371adbc34/lib/nesta/helpers.rb
>
> Given that you've used API that's coming up in the next version 
(probably 0.10.0) I recommend you install Nesta from GitHub directly, on 
your public site. It's quite stable, I just haven't gotten around to 
squashing a couple of issues with changes to the API/write release 
notes/etc., and I feel like I need to set quite a few hours aside to do 
it.
>
> This article will tell you how to do that:
>
> http://nestacms.com/docs/recipes/running-the-latest-code
>
> I also noticed that you've got Sinatra handlers for pages like /b. Did 
you know you could just drop an Erb file in content/pages that would do 
the same thing? Call it content/pages/b.erb or content/pages/b/index.erb 
and it should work like a Markdown page would (so long as you remove the 
handler in app.rb).
>
>> Secondly. I'm not sure why it cant generate array with categories.
>> (page_meta_categories.erb) Method doesn't return anything, I mean,
>> empty array. Why's that?
>
> The paths that you've specified in the Categories metadata don't 
correspond to real pages (there's nothing in content/pages called 
tag1.mdown, for example).
>
> The Page#categories method filters out anything that doesn't exist 
(they're not tags, they're real pages that know how to list other pages on
them).
>
> In other words, at the very least you'll need to create a file called 
tag1.mdown with a heading in it. I'd recommend sticking a paragraph of 
introductory text at the top of the tag1.mdown page too (which is why 
category pages, not tags).
>
>> Thank you in advance for help!
>
> No problem.
>
> Cheers,
> Graham
>
> --
> Graham Ashton
> Founder, The Agile Planner
> http://www.theagileplanner.com | @agileplanner | @grahamashton
>

Re: [nesta] Show all posts at example.com/b/*

From:
Graham Ashton
Date:
2012-12-10 @ 18:43
On 7 Dec 2012, at 21:18, Michal Forys <arathunku@gmail.com> wrote:

> I don't think using /b and then content/pages/b.erb will work because
> of that code:
> 
>    FORMATS = [:mdown, :haml, :textile]

You're right, sorry. I was confusing myself with a planned-for-the-future 
patch that hasn't been included yet.

> About categories.. I've updated github repo and I've added methods to
> support tags. I'm completny new to Ruby but somehow managed to make
> tags work but only on localhost.;/
> 
> I've uploaded repo to heroku and it doesn't display posts. logs don't
> show anything useful, any ideas?

Bear in mind that we can't take one look at your web pages and guess at 
what should be there, and "doesn't display posts" is a little vague.

I've pulled it, fired it up locally, but can't see at a glance what's missing.

Could you:

1. Give me the path to a specific page that exhibits the problem.
2. Tell me what you expect to see.
3. Tell me which lines of code you expect to do it.

I can probably tell you pretty quickly what's going on then.

Cheers.

--
Graham Ashton
Founder, The Agile Planner
http://www.theagileplanner.com | @agileplanner | @grahamashton

Re: [nesta] Show all posts at example.com/b/*

From:
Michal Forys
Date:
2012-12-10 @ 20:06
I'm sorry for not being precise about error.

Everything works on local but when you go to
https://arathunku.herokuapp.com/b <- github repo@heroku it doesn't load any
content files.

Heroku log:
2012-12-10T18:26:36+00:00 heroku[nginx]: 78.158.11.226 - -
[10/Dec/2012:18:26:36 +0000] "GET /b HTTP/1.0" 200 2280 "-"
"Lynx/2.8.5rel.1 libwww-FM/2.15FC SSL-MM/1.4.1c OpenSSL/0.9.7e-dev"
arathunku.pl
2012-12-10T20:01:19+00:00 heroku[router]: at=info method=GET
path=/favicon.ico host=arathunku.herokuapp.com fwd=89.70.80.40 dyno=web.1
queue=0 wait=0ms connect=2ms service=9ms status=404 bytes=2333
2012-12-10T20:01:19+00:00 heroku[router]: at=info method=GET
path=/favicon.ico host=arathunku.herokuapp.com fwd=89.70.80.40 dyno=web.1
queue=0 wait=0ms connect=1ms service=9ms status=404 bytes=2333
2012-12-10T20:01:35+00:00 heroku[router]: at=info method=GET
path=/css/style.css host=arathunku.herokuapp.com fwd=89.70.80.40 dyno=web.1
queue=0 wait=0ms connect=1ms service=21ms status=304 bytes=0
2012-12-10T20:01:35+00:00 heroku[router]: at=info method=GET
path=/favicon.ico host=arathunku.herokuapp.com fwd=89.70.80.40 dyno=web.1
queue=0 wait=22ms connect=47ms service=27ms status=404 bytes=2333
2012-12-10T20:01:36+00:00 heroku[router]: at=info method=GET
path=/css/style.css host=arathunku.herokuapp.com fwd=89.70.80.40 dyno=web.1
queue=0 wait=0ms connect=1ms service=20ms status=304 bytes=0
2012-12-10T20:01:20+00:00 heroku[router]: at=info method=GET
path=/favicon.ico host=arathunku.herokuapp.com fwd=89.70.80.40 dyno=web.1
queue=0 wait=0ms connect=2ms service=9ms status=404 bytes=2333
2012-12-10T20:01:18+00:00 heroku[router]: at=info method=GET path=/ host=
arathunku.herokuapp.com fwd=89.70.80.40 dyno=web.1 queue=0 wait=0ms
connect=1ms service=19ms status=200 bytes=2356

Doesn't help much.

https://github.com/arathunku/arathunku.com/blob/master/app.rb#L67
Should handle that, navigating to "/about" works just fine.

Cheers


On Mon, Dec 10, 2012 at 7:43 PM, Graham Ashton <graham@effectif.com> wrote:

> On 7 Dec 2012, at 21:18, Michal Forys <arathunku@gmail.com> wrote:
>
> > I don't think using /b and then content/pages/b.erb will work because
> > of that code:
> >
> >    FORMATS = [:mdown, :haml, :textile]
>
> You're right, sorry. I was confusing myself with a planned-for-the-future
> patch that hasn't been included yet.
>
> > About categories.. I've updated github repo and I've added methods to
> > support tags. I'm completny new to Ruby but somehow managed to make
> > tags work but only on localhost.;/
> >
> > I've uploaded repo to heroku and it doesn't display posts. logs don't
> > show anything useful, any ideas?
>
> Bear in mind that we can't take one look at your web pages and guess at
> what should be there, and "doesn't display posts" is a little vague.
>
> I've pulled it, fired it up locally, but can't see at a glance what's
> missing.
>
> Could you:
>
> 1. Give me the path to a specific page that exhibits the problem.
> 2. Tell me what you expect to see.
> 3. Tell me which lines of code you expect to do it.
>
> I can probably tell you pretty quickly what's going on then.
>
> Cheers.
>
> --
> Graham Ashton
> Founder, The Agile Planner
> http://www.theagileplanner.com | @agileplanner | @grahamashton
>
>

Re: [nesta] Show all posts at example.com/b/*

From:
Graham Ashton
Date:
2012-12-11 @ 08:34
On 10 Dec 2012, at 20:06, Michal Forys <arathunku@gmail.com> wrote:

> I'm sorry for not being precise about error.
> 
> Everything works on local but when you go to 
https://arathunku.herokuapp.com/b <- github repo@heroku it doesn't load 
any content files. 

You've put this in config.yml, which should shed some light on it. Delete 
the content setting so it uses the default...

  production:
    content: /content

--
Graham Ashton
Founder, The Agile Planner
http://www.theagileplanner.com | @agileplanner | @grahamashton