librelist archives

« back to archive

Theme issue

Theme issue

From:
Jonathan Ballinger
Date:
2012-01-17 @ 22:39
I recently installed Nesta and have been playing with it. I've run into an
issue when moving onto theming and I'm trying to work out if I've got 
something set up incorrectly on my end or if the theme tutorial on 
http://nestacms.com is using an older version. I would appreciate it if 
anyone could help (or advise me on where to look to see errors).

I followed the tutorial and it worked up to the point of using images, 
then the moment I put the rack line in:

use Rack::Static, :urls => ["/mytheme/"], :root => "themes/mytheme/public"

I get the error:

File not found: index.html

So I switched the theme to Slate and I get the same issue there. 
Commenting out the Rack::Static line results in the index page working 
again, but no image asset urls work.

If I go to /blog by appending to the homepage url, it works, images and all.

I'm not familiar enough with Nesta yet to work out where the error logs 
are or anything like that which could help track down this problem. I'm 
hoping I'm not the only one who has had this and that it's an easily fixed
issue.

Thanks for any help,

Jonathan

Re: [nesta] Theme issue

From:
Kevin Zurawel
Date:
2012-01-17 @ 23:49
Hi Jonathan,

Rack::Static is really just for static assets - things that your markup 
will load. I put this in my app.rb (my theme is called 'aws2012'):

use Rack::Static, :urls => ['/js','/img','/css'], :root => 'themes/aws2012/public'

That way calls to http://myurl.com/css/foobar will get served up as static assets.

If you want something to be served up as a page, you have two options:

1) Add it in your Nesta install's "content" directory as Haml or Markdown, or
2) Make a new "route" for it in your theme's app.rb file, something like:

get "/" do
  # serve up a page here - :cache haml, etc.
end

Most of the time you'll just want to put something in your content 
directory, and then specify a layout / template in the YAML header (which 
works on Haml pages too).

Hope this helps, let me know if you still have questions,
Kevin Zurawel
Arbor Web Solutions
Nesta-powered redesign (almost done!): http://testbed.arborwebsolutions.com

On Jan 17, 2012, at 5:39 PM, Jonathan Ballinger wrote:

> I recently installed Nesta and have been playing with it. I've run into 
an issue when moving onto theming and I'm trying to work out if I've got 
something set up incorrectly on my end or if the theme tutorial on 
http://nestacms.com is using an older version. I would appreciate it if 
anyone could help (or advise me on where to look to see errors).
> 
> I followed the tutorial and it worked up to the point of using images, 
then the moment I put the rack line in:
> 
> use Rack::Static, :urls => ["/mytheme/"], :root => "themes/mytheme/public"
> 
> I get the error:
> 
> File not found: index.html
> 
> So I switched the theme to Slate and I get the same issue there. 
Commenting out the Rack::Static line results in the index page working 
again, but no image asset urls work.
> 
> If I go to /blog by appending to the homepage url, it works, images and all.
> 
> I'm not familiar enough with Nesta yet to work out where the error logs 
are or anything like that which could help track down this problem. I'm 
hoping I'm not the only one who has had this and that it's an easily fixed
issue.
> 
> Thanks for any help,
> 
> Jonathan

Re: [nesta] Theme issue

From:
Jonathan Ballinger
Date:
2012-01-18 @ 08:51
Ugh, after posting the thanks above, I changed the Rack line to be my 
equivalent of yours and I still got the File not found: Index.html error.
This makes me wonder if there's a different issue and the Rack issue is 
just a symptom?


-- 
Jonathan Ballinger



On Tuesday, 17 January 2012 at 23:49, Kevin Zurawel wrote:

> Hi Jonathan,
> 
> Rack::Static is really just for static assets - things that your markup 
will load. I put this in my app.rb (my theme is called 'aws2012'):
> 
> use Rack::Static, :urls => ['/js','/img','/css'], :root => 
'themes/aws2012/public'
> 
> That way calls to http://myurl.com/css/foobar will get served up as 
static assets.
> 
> If you want something to be served up as a page, you have two options:
> 
> 1) Add it in your Nesta install's "content" directory as Haml or Markdown, or
> 2) Make a new "route" for it in your theme's app.rb file, something like:
> 
> get "/" do
> # serve up a page here - :cache haml, etc.
> end
> 
> Most of the time you'll just want to put something in your content 
directory, and then specify a layout / template in the YAML header (which 
works on Haml pages too).
> 
> Hope this helps, let me know if you still have questions,
> Kevin Zurawel
> Arbor Web Solutions
> Nesta-powered redesign (almost done!): http://testbed.arborwebsolutions.com
> 
> On Jan 17, 2012, at 5:39 PM, Jonathan Ballinger wrote:
> 
> > I recently installed Nesta and have been playing with it. I've run 
into an issue when moving onto theming and I'm trying to work out if I've 
got something set up incorrectly on my end or if the theme tutorial on 
http://nestacms.com is using an older version. I would appreciate it if 
anyone could help (or advise me on where to look to see errors).
> > 
> > I followed the tutorial and it worked up to the point of using images,
then the moment I put the rack line in:
> > 
> > use Rack::Static, :urls => ["/mytheme/"], :root => "themes/mytheme/public"
> > 
> > I get the error:
> > 
> > File not found: index.html
> > 
> > So I switched the theme to Slate and I get the same issue there. 
Commenting out the Rack::Static line results in the index page working 
again, but no image asset urls work.
> > 
> > If I go to /blog by appending to the homepage url, it works, images and all.
> > 
> > I'm not familiar enough with Nesta yet to work out where the error 
logs are or anything like that which could help track down this problem. 
I'm hoping I'm not the only one who has had this and that it's an easily 
fixed issue.
> > 
> > Thanks for any help,
> > 
> > Jonathan 

Re: [nesta] Theme issue

From:
Graham Ashton
Date:
2012-01-18 @ 09:04
On 18 Jan 2012, at 08:51, Jonathan Ballinger wrote:

> This makes me wonder if there's a different issue and the Rack issue is 
just a symptom?

It could be. The first thing I was thinking of looking at when I get a 
chance to investigate your problem is how slate behaves on a fresh (i.e. 
empty) project, that has just been created with `nesta new`.

I'd be surprised if it didn't work as I seem to recall testing the themes 
just before I released 0.9.11, but it's worth checking...

If slate works in a clean project, can you give us access to a copy of 
your project so we can investigate?

Re: [nesta] Theme issue

From:
Jonathan Ballinger
Date:
2012-01-18 @ 09:39
I can confirm that the following commands:

nesta new slatetest
cd slatetest
nesta demo:content
nesta theme:install git://github.com/gma/nesta-theme-slate.git
nesta theme:enable slate
shotgun config.ru

then browsing to http://localhost:9393/ results in:

File not found: index.html 

If someone else can try that and let me know what they get, we'll be able 
to determine whether it's a rails issue on my laptop or if it's just an 
out of date theme.

Thanks,

-- 
Jonathan Ballinger


On Wednesday, 18 January 2012 at 09:04, Graham Ashton wrote:

> On 18 Jan 2012, at 08:51, Jonathan Ballinger wrote:
> 
> > This makes me wonder if there's a different issue and the Rack issue 
is just a symptom?
> 
> It could be. The first thing I was thinking of looking at when I get a 
chance to investigate your problem is how slate behaves on a fresh (i.e. 
empty) project, that has just been created with `nesta new`.
> 
> I'd be surprised if it didn't work as I seem to recall testing the 
themes just before I released 0.9.11, but it's worth checking...
> 
> If slate works in a clean project, can you give us access to a copy of 
your project so we can investigate? 

Re: [nesta] Theme issue

From:
Graham Ashton
Date:
2012-01-18 @ 09:47
On 18 Jan 2012, at 09:39, Jonathan Ballinger wrote:

> If someone else can try that and let me know what they get, we'll be 
able to determine whether it's a rails issue on my laptop or if it's just 
an out of date theme.

I just tried those precise commands with ree-1.8.7-2011.03 and 1.9.2-p290,
and they both started up a working site.

Do you get a traceback in the shotgun output?

Re: [nesta] Theme issue

From:
Jonathan Ballinger
Date:
2012-01-18 @ 09:52
I do not, I get this:

== Shotgun/WEBrick on http://127.0.0.1:9393/
[2012-01-18 09:37:55] INFO WEBrick 1.3.1
[2012-01-18 09:37:55] INFO ruby 1.9.2 (2011-07-09) [x86_64-darwin10.8.0]
[2012-01-18 09:37:55] INFO WEBrick::HTTPServer#start: pid=1428 port=9393


No matter what I do there is no additional output.  If I change append 
/blog to the url, I get the Nesta page not found error and am able to 
click a sidebar link and have that page render correctly.

I think tonight (as I have to head to work now) I will reinstall/update 
rails/ruby/nesta and all associated gems as that should hopefully clear up
anything that's installed wrongly or out of date.

Thanks for confirming that sequence works for you as I'll be able to use 
that as a benchmark for whether everything's okay. 

-- 
Jonathan Ballinger


On Wednesday, 18 January 2012 at 09:47, Graham Ashton wrote:

> On 18 Jan 2012, at 09:39, Jonathan Ballinger wrote:
> 
> > If someone else can try that and let me know what they get, we'll be 
able to determine whether it's a rails issue on my laptop or if it's just 
an out of date theme.
> 
> I just tried those precise commands with ree-1.8.7-2011.03 and 
1.9.2-p290, and they both started up a working site.
> 
> Do you get a traceback in the shotgun output? 

Re: [nesta] Theme issue

From:
Jonathan Ballinger
Date:
2012-01-18 @ 07:48
Thanks Kevin, that explanation makes sense. 

Jonathan

On 17 Jan 2012, at 23:49, Kevin Zurawel <kzurawel@gmail.com> wrote:

> Hi Jonathan,
> 
> Rack::Static is really just for static assets - things that your markup 
will load. I put this in my app.rb (my theme is called 'aws2012'):
> 
> use Rack::Static, :urls => ['/js','/img','/css'], :root => 
'themes/aws2012/public'
> 
> That way calls to http://myurl.com/css/foobar will get served up as 
static assets.
> 
> If you want something to be served up as a page, you have two options:
> 
> 1) Add it in your Nesta install's "content" directory as Haml or Markdown, or
> 2) Make a new "route" for it in your theme's app.rb file, something like:
> 
> get "/" do
>  # serve up a page here - :cache haml, etc.
> end
> 
> Most of the time you'll just want to put something in your content 
directory, and then specify a layout / template in the YAML header (which 
works on Haml pages too).
> 
> Hope this helps, let me know if you still have questions,
> Kevin Zurawel
> Arbor Web Solutions
> Nesta-powered redesign (almost done!): http://testbed.arborwebsolutions.com
> 
> On Jan 17, 2012, at 5:39 PM, Jonathan Ballinger wrote:
> 
>> I recently installed Nesta and have been playing with it. I've run into
an issue when moving onto theming and I'm trying to work out if I've got 
something set up incorrectly on my end or if the theme tutorial on 
http://nestacms.com is using an older version. I would appreciate it if 
anyone could help (or advise me on where to look to see errors).
>> 
>> I followed the tutorial and it worked up to the point of using images, 
then the moment I put the rack line in:
>> 
>> use Rack::Static, :urls => ["/mytheme/"], :root => "themes/mytheme/public"
>> 
>> I get the error:
>> 
>> File not found: index.html
>> 
>> So I switched the theme to Slate and I get the same issue there. 
Commenting out the Rack::Static line results in the index page working 
again, but no image asset urls work.
>> 
>> If I go to /blog by appending to the homepage url, it works, images and all.
>> 
>> I'm not familiar enough with Nesta yet to work out where the error logs
are or anything like that which could help track down this problem. I'm 
hoping I'm not the only one who has had this and that it's an easily fixed
issue.
>> 
>> Thanks for any help,
>> 
>> Jonathan
>