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 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.
Copy link
Member

@Kwpolska Kwpolska Jan 6, 2017

maximum sounds better

Copy link
Contributor Author

@felixfontein felixfontein Jan 6, 2017

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,
Copy link
Member

@Kwpolska Kwpolska Jan 6, 2017

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

Copy link
Contributor Author

@felixfontein felixfontein Jan 6, 2017

I'll document it better

Copy link
Contributor Author

@felixfontein felixfontein Jan 6, 2017

I changed the code instead.

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

{% macro posts(posts) %}
Copy link
Member

@Kwpolska Kwpolska Jan 6, 2017

That name might easily conflict with the posts variable.

Copy link
Contributor Author

@felixfontein felixfontein Jan 6, 2017

I renamed it to list_posts.

@Kwpolska Kwpolska merged commit 95c75e3 into master Jan 6, 2017
2 checks passed
@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