imathis / octopress

Octopress is an obsessively designed framework for Jekyll blogging. It’s easy to configure and easy to deploy. Sweet huh?
http://github.com/imathis/octopress
9.32k stars 2.62k forks source link

Octopress Improvement for mutiple themes. #1093

Open prigazzi opened 11 years ago

prigazzi commented 11 years ago

Hey, I just started using Octopress and so far, I love it. But trying to have multiple "themes" for it had become quite difficult for me. Bare in mind that I have NO Ruby skills at all, but I'm in the web development business for more than 10 years, so... I understand that for Jekyll to generate the site, the _posts and _pages directories must be within the "source" dir, but my first problem came with rake update_source command, because it copies source to source.old, but it "forgets" to copy back sources.old/_posts to source/_posts... so, if I just happen to run again that command, all my posts now on sources.old get deleted. Not cool.

So I've been touching Rakefile so rake new_post and rake new_page create those files in _posts and _pages in the same directory level than "source". Now, my question...

What do you recommend to do? That I symlink those dirs inside source, so Jekyll get to find them at watch, generate and preview? Or should I copy those dirs inside source? Anyhow, shouldn't this be a cool feature for Octopress to support? That no matter how many themes you have on .themes/ and no matter how many times you call rake update_source, but you _posts and _pages will always be safe?

parkr commented 11 years ago

Did you close this because you found it to be fixed? Which branch were you using?

prigazzi commented 11 years ago

Hey Parkr. I closed the Issue because I noticed that Octopress preserves the _posts dir plus all the other page-related directories when you perform a rake source_update. But I guess it makes sense to reopen it because this source_update actually copies directories inside the source directory, instead of a "clean copy". If I happen to use two or three themes, I'll end up having all the files from those two/three themes in my sources directory.

So, wouldn't be better if "_posts" and "_pages" directories are outside the "source" directory and every time we want to do a "source_update", we can clean the source directory, copy inside the new theme source, copy inside the "_pages" and the, copy or have symlinked the "_posts" directories?

Yesterday night I've modified the Rakefile to do exactly this and I'm pretty happy with it, although my ruby skills are non-existant, It seemed pretty straight foward. But before submitting a Pull Request, I'm asking... Is this a nice "feature" to have?

woozyking commented 11 years ago

The same goes to favicon and such. They deserve a more dedicated place to be stored and no octopress update or particular theme updates shall remove/replace them.

The options could be:

  1. rake job back up on the fly and restore after updating (for both theme installation and octopress update)
  2. Design a permanent location for these to be placed and make rake generate/preview/deploy look for these locations first, then fallback to the conventional place(s) if those resources do not make an appearance.
parkr commented 11 years ago

The problem is that we don't know what files are your and which are ours. Octopress allows you to make all the modifications you wish in the source. If you install a new theme, you start fresh. If we were database-driven, it'd be easier to separate content and themes.