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

Sidebar plugin #195

Merged
merged 4 commits into from Jan 6, 2017
Merged

Sidebar plugin #195

merged 4 commits into from Jan 6, 2017

Conversation

@felixfontein
Copy link
Contributor

felixfontein commented Jan 6, 2017

This plugin generates a sidebar include for every language based on a template.


The generated include file, one per language, must be somehow included in the rest of the blog. This can be done by using JavaScript to dynamically include the file, or by using tools like `File Tree Subs <https://github.com/felixfontein/filetreesubs/>`__.
The number of most recent posts can be changed by defining ``SIDEBAR_MAXIMAL_POST_COUNT = number`` in the Nikola configuration.

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Jan 6, 2017

Member

maximum sounds better

This comment has been minimized.

Copy link
@felixfontein

felixfontein Jan 6, 2017

Author Contributor

fixed

# Fake hierarchy
hierarchy = [(classification_name, classification, taxonomy.extract_hierarchy(classification),
self.site.link(taxonomy_name, classification, lang),
(i, len(result)), 1 if i == 0 else 0, -1 if i == len(result) - 1 else 0, 0,

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Jan 6, 2017

Member

That’s pretty cryptic, don’t you think?

This comment has been minimized.

Copy link
@felixfontein

felixfontein Jan 6, 2017

Author Contributor

I'll document it better

This comment has been minimized.

Copy link
@felixfontein

felixfontein Jan 6, 2017

Author Contributor

I changed the code instead.

@@ -0,0 +1,55 @@
{# -*- coding: utf-8 -*- #}

{% macro posts(posts) %}

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Jan 6, 2017

Member

That name might easily conflict with the posts variable.

This comment has been minimized.

Copy link
@felixfontein

felixfontein Jan 6, 2017

Author Contributor

I renamed it to list_posts.

@Kwpolska Kwpolska merged commit 95c75e3 into master Jan 6, 2017
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@Kwpolska Kwpolska deleted the sidebar branch Jan 6, 2017
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

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