martignoni / hugo-video

A Hugo theme component to embed videos using HTML video element
GNU General Public License v3.0
107 stars 27 forks source link

Where video files must be? #9

Closed carpajr closed 4 years ago

carpajr commented 4 years ago

Hello Martignoni,

Maybe it is a silly question. I'm using Hugo for a few days, and I've installed the plugin that you have made.

I tried to put a video inside public/images, public/media, static/media, and variations, and I always have the same result:

Building sites... ERROR 2020/04/12 23:55:40 No file with filename "media/conan_1" found.

At content/posts/my-post.md I put: {{< video src="media/conan_1" loop="true" >}}

The file name is conan_1.mp4 (Conan is related to conan.io)

How is the correct way to assign videos? Could you help me?

Thank you for the plugin.

martignoni commented 4 years ago

You should place it in the page bundle, as the shortcode uses Hugo Page Resources.

carpajr commented 4 years ago

I was able to use hugo-video after see how page bundle works Thank you very much.

jpfleischer commented 11 months ago

for those who may still be confused after reading the page bundle, I encountered this issue when trying to put a bunch of pages in one directory.

i was trying to make a header page with a bunch of subpages. the solution was to move a subpage markdown file to its own directory, name it index.md, and put the video in that directory. something like

content/en/docs/
├── python/
│   ├── _index.md # this is just a page that shows links to other pages here, since python serves as a sort of category
│   ├── function-writing.md
│   ├── class-creation.md
│   ├── pip-install.md
│   └── my-video.mp4

so I wanted class-creation.md to play a video, but this wasn't working since it wasn't named index.md. i decided to create its own subdir in python/ and move class-creation.md to that subdir, and name it index.md, and move the video there with it. then it worked