Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible URL Helper #64

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

Possible URL Helper #64

seangaffney opened this issue Jan 3, 2012 · 5 comments

Comments

@seangaffney
Copy link

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?

@trvsdnn
Copy link
Owner

trvsdnn 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
Copy link
Author

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!

@trvsdnn
Copy link
Owner

trvsdnn 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
Copy link

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

@trvsdnn
Copy link
Owner

trvsdnn 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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants