gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
75.85k stars 7.54k forks source link

{{< in code highlighting breaks page renderer #1287

Closed ahmedre closed 9 years ago

ahmedre commented 9 years ago

hi, thanks for writing hugo, i love it so far! i apologize if this is already filed, but i searched and didn't see anything.

anyhow, i was trying to write a blog post about how i migrated to hugo, and my page breaks due to the presence of "{{<" anywhere in a code snippet.

an easy way to repro is:

~~~bash # this is a {{< comment ~~~

in case it matters, i am using the hyde-x theme. the said error while building is:

ERROR: 2015/07/19 Unable to locate template for shortcode 'comment' in page 2015-07-19-migrating-to-hugo-from-hexo

thanks!

bep commented 9 years ago

Yes,

{{< and {{% are reserved keywords. You must "comment out" them to get them rendered.

{{</* myshortcode */>}}<p>Hello <strong>World!</strong></p>{{</* /myshortcode */>}}
ahmedre commented 9 years ago

thanks!

luixxiul commented 9 years ago

Is there any reason that shortcodes without markdown in the document are not commented out, @bep ?

{{< myshortcode >}}<p>Hello <strong>World!</strong></p>{{< /myshortcode >}}

ref: https://github.com/spf13/hugo/commit/55fcd2f30f4358a800932aa60160935c0c22f96d#diff-6f8ba52fe2137da59b26b9cd431bc468R32

bep commented 9 years ago

All the doc shortcodes examples are commented out. They have to be to "be visible as plain text".

luixxiul commented 9 years ago

Ah, I see. My misunderstanding, sorry.

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.