kolber / stacey

Cheap & easy content management
http://staceyapp.com
MIT License
1.04k stars 131 forks source link

Arbitrary insertion of images/Image captions #159

Open kariemil opened 6 years ago

kariemil commented 6 years ago

Hi Stacey community,

What's the best way to arbitrarily insert images into a "blog" post? So to have a bunch of text, then an image (with maybe a caption) etc.?

Furthermore, using the standard function of just displaying all the media in one go, is there a way to include captions below each instance?

desbest commented 4 years ago

Use the @root_path or {{root.path} then content/mypagename/imagename.png as an <img> HTML tag

papillon-unix commented 3 years ago

Use the @root_path or {{root.path} then content/mypagename/imagename.png as an tag

Please, can you be more explicit?

desbest commented 3 years ago

Stacey is a flat file CMS meaning that all the content is stored in the file system as files and folders, instead of a database like a mysql/mariadb, sql server or sqlite database.

Because of this, each folder on your website that is stored inside the content/ folder represents a page. Also each sub-folder inside the content/ folder represents a page on your website that has a parent page. That's why mypagename in my above comment has to be replaced with the name of your page.

The @root_path in Stacey 2.3 or {{root.path}} in Stacey 3 is a variable that when put inside the content of your page you are editing, it will be replaced with the root directory of your website. So there is no need to include your domain name in your URL, which is better for multiple reasons, for one if you're moving your website from one domain to another.

There was a formatting error in my above comment, I actually meant a <img> HTML tag.

If editing plain html files is too confusing for you, I have created an admin panel frontend so you can edit your Stacey website in your web browser. #141

papillon-unix commented 3 years ago

thx, I ended up building an Twig extension to replace image names in my content with the actual image it reffers to & formatting it with my design.