Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Support for hackerthemes #3053

Merged
merged 9 commits into from May 2, 2018
Merged

[WIP] Support for hackerthemes #3053

merged 9 commits into from May 2, 2018

Conversation

@ralsina
Copy link
Member

@ralsina ralsina commented Apr 19, 2018

Pull Request Checklist

  • I’ve read the guidelines for contributing.
  • I updated AUTHORS.txt and CHANGES.txt (if the change is non-trivial) and documentation (if applicable).
  • I tested my changes.

Description

CHANGES.txt Outdated
@@ -4,6 +4,7 @@ New in master
Features
--------

* Support hackerthemes.com themes and renamed bootswatch_theme command sub_theme (Issue #3049)
Copy link
Member

@Kwpolska Kwpolska Apr 19, 2018

I’d prefer to spell it nikola subtheme

Copy link
Member Author

@ralsina ralsina Apr 19, 2018

Done.

if fname == 'bootstrap.css':
url = 'https://raw.githubusercontent.com/HackerThemes/theme-machine/master/dist/{swatch}/css/bootstrap4-{swatch}.css'.format(swatch=swatch)
else:
url = 'https://raw.githubusercontent.com/HackerThemes/theme-machine/master/dist/{swatch}/css/bootstrap4-{swatch}.min.css'.format(swatch=swatch)
Copy link
Member

@Kwpolska Kwpolska Apr 19, 2018

There are also some extras required, eg. for executive-suite one needs to add Google fonts to <head>:

<link href="https://fonts.googleapis.com/css?family=Merriweather|Oswald|Source+Sans+Pro" rel="stylesheet">

Copy link
Member Author

@ralsina ralsina Apr 19, 2018

We could tweak that in the subtheme, I guess

Copy link
Member Author

@ralsina ralsina Apr 19, 2018

I added a warning.

@Kwpolska Kwpolska added this to the v8.0.0 milestone Apr 25, 2018
LOGGER.info("Downloading: " + url)
r = requests.get(url)
if r.status_code > 299:
LOGGER.error('Error {} getting {}', r.status_code, url)
exit(1)
return 1
data = r.text
with open(os.path.join('themes', name, 'assets', 'css', fname),
'wb+') as output:
output.write(data.encode('utf-8'))

with open(os.path.join('themes', name, 'parent'), 'wb+') as output:
Copy link
Member

@Kwpolska Kwpolska Apr 25, 2018

BTW, we should probably output a new-style .theme file instead of parent

Copy link
Member Author

@ralsina ralsina Apr 25, 2018

good point. I'll do that.

Copy link
Member Author

@ralsina ralsina May 2, 2018

Done

@Kwpolska Kwpolska added this to In Progress in Version 8 Apr 25, 2018
'%s.theme' % parent, themes)
cp = configparser.ConfigParser()
cp.read(parent_theme_data_path)
cp['Theme']['parent'] = parent
Copy link
Member

@Kwpolska Kwpolska May 2, 2018

missing engine. family is unnecessary.

Copy link
Member

@Kwpolska Kwpolska May 2, 2018

I take that back.

Copy link
Member

@Kwpolska Kwpolska left a comment

LGTM

@Kwpolska Kwpolska merged commit 99aa54d into master May 2, 2018
3 of 5 checks passed
Version 8 automation moved this from In Progress to Done May 2, 2018
@Kwpolska Kwpolska deleted the hackerthemes branch May 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Version 8
  
Done
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants