Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better handling of images in Hugo bundles #324

Closed
kaushalmodi opened this issue Jan 29, 2020 · 7 comments
Closed

Better handling of images in Hugo bundles #324

kaushalmodi opened this issue Jan 29, 2020 · 7 comments

Comments

@kaushalmodi
Copy link
Owner

@gour I had let this issue stay open as I wanted to document this feature for other users too. Now I have :)

The documentation is added at https://ox-hugo.scripter.co/doc/images-in-content/.

Feel free to reopen this issue or open a new one if you face any problem.

That's fine, but there is a major issue with saving images on static folder: those images cannot be processed by Hugo (see Hugo Image processing ).

I started my ox hugo experimentation with the strategy proposed by the hugo documentation ( ox hugo Images in content ) but, having to process the images, at the moment I have to copy the files by hand to the directory containing the post. I am using :EXPORT_HUGO_BUNDLE: in order to create page bundles and I've disabled Emacs option org-hugo-default-static-subdirectory-for-externals.

It would be awesome that the images would be copied from the org directory to the page bundle directory.

Originally posted by @finex in #91 (comment)

@kaushalmodi
Copy link
Owner Author

@finex Can you please provide a minimal reproducible example of what's happening and what's the expectation?

@finex
Copy link

finex commented Jan 31, 2020

Hi, of course @kaushalmodi :-)

🙅‍♂️ Current behaviour:

valid with bot single org file and one post per file

ox-hugo copies images (from the post body) to /static folder (org-hugo-default-static-subdirectory-for-externals).

😄 Expected behaviour:

It should be added a new parameter to force the copy of images to the page bundle directory instead than the static one.

Org file structure:

content-org/posts.org 
content-org/image1.jpg

posts.org details:
It contains a reference to file:image1.jpg and has the :EXPORT_HUGO_BUNDLE: option set to bundle-name (it's an example). I've also set the hugo section to blog using #+hugo_section: blog.

Result:
When you save the .org file and export to hugo the directory with markdown (content) should be something like:

content/blog/bundle-name/index.md
content/blog/bundle-name/image1.jpg

❤️ Extra "like to have" :

This option should be used also to enhance my previous report (#301 ): images on custom front matter should also be copied in the page bundle directory.

@finex
Copy link

finex commented May 3, 2020

Hi @kaushalmodi , did you evaluated my proposal? This is the last problem left which prevents me to use ox-hugo (and Hugo) for my new "ready to be launched" website 😀. Let me know if you've some suggestions, even a custom local script to automate this task. Thank you for all your work on this project!

@kaushalmodi
Copy link
Owner Author

Oh boy, it's already been 3 months since this issue was created. My work's been too busy. I'll get to this once I find some time. Such major features need a lot of testing and also documentation.

@finex
Copy link

finex commented May 4, 2020

Great, I don't know elisp (yet) so I can't help with coding but if you need help for testing or something else feel free to ask :-) thank you! :-)

@kaushalmodi
Copy link
Owner Author

@finex I have already added this feature, but I misunderstood this feature request for something else :).

Well, now I have this documented as well. Please refer to this documentation on https://ox-hugo.scripter.co/doc/images-in-content/#images-and-page-bundles and let me know if that resolved this issue.

@finex
Copy link

finex commented May 18, 2020

Hi, yes, it works :-) Thank you :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants