bridgetownrb / bridgetown

A next-generation progressive site generator & fullstack framework, powered by Ruby
https://www.bridgetownrb.com
MIT License
1.16k stars 112 forks source link

Add equivalent to `post_url` for resource engine #304

Closed jaredcwhite closed 3 years ago

jaredcwhite commented 3 years ago

From discussions:


Hey! Recently I finished migrating my blog from Jekyll to Bridgetown. So far it's been a great journey. Now I wanted to make it future-proof by switching to resource engine but it stopped working on rendering post_url tags:

Bridgetown::Errors::PostURLError: Could not find post "2017-04-29-post-title" in tag 'post_url'.

I've tried hacking around the tag Bridgetown::Tags::PostUrl class to fix it but without much success. I wonder if there is an "official" way to do it. I may, of course, rewrite all post_urls to something else but I worry that it would discourage some people from migrating fro Jekyll in the future.

Originally posted by @katafrakt in https://github.com/bridgetownrb/bridgetown/discussions/295

jaredcwhite commented 3 years ago

@katafrakt I've thought about this quite a bit and I think it makes more sense to standardize on the link tag (Liquid) and link_to helper (ERB/etc.) More and more we don't want to have anything in Bridgetown which privileges "posts" in particular. A post is nothing more than a resource in the posts collection and you can have any number of collections called anything you want.

Closing for now, but if anyone disagrees feel free to reopen this issue and correct me. 😄