You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've currently monkey patched my local monologue to default to post URLs like the following:
/2016-05-23/new-post-4
Would there be any interest in making this configurable as part of the gem? I'm thinking we could create a settable title_generator that would be invoked in Monologue::Post#generate_url if set.
e.g. you could do something like this:
config.title_generator = Proc.new do |post|
return unless post.url.blank?
date = post.published_at.class == ActiveSupport::TimeWithZone ? post.published_at.to_date : Date.today
post.url = "#{date}/#{post.title.parameterize}"
end
If that sounds reasonable, let me know and I will open a PR.
The text was updated successfully, but these errors were encountered:
Absolutely. As long as the default behavior (e.g. Without any config proc)
remains the same as before, please go ahead.
Thanks a lot
On Mon, May 23, 2016 at 5:16 PM jseitel [email protected] wrote:
I've currently monkey patched my local monologue to default to post URLs
like the following:
/2016-05-23/new-post-4
Would there be any interest in making this configurable as part of the
gem? I'm thinking we could create a settable title_generator that would be
invoked in Monologue::Post#generate_url if set.
e.g. you could do something like this:
config.title_generator = Proc.new do |post|
return unless post.url.blank?
date = post.published_at.class == ActiveSupport::TimeWithZone ? post.published_at.to_date : Date.today
post.url = "#{date}/#{post.title.parameterize}"
end
If that sounds reasonable, let me know and I will open a PR.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub #288
I've currently monkey patched my local monologue to default to post URLs like the following:
/2016-05-23/new-post-4
Would there be any interest in making this configurable as part of the gem? I'm thinking we could create a settable title_generator that would be invoked in Monologue::Post#generate_url if set.
e.g. you could do something like this:
If that sounds reasonable, let me know and I will open a PR.
The text was updated successfully, but these errors were encountered: