Possible URL Helper #64

Open
seangaffney opened this Issue Jan 3, 2012 · 5 comments

Projects

None yet

3 participants

@seangaffney

Really loving Frank so far, but trying to use it with a slightly larger site (around 20 pages) and would love a URL Helper of some sort, but didn't know if anyone had run into that before. It seems like it could be relatively simple to do based on file path, but I'm a bit of a n00b at Ruby... Any thoughts?

@blahed
Owner
blahed commented Jan 3, 2012

I've considered this several times and tend to agree that it would be nice to have a few more helpers. I've been working on a new release as I find free time. It will certainly have some sort of url helper.

What exactly were you looking for? Something like rails: link_to or something a bit different?

@seangaffney

A link_to would be great, but actually what might be more useful, IMO, would be an array object of all the pages/articles, etc. with all the meta data associated with them. That way in the template or layout, you can just loop through them and call whatever methods you need.

Something really similar to the get_post_sumaries method you're using in your site's helper would probably suffice. Then you could call article.permalink if you needed to.

What gets interesting is the one-off link, where you're not looping through. In that case I'm not sure how you would define the page you want in a link_to method or similar because there are no routes... I'll have to think on that one more!

@blahed
Owner
blahed commented Jan 3, 2012

Ah yeah, I've been planning on doing this for a while too. I want to auto generate sitemaps, xml and html tree for development, this would require what you're talking about.

It's planned for sure.

@phrozen
phrozen commented Nov 24, 2012

The ability to get a list of filenames and meta data specifying a directory from a helper would be awesome. For example a simple Blog would require a call to get_items('/posts') and you can iterate the last 3 or 5 and create your index page, even a categories menu or a tags cloud if you can access the yaml meta data. Frank will be as powerful as Nanoc or Jekyll without the need of complex compiling rules, as you can just work it out in the views with the helpers.

Eager to see v 2.0

@blahed
Owner
blahed commented Nov 25, 2012

Yeah, the key to that I think is having a sitemap object... Which would also be helpful for generating a sitemap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment