Set fallback URL


To provide Staticman support for the theme Huginn. You may refer to my recent blog post Huginn theme with Staticman for details.

Demo Frama Pages: (Source)


I would like to have a fallback URL (for Staticman API endpoint).

In the Jekyll theme Beautiful Jekyll, it’s done like

<form ...
  action="{{ site.staticman.endpoint | default: '' }}{{ site.staticman.repository }}/{{ site.staticman.branch }}/comments">

I tried translating this to Hugo, and wrote

<form ...
  action="{{ .Site.Params.staticman.endpoint | default '' }}...">

and I got

Error: "/home/vin100/huginn/layouts/partials/staticman-comments.html:59:1": parse failed: template: partials/staticman-comments.html:59: malformed character constant: ''

How can a URL be supplied as the default value?

Try using double quotes instead of single quotes

1 Like

Thanks for quick answer ! This saves the day.

P.S. The code in the question body is not yet available in the linked Framagit repo by the time I write this question, but I’ll publish my work very soon.