views:

55

answers:

1

I'm trying to setup a very basic id="thisFileName" in my staticMatic project.

So far I've managed to apply the following to an /index.html (the HAML output):

- @slug = current_page.gsub(/\.html/, '')

Which returns "/index". However - I'd like to remove the / at the start so that it reads /index...

Any tips or directions for where I should get advice on how best to do this would be greatly appreciated!

A: 

To delete the beginning "/" after you've stripped the html simply execute this (which will do both in one command):

current_page.gsub(/\.html/, '').gsub(/\//,''))
ennuikiller
Thanks! I also discovered this, when changing my search terms more and more: - @slug = current_page.gsub("/", "").gsub(".html", "")It was in - http://github.com/adamstac/staticmatic-bootstrap
kaichanvong