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

Bootblog4 featured posts and sidebar #3087

Merged
merged 13 commits into from May 13, 2018
Merged

Conversation

Kwpolska
Copy link
Member

@Kwpolska Kwpolska commented May 12, 2018

This adds featured posts and a sidebar to bootblog4. Testing needed.
screenshot 2018-05-13 00 16 25

Resolves #2964.

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
@ralsina
Copy link
Member

ralsina commented May 13, 2018

Does it move the search form to the sidebar? That may fix our other issue :-)

@Kwpolska
Copy link
Member Author

SEARCH_FORM will stay in the top navigation, but with some other tricks needed (so it would collapse). The sidebar is optional; users are free to put anything — including the search form — in their sidebar.

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Kwpolska added a commit that referenced this pull request May 13, 2018
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
@Kwpolska
Copy link
Member Author

Kwpolska commented May 13, 2018

Mobile improved as well:

image

image

This fixes #3069. The animation isn’t perfect, but it’s the best I can do.

Still to do:

  • docs for featured posts
  • THEME_COLOR → THEME_CONFIG['color']
  • testing, especially of featured posts, is very welcome

Copy link
Member

@ralsina ralsina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM I want this on my site ;-)

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Copy link
Contributor

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't look at the themes themselves, only at the changes to Nikola itself. They LGTM, except the two comments you might want to consider (or not).

@@ -117,6 +117,7 @@ def provide_context_and_uptodate(self, classification, lang, node=None):
"title": self.site.config["INDEXES_TITLE"](lang) or self.site.config["BLOG_TITLE"](lang),
"description": self.site.config["BLOG_DESCRIPTION"](lang),
"pagekind": ["main_index", "index"],
"featured": [p for p in self.site.posts if p.post_status == 'featured' and lang in p.translated_to],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about untranslated featured posts, when SHOW_UNTRANSLATED_POSTS is set to True?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point, will do this in a while.

context["is_frontmost_index"] = i == 0

# Add dependencies to featured posts
if 'featured' in context:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should mention that in the docstring of generic_index_renderer, in case someone wants to put something else called featured in there.

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
@Kwpolska Kwpolska merged commit 616bd2d into master May 13, 2018
@felixfontein felixfontein deleted the bootblog4-featured-posts branch May 13, 2018 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants