Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add the subindexes plugin. #67

Merged
merged 2 commits into from Jul 5, 2015

Conversation

Projects
None yet
2 participants
Contributor

bwinton commented Jan 26, 2015

One of the things I missed from PyBlosxom was a sub-index listing all the posts underneath a subdirectory.
So I wrote this. :)

Any suggestions about how to make it better would be greatly appreciated!

Review on Reviewable

Contributor

bwinton commented Jan 26, 2015

(Uh, that error doesn’t seem like something I caused…)

@Kwpolska Kwpolska added the new plugin label Jan 26, 2015

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

Kwpolska Jan 26, 2015

Owner

missing a license

(can be anything you like)

v7/subindexes/subindexes.py
@@ -0,0 +1,74 @@
+# -*- coding: utf-8 -*-
+
+from __future__ import unicode_literals
@Kwpolska

Kwpolska Jan 27, 2015

Owner

more like

# Copyright © 2015 Blake Winton.

Owner

Kwpolska commented Jan 27, 2015

It looks like this plugin completely ignores archives. You can easily have a blog which has indexes already there.

For example, my blog has https://chriswarrick.com/blog/2014/ and also https://chriswarrick.com/blog/2014/11/09/inbox-review/ via archives and posts/ structured mirrored in output.

Contributor

bwinton commented Jan 27, 2015

Neat. How did you get https://chriswarrick.com/blog/2014/11/09/inbox-review/ to show up there? Is the inbox-review post in a "2014/11/09" directory?

(Also, that seems to solve a slightly different problem than the one I was trying to solve, since I want the sub-indexes to show up, and https://chriswarrick.com/blog/2014/11/ doesn't show all the posts in 2014/11… :)

Owner

Kwpolska commented Jan 27, 2015

  1. Yes, the path is posts/2014/11/09/inbox-review.rst (/blog/ is handled by POSTS)
  2. 2014/11 does not work because I didn’t enable CREATE_MONTHLY_ARCHIVES, which is overkill for small blogs. I could also enable ARCHIVES_ARE_INDEXES and CREATE_DAILY_ARCHIVES for a better effect.
  3. Still, your plugin should check that it doesn’t conflict with archives. Otherwise, a nice error will prevent the site from building due to two tasks having the same target.
Contributor

bwinton commented Jan 27, 2015

Ah! Yes! I should definitely make it check for that.
Is there a clean way to say "Does this target already exist?" (or "Is another plugin going to handle this target?") so that I can skip generating it? (That would let me avoid the check at https://github.com/bwinton/plugins/blob/master/v7/subindexes/subindexes.py#L58 too!)

Owner

Kwpolska commented Jan 27, 2015

No, you’d have to check possibilities manually, according to current archive settings.

Kwpolska added a commit that referenced this pull request Jul 5, 2015

Merge pull request #67 from bwinton/master
Add the subindexes plugin.

@Kwpolska Kwpolska merged commit d444034 into getnikola:master Jul 5, 2015

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment