Hugo: markdownify does not replace any shortcodes

Created on 21 Aug 2017  路  5Comments  路  Source: gohugoio/hugo

Is there a reason that markdownify does not replace shortcodes? I thought this would be rather consistent if any shortcodes that can be used in content files could also be used within text that is "markdownified".

If not I would state such a feature request to allow usage of shortcodes within markdownified texts. I'm trying to do an API documentation with hugo using frontmatter to store possible properties and functions for all methods of a class. And for each method I have possible example text or description that sometimes uses a custom source code shortcode or shortcodes for info/warning boxes.

Most helpful comment

This feature would be really useful, especially if it can be activated by an additional optional parameter to markdownify, or even as a separate function like markdownifyShortcodes.

All 5 comments

Please use https://discourse.gohugo.io/ for questions/troubleshooting. Also see Hugo Documentation.

If not I would state such a feature request to allow usage of shortcodes within markdownified texts.

I would turn down such a request. Shortcodes is for content files. markdownify is for templates.

@bep how can I achieve the following then? I have this shortcode to include .md files into other .md files, this is super useful for tabbed content, to have content for each tab into different files:
includeMarkdown.html

{{ $includePath := (print .Page.Dir (.Get 0)) | printf "./content/%s" }}
{{ readFile $includePath | markdownify }}
{{ .Inner }}

also I have number of shortcodes for simplified rendering for blocks like quotes, tips blocks, and etc.

whenever I include files into base .md file - shortcodes does not work, coz markdownify render all shortcodes as plain text without any parsing. What did I do wrong?

@vitpankin, please use the forums to discuss what you're wanting to do.

This feature would be really useful, especially if it can be activated by an additional optional parameter to markdownify, or even as a separate function like markdownifyShortcodes.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tjamet picture tjamet  路  3Comments

bep picture bep  路  3Comments

VoidingWarranties picture VoidingWarranties  路  3Comments

chrissparksnj picture chrissparksnj  路  3Comments

artelse picture artelse  路  3Comments