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

Add titleize Liquid filter #38

Merged
merged 2 commits into from
May 13, 2020
Merged

Conversation

jaredcwhite
Copy link
Member

Like the docs say: a Liquid filter to transform a lowercase string, slug, or identifier string into a capitalized title. Uses the already present Utils.titleize_slug method.

input: {{ "to-kill-a-mockingbird" | titleize }}
output: To Kill A Mockingbird

@jaredcwhite jaredcwhite added the enhancement New feature or request label May 8, 2020
@jaredcwhite jaredcwhite added this to the v0.14.0 "Hazelwood" milestone May 8, 2020
@westonganger
Copy link

I dont like that this method converts dashes to spaces. I think that is undesirable for a general titleize method.

@jaredcwhite
Copy link
Member Author

@westonganger Well that's how titleize works currently in ActiveSupport which we're hoping to integrate more of per #31, and it's also how Jekyll has worked in the past. Were you looking for something that only coverts underscores to spaces?

@westonganger
Copy link

After considering further hyphenated words are rarely necessary. Might as well stick to the convention.

@jaredcwhite jaredcwhite merged commit 56871ff into master May 13, 2020
@jaredcwhite jaredcwhite deleted the add-titleize-liquid-filter branch May 13, 2020 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants