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: f706da9606cb
Choose a base ref
...
head repository: getnikola/nikola
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: adeb7d38ac82
Choose a head ref
  • 2 commits
  • 5 files changed
  • 1 contributor

Commits on May 17, 2017

  1. Fix #1891

    ralsina committed May 17, 2017
    Copy the full SHA
    9952415 View commit details
  2. fix test

    ralsina committed May 17, 2017

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    adeb7d3 View commit details
Showing with 15 additions and 12 deletions.
  1. +2 −0 CHANGES.txt
  2. +2 −2 nikola/conf.py.in
  3. +1 −0 nikola/data/themes/base/templates/page.tmpl
  4. +3 −3 nikola/plugins/command/init.py
  5. +7 −7 tests/test_integration.py
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -12,6 +12,8 @@ Bugfixes
--------

* Ignore files ending wih "bak" (Issue #2740)
* Use page.tmpl by default, which is inherited from story.tmpl (Issue
#1891)

New in v7.8.5
=============
4 changes: 2 additions & 2 deletions nikola/conf.py.in
Original file line number Diff line number Diff line change
@@ -123,8 +123,8 @@ THEME_COLOR = '#5670d4'
# Finally, note that destination can be translated, i.e. you can
# specify a different translation folder per language. Example:
# PAGES = (
# ("pages/*.rst", {"en": "pages", "de": "seiten"}, "story.tmpl"),
# ("pages/*.md", {"en": "pages", "de": "seiten"}, "story.tmpl"),
# ("pages/*.rst", {"en": "pages", "de": "seiten"}, "page.tmpl"),
# ("pages/*.md", {"en": "pages", "de": "seiten"}, "page.tmpl"),
# )

POSTS = ${POSTS}
1 change: 1 addition & 0 deletions nikola/data/themes/base/templates/page.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%inherit file="story.tmpl"/>
6 changes: 3 additions & 3 deletions nikola/plugins/command/init.py
Original file line number Diff line number Diff line change
@@ -78,9 +78,9 @@
("posts/*.html", "posts", "post.tmpl"),
)""",
'PAGES': """(
("pages/*.rst", "pages", "story.tmpl"),
("pages/*.txt", "pages", "story.tmpl"),
("pages/*.html", "pages", "story.tmpl"),
("pages/*.rst", "pages", "page.tmpl"),
("pages/*.txt", "pages", "page.tmpl"),
("pages/*.html", "pages", "page.tmpl"),
)""",
'COMPILERS': """{
"rest": ('.rst', '.txt'),
14 changes: 7 additions & 7 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
@@ -392,10 +392,10 @@ def patch_site(self):
conf_path = os.path.join(self.target_dir, "conf.py")
with io.open(conf_path, "r", encoding="utf-8") as inf:
data = inf.read()
data = data.replace('("pages/*.txt", "pages", "story.tmpl"),',
'("pages/*.txt", "", "story.tmpl"),')
data = data.replace('("pages/*.rst", "pages", "story.tmpl"),',
'("pages/*.rst", "", "story.tmpl"),')
data = data.replace('("pages/*.txt", "pages", "page.tmpl"),',
'("pages/*.txt", "", "page.tmpl"),')
data = data.replace('("pages/*.rst", "pages", "page.tmpl"),',
'("pages/*.rst", "", "page.tmpl"),')
data = data.replace('# INDEX_PATH = ""',
'INDEX_PATH = "blog"')
with io.open(conf_path, "w+", encoding="utf8") as outf:
@@ -553,7 +553,7 @@ def patch_site(self):
"""Enable post sections."""
conf_path = os.path.join(self.target_dir, "conf.py")
with io.open(conf_path, "a", encoding="utf8") as outf:
outf.write("""\n\nPOSTS_SECTIONS = True\nPOSTS_SECTIONS_ARE_INDEXES = True\nPRETTY_URLS = True\nPOSTS = (('posts/*.txt', '', 'post.tmpl'),)\nPAGES = (('pages/*.txt', '', 'story.tmpl'),)\n\n""")
outf.write("""\n\nPOSTS_SECTIONS = True\nPOSTS_SECTIONS_ARE_INDEXES = True\nPRETTY_URLS = True\nPOSTS = (('posts/*.txt', '', 'post.tmpl'),)\nPAGES = (('pages/*.txt', '', 'page.tmpl'),)\n\n""")

@classmethod
def fill_site(self):
@@ -602,7 +602,7 @@ def patch_site(self):
"""Enable PAGE_INDEX."""
conf_path = os.path.join(self.target_dir, "conf.py")
with io.open(conf_path, "a", encoding="utf8") as outf:
outf.write("""\n\nPAGE_INDEX = True\nPRETTY_URLS = False\nPAGES = PAGES + (('pages/*.php', 'pages', 'story.tmpl'),)\n\n""")
outf.write("""\n\nPAGE_INDEX = True\nPRETTY_URLS = False\nPAGES = PAGES + (('pages/*.php', 'pages', 'page.tmpl'),)\n\n""")

@classmethod
def fill_site(self):
@@ -707,7 +707,7 @@ def patch_site(self):
"""Enable PAGE_INDEX."""
conf_path = os.path.join(self.target_dir, "conf.py")
with io.open(conf_path, "a", encoding="utf8") as outf:
outf.write("""\n\nPAGE_INDEX = True\nPRETTY_URLS = True\nPAGES = PAGES + (('pages/*.php', 'pages', 'story.tmpl'),)\n\n""")
outf.write("""\n\nPAGE_INDEX = True\nPRETTY_URLS = True\nPAGES = PAGES + (('pages/*.php', 'pages', 'page.tmpl'),)\n\n""")

def _make_output_path(self, dir, name):
"""Make a file path to the output."""