memowe / contenticious

A simple file based "CMS" on Mojo steroids!
http://memowe.github.com/contenticious
MIT License
68 stars 11 forks source link

Serve static files from the pages directory structure #10

Open tardisx opened 10 years ago

tardisx commented 10 years ago

I'd like to store static files (images) with the documents that refer to them, and be able to refer to them without any path specification:

<img src="cat.gif">
memowe commented 10 years ago

The dump command copies static files (by default in public) in the dump directory. See Contenticious::Commands line 21. :)

tardisx commented 10 years ago

OK, I think I did not make myself very clear :-)

If I have pages/blog/2014/01/04/amazing-cat-I-saw-today.md which has a reference to 'cat.gif', it would be nice to be able to store cat.gif in pages/blog/2014/01/04 and then be able to use a relative link like:

<img src="cat.gif">

Rather than having to remember what files in public are referenced by which pages.

memowe commented 10 years ago

Do you have an easy way to implement this?

tardisx commented 10 years ago

I haven't looked, but I'm happy to do so, if you don't feel I'm barking up the wrong tree here in terms of the idea.

memowe commented 10 years ago

Feel free to fork and try things out! If I like it, I'll merge it back. :)

tardisx commented 10 years ago

Hi,

This is pretty rough and ready:

https://github.com/tardisx/contenticious/compare/memowe:master...master

But it does work.

Unless you hate it for some reason, I will keep going and fix up the unit tests and documentation :-)

memowe commented 10 years ago

Hi! I'm a bit unsure about the new complexity but don't stop, it looks interesting! :) Go on, fix the tests and try it out. Contenticious isn't my main focus these days so don't be sad if I don't pull it immediately.

memowe commented 5 years ago

@tardisx Any news about tests and documentation? :) I'll open a pull request for discussion.