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

Adds THEME_COLORS, POSTS_CATEGORIES, POSTS_CATEGORY_*, and HUSL color functions #1981

Merged
merged 22 commits into from Aug 31, 2015

Conversation

@da2x
Copy link
Contributor

da2x commented Aug 27, 2015

See Issue #1980 before proceeding.

Colors are not displayed anywhere just yet, except by adding a <meta name="theme-color">.

@@ -89,6 +89,10 @@ NAVIGATION_LINKS = ${NAVIGATION_LINKS}
# Name of the theme to use.
THEME = ${THEME}

# Primary color of your theme. This will be used to customize your theme and
# auto-generate related colors in POSTS_CATEGORY_COLORS. Must be a HEX value.
THEME_COLOR = '#5670d4'

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Aug 27, 2015

Member

why this color?

This comment has been minimized.

Copy link
@da2x

da2x Aug 27, 2015

Author Contributor

Generic light corporate blue were designed to be non-offensive and enduce trust. Sounds like a perfect candidate for a nonintrusive default if I ever heard one. Goes well with the default bootstrap3 theme. Feel free to suggest another.

da2x added 4 commits Aug 27, 2015
@da2x
Copy link
Contributor Author

da2x commented Aug 27, 2015

@ralsina, @Kwpolska what do you guys think?

# is assigned to each category based on shifting the hue of your THEME_COLOR
# at least 7.5 % while leaving the lightness and saturation untouched in the
# HUSL colorspace. You can overwrite colors by assigning them colors in HEX.
POSTS_CATEGORY_COLORS = {

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Aug 28, 2015

Member

should be commented out by default, along with POST_CATEGORY_DESCRIPTIONS and POST_CATEGORY_TITLE

{% block extra_head %}
{{ super() }}
{% if generate_atom %}
<link rel="alternate" type="application/atom+xml" title="Atom for the {{ posts[0].category_name() }} section" href="/FIXME">

This comment has been minimized.

Copy link
@Kwpolska
@@ -36,4 +36,6 @@
"Write your post here.": "Write your post here.",
"old posts, page %d": "old posts, page %d",
"page %d": "page %d",
"uncategorized": "Uncategorized",

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Aug 28, 2015

Member

both sides should be the same (uppercase)

@@ -1673,6 +1674,31 @@ def escape(s):
return '/'.join([escape(p) for p in category_path])


def colorize_str_from_base_color(string, base_color):
"""Find a perceptual similar color from a base color based on the hash of a sring.

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Aug 28, 2015

Member

string*

also, it would be nice to expose this function as part of the global context

da2x added 2 commits Aug 28, 2015
functions available in themes (Issue #1980)

Minor changes.
da2x added 6 commits Aug 28, 2015
@da2x
Copy link
Contributor Author

da2x commented Aug 29, 2015

I think it should be ready to merge now.

@da2x
Copy link
Contributor Author

da2x commented Aug 30, 2015

@ralsina have you got any time to look through this before merging?

@ralsina
Copy link
Member

ralsina commented Aug 30, 2015

Tomorrow morning I will.

@ralsina
Copy link
Member

ralsina commented Aug 30, 2015

LGTM. However, since sections is a new concept it needs documenting. I can do it myself since you already did the hard work of actually implementing them :-)

da2x added a commit that referenced this pull request Aug 31, 2015
Add Sections and related color functionality for theme authors
@da2x da2x merged commit 0b24500 into master Aug 31, 2015
1 of 3 checks passed
1 of 3 checks passed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/travis-ci/push The Travis CI build failed
Details
continuous-integration/appveyor AppVeyor build succeeded
Details
@da2x da2x self-assigned this Aug 31, 2015
@Kwpolska Kwpolska deleted the posts-categories branch Dec 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.