Skip to content

Commit

Permalink
Fix #45 -- nuke v5 themes and hide v6 themes
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jun 23, 2015
1 parent 761dedf commit c27bfdd
Show file tree
Hide file tree
Showing 574 changed files with 15 additions and 560,508 deletions.
23 changes: 15 additions & 8 deletions scripts/build_site.py
Expand Up @@ -18,29 +18,36 @@

MINIMUM_VERSION_SUPPORTED = 6
MAXIMUM_VERSION_SUPPORTED = 7
ALL_VERSIONS = list(range(MINIMUM_VERSION_SUPPORTED, MAXIMUM_VERSION_SUPPORTED + 1))
ALL_VERSIONS_SUPPORTED = list(range(MINIMUM_VERSION_SUPPORTED, MAXIMUM_VERSION_SUPPORTED + 1))

MINIMUM_VERSION_DISPLAYED = 7
MAXIMUM_VERSION_DISPLAYED = 7
ALL_VERSIONS_DISPLAYED = list(range(MINIMUM_VERSION_DISPLAYED, MAXIMUM_VERSION_DISPLAYED + 1))

GLOB = "v{0}/*".format(MAXIMUM_VERSION_SUPPORTED)
DIR = "v{0}".format(MAXIMUM_VERSION_SUPPORTED)

def error(msg):
print(colorama.Fore.RED + "ERROR:" + msg)

def theme_list():
return sorted(['base', 'base-jinja', 'bootstrap', 'bootstrap-jinja', 'bootstrap3', 'bootstrap3-jinja'] + [theme.split('/')[-1] for theme in glob.glob("v{0}/*".format(MAXIMUM_VERSION_SUPPORTED))])
return sorted(['base', 'base-jinja', 'bootstrap', 'bootstrap-jinja', 'bootstrap3', 'bootstrap3-jinja'] + [theme.split('/')[-1] for theme in glob.glob(GLOB)])

def build_site():
data = {}
for theme in theme_list():
data[theme] = get_data(theme)

data['__meta__'] = {'allver': ALL_VERSIONS}
data['__meta__'] = {'allver': ALL_VERSIONS_DISPLAYED}
with open(os.path.join('output', 'theme_data.js'), 'wb+') as outf:
outf.write("var data = " + json.dumps(data, indent=4, ensure_ascii=True, sort_keys=True))

def get_data(theme):
data = {}
data['chain'] = utils.get_theme_chain(theme, 'v7')
data['chain'] = utils.get_theme_chain(theme, DIR)
data['name'] = theme
readme = utils.get_asset_path('README.md', data['chain'], _themes_dir='v7')
conf_sample = utils.get_asset_path('conf.py.sample', data['chain'], _themes_dir='v7')
readme = utils.get_asset_path('README.md', data['chain'], _themes_dir=DIR)
conf_sample = utils.get_asset_path('conf.py.sample', data['chain'], _themes_dir=DIR)
if readme:
data['readme'] = codecs.open(readme, 'r', 'utf8').read()
else:
Expand All @@ -58,11 +65,11 @@ def get_data(theme):
'bootstrap3-jinja' in data['chain'] or
'bootstrap3' in data['chain']) and \
'bootstrap3-gradients' not in data['chain']
data['engine'] = utils.get_template_engine(data['chain'], 'v7')
data['engine'] = utils.get_template_engine(data['chain'], DIR)
data['chain'] = data['chain'][::-1]

data['allver'] = []
for v in ALL_VERSIONS:
for v in ALL_VERSIONS_SUPPORTED:
if glob.glob('v{0}/*'.format(v)):
data['allver'].append(v)

Expand Down
1 change: 0 additions & 1 deletion v5/README.md

This file was deleted.

7 changes: 0 additions & 7 deletions v5/bootstrap_themes.txt

This file was deleted.

15 changes: 0 additions & 15 deletions v5/bootswatch_themes.txt

This file was deleted.

0 comments on commit c27bfdd

Please sign in to comment.