Closed myicq closed 1 year ago
https://github.com/picocms/Pico/pull/368#issuecomment-243231769
missed that one. Sorry. But I still wish there was a better way of organizing things together, especially since my images are named with a random 32 char filename.
Still same case after nearly 8 years ?
Still same case after nearly 8 years ?
Yes, because it's no engineering problem. There are some rather obscure solutions utilizing URL rewriting (just search here on GitHub, it's somewhere), but in the end, all CMS (e.g. Wordpress) separate contents and assets.
Starting with Pico 3.0 (currently in dev, but you might simply give it a try...) things got a bit easier due to the new %page_path%
placeholder:
As a convinience feature, you can now use the
%page_id%
,%page_url%
, and%page_path%
placeholders in your Markdown files. They will be replaced by the current page's ID (e.g.sub/index
forcontent/sub/index.md
,sub/page
forcontent/sub/page.md
, …), its URL (sub
resp.sub/page
in our examples), or its directory path (sub
in both examples) respectively. This is useful for e.g. asset management: You can now put assets for pages in thecontent/sub/
directory in theassets/sub/
directory, and reference them using%assets_url%/%page_path%/my_asset.png
.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two days if no further activity occurs. Thank you for your contributions! :+1:
Making feets we on PICO. Looks great !
For a project, I would like to store images in same directory as the document, not in
assets
folder. So that I haveWhat is the correct way to link the image ? I tried
![title](myimage.png)
and![title](./myimage.png)
which both failed.Documentation could perhaps mention how as well, instead of assuming use of assets to be the only way ?