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

Plugin to change previous/next post to reflect section indices instead of global index #204

Merged
merged 8 commits into from Jan 13, 2017

Conversation

@wirew0rm
Copy link
Contributor

wirew0rm commented Jan 13, 2017

Plugin to solve getnikola/nikola#2625.

Subscribe to the 'taxonomies_classified' signal and upon receiving it update next_post and previous_post for every post to its successor/predecessor in it's corresponding section.

[Documentation]
author = Alexander Krimm
version = 0.8
website = https://getnikola.com/

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Jan 13, 2017

Member

Perhaps use your own website here?

This comment has been minimized.

Copy link
@wirew0rm

wirew0rm Jan 13, 2017

Author Contributor

Unfortunately it is not up yet, i've updated it to point to the plugin page itself.

@@ -0,0 +1,58 @@
# -*- coding: utf-8 -*-

# Copyright © 2012-2017 Roberto Alsina and others.

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Jan 13, 2017

Member

2017 only, and your name, goes here

# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

"""Render the taxonomy overviews, classification pages and feeds."""

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Jan 13, 2017

Member

This docstring, and the one in SectionNav, should be more descriptive.

for lang, langposts in site.posts_per_classification['section_index'].items():
for section, sectionposts in langposts.items():
for i, p in enumerate(sectionposts[1:]):
print(p.title)

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Jan 13, 2017

Member

Remove debug print statement here

version = 0.8
website = https://getnikola.com/
version = 0.1
website = https://plugins.getnikola.com/#section_prevnext

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Jan 13, 2017

Member

that isn’t going to be the URL anymore. You can use your own homepage here, or whatever else.

@Kwpolska Kwpolska merged commit c8f4a70 into getnikola:master Jan 13, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
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.