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

Markdownify titles #279

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Markdownify titles #279

wants to merge 3 commits into from

Conversation

anthowan
Copy link

@anthowan anthowan commented Nov 3, 2024

I noticed that some of my posts have ' in their titles which don't get properly converted into ’ HTML smart quotes, so I passed all occurrences of .Title through markdownify to fix that.

I noticed that some of my posts have ' in their titles which don't get properly converted into ’ HTML smart quotes, so I made a setting that can be enabled to fix that. It's turned off by default to avoid messing up existing sites since maybe people have really wacky titles that could get mangled by markdownify.
Copy link

netlify bot commented Nov 3, 2024

Deploy Preview for gokarna-hugo ready!

Name Link
🔨 Latest commit 652abea
🔍 Latest deploy log https://app.netlify.com/sites/gokarna-hugo/deploys/6727e1c8cc5b6a00095c3b55
😎 Deploy Preview https://deploy-preview-279--gokarna-hugo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@anthowan
Copy link
Author

anthowan commented Nov 3, 2024

Maybe we should just simply do .Title | markdownify without checking a setting since I don't think it'll break any reasonable sites? @jamesericdavidson what do you think?

Feel free to revert this if you think it'll cause real breakage
@jamesericdavidson
Copy link
Contributor

@anthowan Sure, that's what we do with other markdownify-ed strings.

If you want to use a site param, please add it to the Advanced docs :)

@anthowan anthowan changed the title Add .Site.Params.markdownifyTitles setting to markdownify titles Markdownify titles Nov 3, 2024
@jamesericdavidson
Copy link
Contributor

@anthowan please can you provide screenshots of titles with and without Markdown formatting (e.g. emoji) for review?

@anthowan
Copy link
Author

anthowan commented Nov 3, 2024

Without this PR:

image

With this PR:

image

@jamesericdavidson
Copy link
Contributor

@anthowan Thanks! Could you fix the Markdown-less image, please?

Ping @526avijitgupta @yashmehrotra

@anthowan
Copy link
Author

anthowan commented Nov 4, 2024

Could you fix the Markdown-less image, please?

What do you mean by that? I used the Unicode character 🐈 in the title rather than some shortcode like :cat:. If I had instead used :cat:, it would render in the second image but not the first.

@yashmehrotra
Copy link
Collaborator

LGTM @526avijitgupta please review & merge if you see it fit

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

Successfully merging this pull request may close these issues.

3 participants