mataroa-blog / mataroa

Naked blogging platform
https://mataroa.blog
GNU Affero General Public License v3.0
258 stars 22 forks source link

Hugo export breaks if post title has quotes in it #34

Closed pratul closed 2 months ago

pratul commented 1 year ago

I wanted to play around with the Hugo export for my blog, but Hugo kept failing to build my exported files. Turns out this is happening for me because I have a post with the title The theory of "oh thank god".

As a result of the quotation marks, the markdown export of the post is broken. The title in the markdown export should be "The theory of \"oh thank god\"" but the mataroa export sets it to "The theory of "oh thank god"".

sirodoht commented 1 year ago

Hey @pratul!

Nice, thanks for reporting this.

I have just pushed a fix in 61d451403db16790947b49d5788299583e44d14e. Could you please let me know if that works as expected now?

pratul commented 1 year ago

Yes, works correctly now!

However, there's another issue that still breaks the Hugo export: support for {{ .RSSLink }} has been removed from the templating engine. It is being used in the baseof.html file of the mataroa theme.

>: hugo serve
Start building sites … 
hugo v0.110.0+extended darwin/arm64 BuildDate=unknown
ERROR 2023/03/03 22:39:01 render of "page" failed: "/Users/pratul/Downloads/export-hugo-8d54a846/themes/mataroa/layouts/_default/baseof.html:16:23": execute of template failed: template: _default/single.html:16:23: executing "_default/single.html" at <.RSSLink>: can't evaluate field RSSLink in type *hugolib.pageState
ERROR 2023/03/03 22:39:01 render of "page" failed: "/Users/pratul/Downloads/export-hugo-8d54a846/themes/mataroa/layouts/_default/baseof.html:16:23": execute of template failed: template: _default/single.html:16:23: executing "_default/single.html" at <.RSSLink>: can't evaluate field RSSLink in type *hugolib.pageState
ERROR 2023/03/03 22:39:01 render of "page" failed: "/Users/pratul/Downloads/export-hugo-8d54a846/themes/mataroa/layouts/_default/baseof.html:16:23": execute of template failed: template: _default/single.html:16:23: executing "_default/single.html" at <.RSSLink>: can't evaluate field RSSLink in type *hugolib.pageState
ERROR 2023/03/03 22:39:01 render of "page" failed: "/Users/pratul/Downloads/export-hugo-8d54a846/themes/mataroa/layouts/_default/baseof.html:16:23": execute of template failed: template: _default/single.html:16:23: executing "_default/single.html" at <.RSSLink>: can't evaluate field RSSLink in type *hugolib.pageState
Error: Error building site: failed to render pages: render of "page" failed: "/Users/pratul/Downloads/export-hugo-8d54a846/themes/mataroa/layouts/_default/baseof.html:16:23": execute of template failed: template: _default/single.html:16:23: executing "_default/single.html" at <.RSSLink>: can't evaluate field RSSLink in type *hugolib.pageState
Built in 6 ms
ratsclub commented 2 months ago

@sirodoht may we close this in favor of #66?

sirodoht commented 2 months ago

Sure!