-
Notifications
You must be signed in to change notification settings - Fork 132
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
keeping images with the posts #91
Comments
Hello, That style of content organization is new to me. I wasn't aware that Hugo allowed that. I have heard that the upcoming bugs/bundles feature in Hugo will support this style of organization in a better way?
Would you like to try out the Image links -> Source path contains static style of image organization, as explained in the documentation? Would that fit your needs? |
Yeah, it does support it and it was one of the critical feature for me before migrating to Hugo...
I also hope that bags/bundles will make it even more flexible.
Hmm...not really, afaict, since it does help me to just have images in the folder named as post's slug, but all the media stuff is still put somewhere under |
That's what I was hoping for. Didn't want to invest too much time on implementing something that could be replaced in future.
I understand how painful it could be to switch to a different file organization. I just got introduced to this style of image organization. To start off, can you share your example site that uses this structure? This is definitely an "enhancement" feature. So I won't do it immediately as I do bug fixes, but I will get to it.. may be in a week or 2? I don't know.. depends on the kind of complexity this feature entails.. |
I've started thinking about this.. It looks like you prefer one-post-per-file flow. OLD Proposal
|
By keeping the .org and .png in the same directory, you can link the files using natural Org syntax that would result in valid links. You will also be able to see the images inline in the Org file if you wish. If the org file and image files are in different directories and if we still refer to the images using a link like |
btw it you use the one-post-per-subtree flow, you can have multiple posts in an Org file like this:
in a file structure like this:
After export, the
The So you only need to manually manage the stuff in These method of organization is supported right now without any extra config. |
That's understandable.
Here is the skeleton of my 'testing' site:
iow. for every post that uses some images there is directory with the same name as the post itself which contains desired images which can be referenced as I wrote above. Hugo can then detect it copy image media to the out directory:
OK. Thanks a lot. I've another site with ~200 posts in some PHP CMS which I want to migrate to Hugo asap...I'd simply use native orgmode support but it does miss so many things atm...today I e.g. discovered this one... |
LATEST PROPOSAL for ORGANIZATION -- IT ALREADY WORKSWas thinking more.. Looks like Org source
Contents of
|
Well, it looks that one-post-per-file flow is more suitable for such organization.
Perfect!
That looks very good and close to the current setup.
I believe that I prefer the former, although have to think about the trade off when using single-post-per-file flow... |
Noo.. that proposal is already old.. please look at e578681 |
It's getting late here and/or I'm a bit tired and will take closer look at the proposal tomorrow, but it seems that one does 'best of both worlds' - using 'one post per subtree' flow and creating appropriate structure in the output, correct? If so, then, yes, I stand corrected...this one is perfect: 👏 |
👍
Yes, I'm aware of that and therefore not much interested to take a look and/or use native orgmode support. 😉 |
OK, you can try it out tomorrow. But to be clear, what I have in #91 (comment) is not a proposal, that already works! 😎
This is already supported.. you can use the per-subtree flow (have .org and images for all subtree posts in the same dir) or per-file flow (have the .org post and its images in the same dir). From your older comment:
I still added a test case for |
Something does not work here for me... Here is the structure of my sources:
Here is my posts.org, considering I want to use default
After exporting I e.g. get the following for
but What do I miss? |
On the Org side, you need to have the Org post (file-based or subtree-based, doesn't matter) and the images in the same directory because you are referring to those images directly with file name without any directory prefix. See my "latest proposal" comment: #91 (comment) You can even clone the Actually, it's "images in Org content".. post |
Now I got it.
That also helped to figure out how to get post+image in the same folder working... 😄 Now I just wonder how could one take advantage of both, iow. I believe that Briefly: I'd like to be able to use e.g.:
and with having
where
Edit: Iow. I'd like combo of that - per-subtree flow with the ability to keep images in the folders names as posts itself. That is the way which is used in Nikola to have 'keep-images-with-the-content' feature... |
I haven't tried that yet, but should work right away. |
Hey, that works out of the box indeed...was doing some wrong before. Perfect! 👏 |
@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. |
Fixes kaushalmodi/ox-hugo#91 - Also make the "Test Site" link bold in the sidebar menu on documentation site.
That's fine, but there is a major issue with saving images on 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 It would be awesome that the images would be copied from the org directory to the page bundle directory. |
Hello!
I'd really like to move my Hugo-generated sites to org-mode and use ox-hugo for it, but wonder if it would be possible to achieve to keep images along with the post which is one of very nice Hugo's features.
E.g. in my 'posts' section I've the following:
and in e.g.
happy-birthday.org
file, I reference the image as follows:and the
*.jpg
file is cp-ed into:folder which is very convenient when one has to handle hundreds/thousands of posts making it easy to know which media files belong to which post(s).
Now I wonder if something similar could be accomplished with the ox-hugo and/or how should one organize one's source files?
The text was updated successfully, but these errors were encountered: