Custom output directory for stylesheets for Octopress/Jekyll

48 Views Asked by At

I am wondering how I can generate stylesheets into a custom directory on an Octopress 3x/Jekyll setup.

I have managed to modify settings in /config.rb and /_includes/head.html so that production stylesheets get written to /site/css/ which is where I need them to be.

Problem is, probably due to settings in the Octopress/Jekyll gems, /site/stylesheets/ is still being generated.

Technically not make or break, but needlessly verbose as project is quite large with quite a number of stylesheets.

How can I prevent /site/stylesheets/being generated alon gside desired /site/css/ ?

Am I going to going to have to hack the Octopress/Jekyll gems?

Due to upgrades, this latter option is not sustainable and so would like to avoid as much as possible. Thanks for your response.

2

There are 2 best solutions below

0
David Jacquel On

Really difficult to spot your problem without seeing your code.

Nevertheless, the problem can be a file with a permalink like permalink: stylesheets/something.css, or a defaults parameter that is set in your _config.yml to point to stylesheets/something.

0
CodeWizard On

I am wondering how I can generate stylesheets into a custom directory on an Octopress 3x/Jekyll setup.

Since octopress is based upon sass it has the config.rb which define the folders and paths for the css/sass files.

The file will probably contains this (might be different in your blog)

css_dir = 'assets/stylesheets'
sass_dir = 'assets/sass'

# and some other settings as well
images_dir = 'assets/images'
javascripts_dir = 'assets/javascripts'
line_comments = true

css_dir
The directory where the css stylesheets are kept.
It is relative to the project_path.
Defaults to stylesheets

sass_dir
The directory where the sass stylesheets are kept.
It is relative to the project_path.
Defaults to sass.

Full documentation and options can be found here:
http://compass-style.org/help/documentation/configuration-reference/