Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: getnikola/nikola
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d03c304e9372
Choose a base ref
...
head repository: getnikola/nikola
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 015ae64409bf
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on May 22, 2017

  1. Add 'archive_index' and 'section' variables to classification pages

    Signed-off-by: Chris Warrick <kwpolska@gmail.com>
    Kwpolska committed May 22, 2017
    Copy the full SHA
    bf1b20c View commit details
  2. Ignore all of .idea

    Signed-off-by: Chris Warrick <kwpolska@gmail.com>
    Kwpolska committed May 22, 2017
    Copy the full SHA
    015ae64 View commit details
Showing with 32 additions and 5 deletions.
  1. +17 −2 .gitignore
  2. +12 −1 docs/template-variables.rst
  3. +1 −1 nikola/plugins/task/archive.py
  4. +2 −1 nikola/plugins/task/sections.py
19 changes: 17 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -12,7 +12,10 @@ output/
#
.DS_Store

# Created by https://www.gitignore.io/api/pydev,python,pycharm
# All of .idea should be ignored
.idea/

# Created by https://www.gitignore.io/api/pydev,python,pycharm,vim

### PyCharm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
@@ -179,4 +182,16 @@ ENV/
# mkdocs documentation
/site

# End of https://www.gitignore.io/api/pydev,python,pycharm
### Vim ###
# swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-v][a-z]
[._]sw[a-p]
# session
Session.vim
# temporary
.netrwhist
*~

# End of https://www.gitignore.io/api/pydev,python,pycharm,vim
13 changes: 12 additions & 1 deletion docs/template-variables.rst
Original file line number Diff line number Diff line change
@@ -301,7 +301,7 @@ The archive navigation variables are available only if ``create_archive_navigati
============================== ============== ===============================================
Name Type Description
============================== ============== ===============================================
``archive_name`` str? Name of the archive (only if using indexes)
``archive_name`` str? Name of the archive
``create_archive_navigation`` bool ``CREATE_ARCHIVE_NAVIGATION`` setting
``has_archive_navigation`` bool Whether or not archive navigation is available
``up_archive`` str? Link to the archive one level up
@@ -377,6 +377,17 @@ Name Type Description
``source_link`` str Link to the source file
================== ========== ========================================

Variables available in sections
-------------------------------

.. class:: table table-bordered table-striped

=========== ===== ========================
Name Type Description
=========== ===== ========================
``section`` str Section name (internal)
=========== ===== ========================

Variables available in tag pages
--------------------------------

2 changes: 1 addition & 1 deletion nikola/plugins/task/archive.py
Original file line number Diff line number Diff line change
@@ -180,6 +180,7 @@ def provide_context_and_uptodate(self, classification, lang, node=None):
"title": title,
"pagekind": [page_kind, "archive_page"],
"create_archive_navigation": self.site.config["CREATE_ARCHIVE_NAVIGATION"],
"archive_name": classification if classification else None
}

# Generate links for hierarchies
@@ -210,7 +211,6 @@ def provide_context_and_uptodate(self, classification, lang, node=None):
else:
context["has_archive_navigation"] = False
if page_kind == 'index':
context["archive_name"] = classification if classification else None
context["is_feed_stale"] = kw["is_feed_stale"]
kw.update(context)
return context, kw
3 changes: 2 additions & 1 deletion nikola/plugins/task/sections.py
Original file line number Diff line number Diff line change
@@ -122,7 +122,8 @@ def provide_context_and_uptodate(self, section, lang, node=None):
context = {
"title": section_title,
"description": self.site.config['POSTS_SECTION_DESCRIPTIONS'](lang)[section] if section in self.site.config['POSTS_SECTION_DESCRIPTIONS'](lang) else "",
"pagekind": ["section_page", "index" if self.show_list_as_index else "list"]
"pagekind": ["section_page", "index" if self.show_list_as_index else "list"],
"section": section,
}
kw.update(context)
return context, kw