You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create myself a web blog and want to include images to my blog posts, so I created a new folder into my _posts-folder and give it the same name as the .md file inside it. Then I put some images in my posts folder and linked them in the .md-file.
When I'm not trying to fetch the posts I get twice the posts I really have on my _posts-folder. Is it not possible to have posts-folder or did I something wrong?
And then I used relative paths to point to them in regular html/markdown. When I wanted to reference something in the post template, rather than in the post itself, I used the front-matter for the post to store the image url:
And then in the HTML for the post template I could reference it like {% if page.image|default(false) %}<img src="{{page.image}}">{% endif %}.
This construct isn't the greatest for a large blog with many images, but nothing would stop me from adding subfolders inside the img/ folder.
The trouble with putting them inside the _posts folder is that the Sculpin formatting logic expects every file in there to be a post content type. It might be something that can be improved in the future, since it is definitely nice to be able to collect related information together, but as for right now the img/..../.....jpg approach would probably be the most flexible.
This is all stuff that would be very helpful to have in the documentation, so I am going to keep this issue open and tag it appropriately so that can be improved.
Thanks for bringing it up, and I hope this response is helpful.
Thank you for the quick response @beryllium ! Unfortunately not, that is exactly how I do it right now… but I hope that this is going to be a feature in the future. It would be really useful because I use sculpin for my companies portfolio page right now (no need for a CMS).
I'm trying to create myself a web blog and want to include images to my blog posts, so I created a new folder into my _posts-folder and give it the same name as the .md file inside it. Then I put some images in my posts folder and linked them in the .md-file.
When I'm not trying to fetch the posts I get twice the posts I really have on my _posts-folder. Is it not possible to have posts-folder or did I something wrong?
folder structure:
-- _posts
--- sample
---- sample.md
---- image.jpg
The text was updated successfully, but these errors were encountered: