Videos included in the primary language load normally but do not load in the secondary language. #94
-
|
I added a secondary language to my blog and the video doesn't load properly in the secondary language. http://localhost/pt-br/blog/2024/11/problemas-de-seguran%C3%A7a-no-mremoteng-que-podem-deixar-sua-empresa-vulner%C3%A1vel/ |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
The reason is that the For example,
However according to the To solve it
// hugo.yaml
markup:
goldmark:
duplicateResourceFiles: true
// layouts/shortcodes/page-video.html
{{ $url := .Get 0 }}
{{ $caption := .Get 1 }}
{{ with .Page.Resources.Get $url }}
<figure style="text-align: center;">
<video width="640" height="340" controls>
<source src="{{ .Permalink }}" type="{{ .MediaType }}">
Seu navegador não suporta a tag de vídeo.
</video>
<figcaption><i>$caption</i></figcaption>
</figure>
{{ end }}And then replace the For more advanced usage, please checkout this doc. |
Beta Was this translation helpful? Give feedback.


The reason is that the
poc.mp4was published under in the same path of the default language content.For example,
/blog/foo/blog/foo/poc.mp4However according to the
permalinksconfig on yourhugo.yaml.The secondary Language content's path is different from default language (e.g.
/blog/foo-en), which don't have thepoc.mp4in same path, that is it.To solve it
markup.goldmark.duplicateResourceFiles, but I don't recommend using this approach unless you're using multihosts.// hugo.yaml markup: goldmark: duplicateResourceFiles: true