When I use the {{< figure >}} shortcode and run a local server, it creates a werid ID instead of the URL I original entered. It’s a # followed by random characters. the link seems to lead to the page I’m on. The image link is broken (because it’s not an image, it’s a link to a webpage). Is this behavior something that will change with the live site? Or is this something I need to resolve?
attaching another picture showing how it looks like:
“ZgotmplZ” is a special value that indicates that unsafe content reached a
CSS or URL context at runtime. The output of the example will be <img src="#ZgotmplZ">
I suspect you need to use safeURL in your template or shortcode.
Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.
I see, though I don’t understand why this happens.
My understanding is that http: and https: are allowed, this supposed to happen if javascript is detected. I just tried a picture from wikipedia, https://commons.wikimedia.org/wiki/Commons:Featured_pictures#/media/File:Vexilla_vexillum_01.jpg and it got flagged as unsafe as well.
I use netlify to publish my site from gitlab, and get https through let’s encrypt. Will the https resolve this issue…? it doesn’t seem like it.
My site can be found at https://gitlab.com/taonaw/taonaw - though, this example is not there since I don’t want the broken link on my live site.
I created a test post with this issue specifically, it’s at Test Post · The Art of Not Asking Why and it’s the latest update, so you should see it at the top.
You can audit the build output for this and other silent errors/problems:
HUGO_MINIFY_TDEWOLFF_HTML_KEEPCOMMENTS=true HUGO_ENABLEMISSINGTRANSLATIONPLACEHOLDERS=true hugo && grep -inorE "<\!-- raw HTML omitted -->|ZgotmplZ|hahahugo|\[i18n\]" docs/
I see. I think this is because of ox-hugo, which is an Emacs package I use to publish to hugo from org-mode. It creates the markdown from .org files, so I need to see what’s going on there I guess - unless there is something else there.
The site probably has a lot of issues which I don’t see/understand, at least not yet. It’s been a process…