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.html attempts to read config.toml #133

Closed
palant opened this issue May 11, 2020 · 9 comments
Closed

markdownify.html attempts to read config.toml #133

palant opened this issue May 11, 2020 · 9 comments
Labels
enhancement New feature or request

Comments

@palant
Copy link
Collaborator

palant commented May 11, 2020

Generation failed for me because layouts/partials/utils/markdownify.html attempted to read config.toml which doesn't exist in my case (I use the YAML config format). I'd say this file should use .Site.Params.enableEmoji rather than attempt to parse the config file?

@reuixiy
Copy link
Owner

reuixiy commented May 12, 2020

Hmmm, I did this because I found that there is a Hugo-defined variable enableEmoji, but it cannot access via Site Variables, and I don’t want to repeat it in Params.

Note that this theme requires a configuration file provided by the theme, which is already in TOML format. Did you just convert it to YAML format? If so, well...

Anyway, readFile seems quite rude indeed. I'll make a commit.

@palant
Copy link
Collaborator Author

palant commented May 12, 2020

Oh, I didn't realize that enableEmoji isn't under params, I see...

Yes, I had an existing YAML config, so I added the settings from your config example there.

@palant
Copy link
Collaborator Author

palant commented May 12, 2020

Unfortunately, .RenderString function is unaffected by this setting - emojis seem to be processed during parsing, not rendering.

@reuixiy
Copy link
Owner

reuixiy commented May 12, 2020

Yes, neither markdownify nor .RenderString respect enableEmoji, and that's why I added this workaround in layouts/partials/utils/markdownify.html.

Also, I took a look at Issues of Hugo and found gohugoio/hugo#7170.

@palant
Copy link
Collaborator Author

palant commented May 12, 2020

If moving the setting around is too much trouble, maybe you could use readDir to make sure the file actually exists so there is at least no error.

@reuixiy
Copy link
Owner

reuixiy commented May 12, 2020

@palant Just submitted a commit and it should work.

@reuixiy
Copy link
Owner

reuixiy commented May 12, 2020

wait a minute...

reuixiy added a commit that referenced this issue May 12, 2020
@reuixiy
Copy link
Owner

reuixiy commented May 12, 2020

Okay, now it should work!

@palant
Copy link
Collaborator Author

palant commented May 12, 2020

Yes, seems to work, thank you!

@palant palant closed this as completed May 12, 2020
@reuixiy reuixiy added the enhancement New feature or request label May 12, 2020
ulmefors pushed a commit to ulmefors/hugo-theme-meme that referenced this issue Nov 22, 2020
ulmefors pushed a commit to ulmefors/hugo-theme-meme that referenced this issue Nov 22, 2020
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

No branches or pull requests

2 participants