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

Use `static` as source for videos? #19

Open kniec opened 3 years ago

kniec commented 3 years ago

Thanks for the theme, love to include videos before I can put them on youtube. Only think is that I would like to put the videos into static/ next to the content folder so that I separate the static content from the actual markdown content.

From #9 I figure that I can not use a path like /movies/my-video.mp4 where movies is placed in static?

martignoni commented 3 years ago

Yes, this component currently only looks for files inside page bundles, so your example path doesn't work.

But this could be indeed a useful enhancement:

Is that what you mean?

kniec commented 3 years ago

How about assuming a relative path to be relative to the page bundle and an absolute path to be underneath /static? Like {{< video src="myvideo.mp4" >}} expect the file to be in the same page bundle versus {{< video src="/movies/myvideo.mp4" >}} expects the file to be at static/movies/myvideo.mp4

martignoni commented 3 years ago

Good suggestion! If you've a PR, I'd be glad to accept it.

martignoni commented 3 years ago

How about assuming a relative path to be relative to the page bundle and an absolute path to be underneath /static?

AFAIK, it's impossible to list (and match) files inside static folder. This is only possible in assets folder with resources.Get. See Hugo doc.

So I'm afraid there's no point to doing this :-/