Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 1 commit
  • 3 files changed
  • 0 comments
  • 1 contributor
11  .gitignore
@@ -26,4 +26,15 @@ pip-log.txt
26 26
 #Mr Developer
27 27
 .mr.developer.cfg
28 28
 
  29
+# osx .DS_Store files
  30
+.DS_Store
  31
+
  32
+# directory where all the html pages
  33
+# are created
29 34
 output
  35
+
  36
+# directory for compiled bootstrap
  37
+theme/static/bootstrap
  38
+
  39
+# compiled css
  40
+theme/static/css/main.css
31  fabfile.py
... ...
@@ -1,13 +1,17 @@
1 1
 import os
2  
-from fabric.api import local, task
  2
+from fabric.api import local, task, lcd
3 3
 
4 4
 BASEDIR = './' #os.path.abspath(os.path.curdir)
5 5
 OUTPUTDIR = os.path.join(BASEDIR, 'output')
6 6
 CONFFILE = os.path.join(BASEDIR, 'pelican.conf.py')
7 7
 THEMEDIR = os.path.join(BASEDIR, 'theme')
8 8
 
  9
+LIB_DIR = os.path.join(THEMEDIR, 'lib')
  10
+STATIC_DIR = os.path.join(THEMEDIR, 'static')
9 11
 LESS_DIR = os.path.join(THEMEDIR, 'less')
10  
-CSS_DIR = os.path.join(THEMEDIR, 'static', 'css')
  12
+
  13
+LESS_IMPORT_PATHS = [os.path.join(LIB_DIR, 'bootstrap/less')]
  14
+CSS_DIR = os.path.join(STATIC_DIR, 'css')
11 15
 CSS_FILENAME = 'main'
12 16
 
13 17
 
@@ -18,14 +22,35 @@ def clean():
18 22
 
19 23
 @task
20 24
 def compile_less():
21  
-    local('lessc -compress {less_dir}/{main}.less {css_path}/{main}.css'.format(
  25
+    local(('lessc -compress'
  26
+            ' --include-path={import_path}'
  27
+            ' {less_dir}/{main}.less'
  28
+            ' {css_path}/{main}.css').format(
22 29
         less_dir=LESS_DIR,
23 30
         css_path=CSS_DIR,
  31
+        import_path=':'.join(LESS_IMPORT_PATHS),
24 32
         main=CSS_FILENAME))
25 33
 
26 34
 
27 35
 @task
  36
+def compile_bootstrap():
  37
+    lib_bootstrap = os.path.join(LIB_DIR, 'bootstrap')
  38
+    compiled_bootstrap = os.path.join(STATIC_DIR, 'bootstrap')
  39
+
  40
+    with lcd(lib_bootstrap):
  41
+        local('make bootstrap')
  42
+
  43
+    lib_boostrap_compiled = os.path.join(lib_bootstrap, 'bootstrap')
  44
+
  45
+    local('rm -fr {}*'.format(compiled_bootstrap))
  46
+    local('mv {lib_boostrap_compiled} {compiled_bootstrap}'.format(
  47
+        lib_boostrap_compiled=lib_boostrap_compiled,
  48
+        compiled_bootstrap=compiled_bootstrap))
  49
+
  50
+
  51
+@task
28 52
 def prepare():
  53
+    compile_bootstrap()
29 54
     compile_less()
30 55
 
31 56
 
6  theme/less/main.less
... ...
@@ -1,8 +1,8 @@
1  
-@import "../lib/bootstrap/less/variables.less";
  1
+@import "variables.less";
2 2
 @import "custom_variables.less";
3 3
 
4  
-@import "../lib/bootstrap/less/no_variables_bootstrap.less";
5  
-@import "../lib/bootstrap/less/no_variables_responsive.less";
  4
+@import "no_variables_bootstrap.less";
  5
+@import "no_variables_responsive.less";
6 6
 
7 7
 
8 8
 @import "custom.less";

No commit comments for this range

Something went wrong with that request. Please try again.