Repository: getnikola/nikola

Issue:
Get rid of "stories" everywhere
The "stories" term is a remnant of my own config before I even started writing Nikola. In fact, the term comes from PyDS, a blogging software so old it doesn't even have a website anymore.

So, the right term is "pages", let's use it.
- [x] Remove "stories" from the docs
- [x] Remove "stories" from the config (for new sites at least)
- [x] Remove "stories" from the code (if it's still there) (done except for public APIs)
- [x] Move `story.tmpl` code to `page.tmpl`, leaving `story.tmpl` as a stub

Once we are using pages consistently everywhere, this closes.



Discussion:
How would that last point affect users who have a custom template named page.tmpl (which inherits from story.tmpl)?

Hi, I found this issue through up-for-grabs.net. I've done the easy part of this, replacing all instances of 'story' and 'stories' with 'page' and 'pages', in christianp/nikola@2dfe792d93440c5c1a203df328a6641bc58a0e2f.
I renamed two config settings: `STORY_INDEX` and `COMMENTS_IN_STORIES`, which will cause upgrade headaches. And the point about `page.tmpl` potentially already existing is a good one.

Please make a Pull Request so we can discuss this further.


Resolving patch:
diff --git a/nikola/plugins/command/init.py b/nikola/plugins/command/init.py
--- a/nikola/plugins/command/init.py
+++ b/nikola/plugins/command/init.py
@@ -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'),


Test patch:
diff --git a/tests/test_integration.py b/tests/test_integration.py
--- a/tests/test_integration.py
+++ b/tests/test_integration.py
@@ -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."""