From: Vladimír Vondruš Date: Sat, 9 Dec 2017 23:01:23 +0000 (+0100) Subject: theme: test blog rendering. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=f5bd8739603636be3a65bcb5f6bce857d86c138f;p=blog.git theme: test blog rendering. --- diff --git a/pelican-theme/test/__init__.py b/pelican-theme/test/__init__.py index 56df9d4a..80f8d95d 100644 --- a/pelican-theme/test/__init__.py +++ b/pelican-theme/test/__init__.py @@ -58,3 +58,25 @@ class BaseTestCase(MinimalTestCase): 'SLUGIFY_SOURCE': 'basename' } MinimalTestCase.run_pelican(self, {**implicit_settings, **settings}) + +class BlogTestCase(BaseTestCase): + def run_pelican(self, settings): + implicit_settings = { + 'DATE_FORMATS': {'en': ('en_US.UTF-8', '%b %d, %Y')}, + 'M_FINE_PRINT': None, + 'PAGE_PATHS': ['pages'], # doesn't exist + 'ARTICLE_PATHS': ['.'], + 'AUTHOR_SAVE_AS': 'author-{slug}.html', + 'AUTHOR_URL': 'author-{slug}.html', + 'CATEGORY_SAVE_AS': 'category-{slug}.html', + 'CATEGORY_URL': 'category-{slug}.html', + 'TAG_SAVE_AS': 'tag-{slug}.html', + 'TAG_URL': 'tag-{slug}.html', + + # No m.css stuff to test there + 'CATEGORY_FEED_ATOM': None, + 'AUTHOR_FEED_ATOM': None, + 'AUTHOR_FEED_RSS': None, + 'TRANSLATION_FEED_ATOM': None + } + BaseTestCase.run_pelican(self, {**implicit_settings, **settings}) diff --git a/pelican-theme/test/blog/article-jumbo.html b/pelican-theme/test/blog/article-jumbo.html new file mode 100644 index 00000000..168e83c7 --- /dev/null +++ b/pelican-theme/test/blog/article-jumbo.html @@ -0,0 +1,97 @@ + + + + + An article — a jumbo one | A Pelican Blog + + + + + + + + + + + + + + + + +
+
+ + +
+ + diff --git a/pelican-theme/test/blog/article-jumbo.rst b/pelican-theme/test/blog/article-jumbo.rst new file mode 100644 index 00000000..951b582c --- /dev/null +++ b/pelican-theme/test/blog/article-jumbo.rst @@ -0,0 +1,15 @@ +An article — a jumbo one +######################## + +.. author is implicit +.. em-dash needs to be explicit as smart quotes are not enabled by default + +:date: 2017-12-08 +:category: Another category +:tags: Fourth, First, Third +:cover: {filename}/ship.jpg +:summary: A summary. + On multiple + lines. + +Some content. diff --git a/pelican-theme/test/blog/article.html b/pelican-theme/test/blog/article.html new file mode 100644 index 00000000..86f09247 --- /dev/null +++ b/pelican-theme/test/blog/article.html @@ -0,0 +1,69 @@ + + + + + An article | A Pelican Blog + + + + + + + + + + + + + + + +
+
+
+
+ + +
+
+
+ + diff --git a/pelican-theme/test/blog/article.rst b/pelican-theme/test/blog/article.rst new file mode 100644 index 00000000..a4a1660e --- /dev/null +++ b/pelican-theme/test/blog/article.rst @@ -0,0 +1,13 @@ +An article +########## + +:date: 2017-12-09 +:category: A category +:tags: First, Third, Second +:author: Explicit Author +:description: Article description for the fake SEO believers. +:summary: The summary. + On multiple + lines. + +The content, expanded fully on the page. diff --git a/pelican-theme/test/blog/author-explicit-author.html b/pelican-theme/test/blog/author-explicit-author.html new file mode 100644 index 00000000..9e99a57c --- /dev/null +++ b/pelican-theme/test/blog/author-explicit-author.html @@ -0,0 +1,61 @@ + + + + + Posts by Explicit Author | A Pelican Blog + + + + + +
+
+
+
+
+
+ Showing only posts by Explicit Author. Show all posts. +
+ +
+ +
+
+
+ + diff --git a/pelican-theme/test/blog/category-another-category.html b/pelican-theme/test/blog/category-another-category.html new file mode 100644 index 00000000..fa71eb93 --- /dev/null +++ b/pelican-theme/test/blog/category-another-category.html @@ -0,0 +1,61 @@ + + + + + Another category | A Pelican Blog + + + + + +
+
+
+
+
+
+ Showing only posts in Another category. Show all posts. +
+ +
+ +
+
+
+ + diff --git a/pelican-theme/test/blog/index.html b/pelican-theme/test/blog/index.html new file mode 100644 index 00000000..0fe85c5b --- /dev/null +++ b/pelican-theme/test/blog/index.html @@ -0,0 +1,78 @@ + + + + + A Pelican Blog + + + + + +
+
+
+
+
+ + +
+ +
+
+
+ + diff --git a/pelican-theme/test/blog/ship.jpg b/pelican-theme/test/blog/ship.jpg new file mode 120000 index 00000000..d4469e38 --- /dev/null +++ b/pelican-theme/test/blog/ship.jpg @@ -0,0 +1 @@ +../../../doc/static/ship.jpg \ No newline at end of file diff --git a/pelican-theme/test/blog/tag-third.html b/pelican-theme/test/blog/tag-third.html new file mode 100644 index 00000000..a0b14168 --- /dev/null +++ b/pelican-theme/test/blog/tag-third.html @@ -0,0 +1,78 @@ + + + + + Posts tagged Third | A Pelican Blog + + + + + +
+
+
+
+
+
+ Showing only posts tagged Third. Show all posts. +
+ + +
+ +
+
+
+ + diff --git a/pelican-theme/test/blog_author_list/article-jumbo.html b/pelican-theme/test/blog_author_list/article-jumbo.html new file mode 100644 index 00000000..225aa4b6 --- /dev/null +++ b/pelican-theme/test/blog_author_list/article-jumbo.html @@ -0,0 +1,72 @@ + + + + + A jumbo article | A Pelican Blog + + + + + + + + + + + + + + +
+
+ + +
+ + diff --git a/pelican-theme/test/blog_author_list/article-jumbo.rst b/pelican-theme/test/blog_author_list/article-jumbo.rst new file mode 100644 index 00000000..719495c6 --- /dev/null +++ b/pelican-theme/test/blog_author_list/article-jumbo.rst @@ -0,0 +1,6 @@ +A jumbo article +############### + +:date: 2017-12-09 +:cover: image.jpg + diff --git a/pelican-theme/test/blog_author_list/article.rst b/pelican-theme/test/blog_author_list/article.rst new file mode 100644 index 00000000..ea8d0b95 --- /dev/null +++ b/pelican-theme/test/blog_author_list/article.rst @@ -0,0 +1,4 @@ +An article +########## + +:date: 2017-12-09 diff --git a/pelican-theme/test/blog_author_list/index.html b/pelican-theme/test/blog_author_list/index.html new file mode 100644 index 00000000..b54d6477 --- /dev/null +++ b/pelican-theme/test/blog_author_list/index.html @@ -0,0 +1,65 @@ + + + + + A Pelican Blog + + + + + +
+
+
+
+
+ + +
+ +
+
+
+ + diff --git a/pelican-theme/test/blog_collapse_first_article/article.rst b/pelican-theme/test/blog_collapse_first_article/article.rst new file mode 100644 index 00000000..7c58a8bb --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_article/article.rst @@ -0,0 +1,8 @@ +An article +########## + +:date: 2017-12-09 +:summary: The summary. +:collapse_first: True + +The content, not expanded. diff --git a/pelican-theme/test/blog_collapse_first_article/article2.rst b/pelican-theme/test/blog_collapse_first_article/article2.rst new file mode 100644 index 00000000..73a012d9 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_article/article2.rst @@ -0,0 +1,8 @@ +An article 2 +############ + +:date: 2017-12-08 +:summary: Article 2 summary. +:collapse_first: True + +The content, not expanded as this is a second article. diff --git a/pelican-theme/test/blog_collapse_first_article_hide_summary_article/article-jumbo.rst b/pelican-theme/test/blog_collapse_first_article_hide_summary_article/article-jumbo.rst new file mode 100644 index 00000000..25060f30 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_article_hide_summary_article/article-jumbo.rst @@ -0,0 +1,10 @@ +A jumbo article +############### + +:date: 2017-12-08 +:cover: image.jpg +:collapse_first: True +:hide_summary: True +:summary: Jumbo article summary, shown only on listing. + +The content, expanded only on page. diff --git a/pelican-theme/test/blog_collapse_first_article_hide_summary_article/article.rst b/pelican-theme/test/blog_collapse_first_article_hide_summary_article/article.rst new file mode 100644 index 00000000..06f404e7 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_article_hide_summary_article/article.rst @@ -0,0 +1,9 @@ +An article +########## + +:date: 2017-12-09 +:collapse_first: True +:hide_summary: True +:summary: The summary, shown on listing. + +The content, expanded only on page. diff --git a/pelican-theme/test/blog_collapse_first_article_hide_summary_both/article-jumbo.rst b/pelican-theme/test/blog_collapse_first_article_hide_summary_both/article-jumbo.rst new file mode 100644 index 00000000..9866d998 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_article_hide_summary_both/article-jumbo.rst @@ -0,0 +1,11 @@ +A jumbo article +############### + +:date: 2017-12-08 +:cover: image.jpg +:collapse_first: True +:hide_summary: False +:summary: Jumbo article summary, expanded only on listing. + +The content, expanded only on page. + diff --git a/pelican-theme/test/blog_collapse_first_article_hide_summary_both/article.rst b/pelican-theme/test/blog_collapse_first_article_hide_summary_both/article.rst new file mode 100644 index 00000000..b5d98a0a --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_article_hide_summary_both/article.rst @@ -0,0 +1,9 @@ +An article +########## + +:date: 2017-12-09 +:collapse_first: True +:hide_summary: False +:summary: The summary, expanded only on listing. + +The content, expanded on listing and on page. diff --git a/pelican-theme/test/blog_collapse_first_article_hide_summary_global/article-jumbo.rst b/pelican-theme/test/blog_collapse_first_article_hide_summary_global/article-jumbo.rst new file mode 100644 index 00000000..b1b2721b --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_article_hide_summary_global/article-jumbo.rst @@ -0,0 +1,9 @@ +A jumbo article +############### + +:date: 2017-12-08 +:cover: image.jpg +:collapse_first: True +:summary: Jumbo article summary, shown only on listing. + +The content, expanded only on page. diff --git a/pelican-theme/test/blog_collapse_first_article_hide_summary_global/article.rst b/pelican-theme/test/blog_collapse_first_article_hide_summary_global/article.rst new file mode 100644 index 00000000..53e62175 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_article_hide_summary_global/article.rst @@ -0,0 +1,8 @@ +An article +########## + +:date: 2017-12-09 +:collapse_first: True +:summary: The summary, shown on listing. + +The content, expanded only on page. diff --git a/pelican-theme/test/blog_collapse_first_both/article.rst b/pelican-theme/test/blog_collapse_first_both/article.rst new file mode 100644 index 00000000..e6034550 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_both/article.rst @@ -0,0 +1,8 @@ +An article +########## + +:date: 2017-12-09 +:summary: The summary. +:collapse_first: False + +The content, expanded fully on the page. diff --git a/pelican-theme/test/blog_collapse_first_both/article2.rst b/pelican-theme/test/blog_collapse_first_both/article2.rst new file mode 100644 index 00000000..eb6a8b8f --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_both/article2.rst @@ -0,0 +1,8 @@ +An article 2 +############ + +:date: 2017-12-08 +:summary: Article 2 summary. +:collapse_first: False + +The content, not expanded as this is a second article. diff --git a/pelican-theme/test/blog_collapse_first_both/index.html b/pelican-theme/test/blog_collapse_first_both/index.html new file mode 100644 index 00000000..3832d698 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_both/index.html @@ -0,0 +1,66 @@ + + + + + A Pelican Blog + + + + + +
+
+
+
+
+ + +
+ +
+
+
+ + \ No newline at end of file diff --git a/pelican-theme/test/blog_collapse_first_both_hide_summary_article/article-jumbo.rst b/pelican-theme/test/blog_collapse_first_both_hide_summary_article/article-jumbo.rst new file mode 100644 index 00000000..2c57326b --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_both_hide_summary_article/article-jumbo.rst @@ -0,0 +1,10 @@ +A jumbo article +############### + +:date: 2017-12-08 +:cover: image.jpg +:collapse_first: False +:hide_summary: True +:summary: Jumbo article summary, shown only on listing. + +The content, expanded only on page. diff --git a/pelican-theme/test/blog_collapse_first_both_hide_summary_article/article.rst b/pelican-theme/test/blog_collapse_first_both_hide_summary_article/article.rst new file mode 100644 index 00000000..823d6dae --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_both_hide_summary_article/article.rst @@ -0,0 +1,9 @@ +An article +########## + +:date: 2017-12-09 +:collapse_first: False +:hide_summary: True +:summary: The summary, shown nowhere. + +The content, expanded on listing and on page. diff --git a/pelican-theme/test/blog_collapse_first_both_hide_summary_both/article-jumbo.html b/pelican-theme/test/blog_collapse_first_both_hide_summary_both/article-jumbo.html new file mode 100644 index 00000000..b9bbb888 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_both_hide_summary_both/article-jumbo.html @@ -0,0 +1,83 @@ + + + + + A jumbo article | A Pelican Blog + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
Dec 08, 2017
+
+
+ +
+
+
+
+
+
+
+

Jumbo article summary, expanded on both listing and page.

+
+
+
+
+
+
+
+ +

The content, expanded only on page.

+ +
+
+
+
+
+
+

Posted on in misc.

+
+
+
+
+ +
+ + \ No newline at end of file diff --git a/pelican-theme/test/blog_collapse_first_both_hide_summary_both/article-jumbo.rst b/pelican-theme/test/blog_collapse_first_both_hide_summary_both/article-jumbo.rst new file mode 100644 index 00000000..b4b41155 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_both_hide_summary_both/article-jumbo.rst @@ -0,0 +1,10 @@ +A jumbo article +############### + +:date: 2017-12-08 +:cover: image.jpg +:collapse_first: False +:hide_summary: False +:summary: Jumbo article summary, expanded on both listing and page. + +The content, expanded only on page. diff --git a/pelican-theme/test/blog_collapse_first_both_hide_summary_both/article.html b/pelican-theme/test/blog_collapse_first_both_hide_summary_both/article.html new file mode 100644 index 00000000..9eb362d0 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_both_hide_summary_both/article.html @@ -0,0 +1,58 @@ + + + + + An article | A Pelican Blog + + + + + + + + + + + + + + +
+
+
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/pelican-theme/test/blog_collapse_first_both_hide_summary_both/article.rst b/pelican-theme/test/blog_collapse_first_both_hide_summary_both/article.rst new file mode 100644 index 00000000..875cb614 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_both_hide_summary_both/article.rst @@ -0,0 +1,9 @@ +An article +########## + +:date: 2017-12-09 +:collapse_first: False +:hide_summary: False +:summary: The summary, expanded on both listing and page. + +The content, expanded on listing and on page. diff --git a/pelican-theme/test/blog_collapse_first_both_hide_summary_both/index.html b/pelican-theme/test/blog_collapse_first_both_hide_summary_both/index.html new file mode 100644 index 00000000..dbed2c8e --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_both_hide_summary_both/index.html @@ -0,0 +1,66 @@ + + + + + A Pelican Blog + + + + + +
+
+
+
+
+ + +
+ +
+
+
+ + \ No newline at end of file diff --git a/pelican-theme/test/blog_collapse_first_both_hide_summary_global/article-jumbo.html b/pelican-theme/test/blog_collapse_first_both_hide_summary_global/article-jumbo.html new file mode 100644 index 00000000..4ed06c53 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_both_hide_summary_global/article-jumbo.html @@ -0,0 +1,76 @@ + + + + + A jumbo article | A Pelican Blog + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
Dec 08, 2017
+
+
+ +
+
+
+
+
+
+
+
+ +

The content, expanded only on page.

+ +
+
+
+
+
+
+

Posted on in misc.

+
+
+
+
+ +
+ + \ No newline at end of file diff --git a/pelican-theme/test/blog_collapse_first_both_hide_summary_global/article-jumbo.rst b/pelican-theme/test/blog_collapse_first_both_hide_summary_global/article-jumbo.rst new file mode 100644 index 00000000..33b6c3d6 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_both_hide_summary_global/article-jumbo.rst @@ -0,0 +1,9 @@ +A jumbo article +############### + +:date: 2017-12-08 +:cover: image.jpg +:collapse_first: False +:summary: Jumbo article summary, shown only on listing. + +The content, expanded only on page. diff --git a/pelican-theme/test/blog_collapse_first_both_hide_summary_global/article.html b/pelican-theme/test/blog_collapse_first_both_hide_summary_global/article.html new file mode 100644 index 00000000..78959a54 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_both_hide_summary_global/article.html @@ -0,0 +1,57 @@ + + + + + An article | A Pelican Blog + + + + + + + + + + + + + + +
+
+
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/pelican-theme/test/blog_collapse_first_both_hide_summary_global/article.rst b/pelican-theme/test/blog_collapse_first_both_hide_summary_global/article.rst new file mode 100644 index 00000000..057bde95 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_both_hide_summary_global/article.rst @@ -0,0 +1,8 @@ +An article +########## + +:date: 2017-12-09 +:collapse_first: False +:summary: The summary, shown nowhere. + +The content, expanded on listing and on page. diff --git a/pelican-theme/test/blog_collapse_first_both_hide_summary_global/index.html b/pelican-theme/test/blog_collapse_first_both_hide_summary_global/index.html new file mode 100644 index 00000000..cb38ae8d --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_both_hide_summary_global/index.html @@ -0,0 +1,65 @@ + + + + + A Pelican Blog + + + + + +
+
+
+
+
+ + +
+ +
+
+
+ + \ No newline at end of file diff --git a/pelican-theme/test/blog_collapse_first_global/article.rst b/pelican-theme/test/blog_collapse_first_global/article.rst new file mode 100644 index 00000000..9e545ad3 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_global/article.rst @@ -0,0 +1,7 @@ +An article +########## + +:date: 2017-12-09 +:summary: The summary. + +The content, not expanded. diff --git a/pelican-theme/test/blog_collapse_first_global/article2.rst b/pelican-theme/test/blog_collapse_first_global/article2.rst new file mode 100644 index 00000000..1597e84d --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_global/article2.rst @@ -0,0 +1,7 @@ +An article 2 +############ + +:date: 2017-12-08 +:summary: Article 2 summary. + +The content, not expanded as this is a second article. diff --git a/pelican-theme/test/blog_collapse_first_global/index.html b/pelican-theme/test/blog_collapse_first_global/index.html new file mode 100644 index 00000000..3e799e4d --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_global/index.html @@ -0,0 +1,63 @@ + + + + + A Pelican Blog + + + + + +
+
+
+
+
+ + +
+ +
+
+
+ + \ No newline at end of file diff --git a/pelican-theme/test/blog_collapse_first_global_hide_summary_article/article-jumbo.rst b/pelican-theme/test/blog_collapse_first_global_hide_summary_article/article-jumbo.rst new file mode 100644 index 00000000..51586dcc --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_global_hide_summary_article/article-jumbo.rst @@ -0,0 +1,9 @@ +A jumbo article +############### + +:date: 2017-12-08 +:cover: image.jpg +:hide_summary: True +:summary: Jumbo article summary, shown only on listing. + +The content, expanded only on page. diff --git a/pelican-theme/test/blog_collapse_first_global_hide_summary_article/article.rst b/pelican-theme/test/blog_collapse_first_global_hide_summary_article/article.rst new file mode 100644 index 00000000..fc0ca0bd --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_global_hide_summary_article/article.rst @@ -0,0 +1,8 @@ +An article +########## + +:date: 2017-12-09 +:hide_summary: True +:summary: The summary, shown on listing. + +The content, expanded only on page. diff --git a/pelican-theme/test/blog_collapse_first_global_hide_summary_both/article-jumbo.html b/pelican-theme/test/blog_collapse_first_global_hide_summary_both/article-jumbo.html new file mode 100644 index 00000000..317a79f9 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_global_hide_summary_both/article-jumbo.html @@ -0,0 +1,83 @@ + + + + + A jumbo article | A Pelican Blog + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
Dec 08, 2017
+
+
+ +
+
+
+
+
+
+
+

Jumbo article summary, expanded only on listing.

+
+
+
+
+
+
+
+ +

The content, expanded only on page.

+ +
+
+
+
+
+
+

Posted on in misc.

+
+
+
+
+ +
+ + \ No newline at end of file diff --git a/pelican-theme/test/blog_collapse_first_global_hide_summary_both/article-jumbo.rst b/pelican-theme/test/blog_collapse_first_global_hide_summary_both/article-jumbo.rst new file mode 100644 index 00000000..930c6b54 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_global_hide_summary_both/article-jumbo.rst @@ -0,0 +1,9 @@ +A jumbo article +############### + +:date: 2017-12-08 +:cover: image.jpg +:hide_summary: False +:summary: Jumbo article summary, expanded only on listing. + +The content, expanded only on page. diff --git a/pelican-theme/test/blog_collapse_first_global_hide_summary_both/article.html b/pelican-theme/test/blog_collapse_first_global_hide_summary_both/article.html new file mode 100644 index 00000000..215efd93 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_global_hide_summary_both/article.html @@ -0,0 +1,58 @@ + + + + + An article | A Pelican Blog + + + + + + + + + + + + + + +
+
+
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/pelican-theme/test/blog_collapse_first_global_hide_summary_both/article.rst b/pelican-theme/test/blog_collapse_first_global_hide_summary_both/article.rst new file mode 100644 index 00000000..ad3b7332 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_global_hide_summary_both/article.rst @@ -0,0 +1,8 @@ +An article +########## + +:date: 2017-12-09 +:hide_summary: False +:summary: The summary, expanded only on listing. + +The content, expanded on listing and on page. diff --git a/pelican-theme/test/blog_collapse_first_global_hide_summary_both/index.html b/pelican-theme/test/blog_collapse_first_global_hide_summary_both/index.html new file mode 100644 index 00000000..f23529d1 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_global_hide_summary_both/index.html @@ -0,0 +1,63 @@ + + + + + A Pelican Blog + + + + + +
+
+
+
+
+ + +
+ +
+
+
+ + \ No newline at end of file diff --git a/pelican-theme/test/blog_collapse_first_global_hide_summary_global/article-jumbo.html b/pelican-theme/test/blog_collapse_first_global_hide_summary_global/article-jumbo.html new file mode 100644 index 00000000..bcea5bf6 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_global_hide_summary_global/article-jumbo.html @@ -0,0 +1,76 @@ + + + + + A jumbo article | A Pelican Blog + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
Dec 08, 2017
+
+
+ +
+
+
+
+
+
+
+
+ +

The content, expanded only on page.

+ +
+
+
+
+
+
+

Posted on in misc.

+
+
+
+
+ +
+ + diff --git a/pelican-theme/test/blog_collapse_first_global_hide_summary_global/article-jumbo.rst b/pelican-theme/test/blog_collapse_first_global_hide_summary_global/article-jumbo.rst new file mode 100644 index 00000000..f66d042b --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_global_hide_summary_global/article-jumbo.rst @@ -0,0 +1,8 @@ +A jumbo article +############### + +:date: 2017-12-08 +:cover: image.jpg +:summary: Jumbo article summary, shown only on listing. + +The content, expanded only on page. diff --git a/pelican-theme/test/blog_collapse_first_global_hide_summary_global/article.html b/pelican-theme/test/blog_collapse_first_global_hide_summary_global/article.html new file mode 100644 index 00000000..e9b2e7e7 --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_global_hide_summary_global/article.html @@ -0,0 +1,57 @@ + + + + + An article | A Pelican Blog + + + + + + + + + + + + + + +
+
+
+
+ + +
+
+
+ + diff --git a/pelican-theme/test/blog_collapse_first_global_hide_summary_global/article.rst b/pelican-theme/test/blog_collapse_first_global_hide_summary_global/article.rst new file mode 100644 index 00000000..6d2bce1b --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_global_hide_summary_global/article.rst @@ -0,0 +1,7 @@ +An article +########## + +:date: 2017-12-09 +:summary: The summary, shown on listing. + +The content, expanded only on page. diff --git a/pelican-theme/test/blog_collapse_first_global_hide_summary_global/index.html b/pelican-theme/test/blog_collapse_first_global_hide_summary_global/index.html new file mode 100644 index 00000000..a1433a7e --- /dev/null +++ b/pelican-theme/test/blog_collapse_first_global_hide_summary_global/index.html @@ -0,0 +1,63 @@ + + + + + A Pelican Blog + + + + + +
+
+
+
+
+ + +
+ +
+
+
+ + diff --git a/pelican-theme/test/blog_footer_links/article.rst b/pelican-theme/test/blog_footer_links/article.rst new file mode 100644 index 00000000..b1173ed9 --- /dev/null +++ b/pelican-theme/test/blog_footer_links/article.rst @@ -0,0 +1,5 @@ +An article +########## + +:date: 2017-12-09 +:category: A category diff --git a/pelican-theme/test/blog_footer_links/article2.rst b/pelican-theme/test/blog_footer_links/article2.rst new file mode 100644 index 00000000..eac21772 --- /dev/null +++ b/pelican-theme/test/blog_footer_links/article2.rst @@ -0,0 +1,5 @@ +An article 2 +############ + +:date: 2017-12-09 +:category: Another category diff --git a/pelican-theme/test/blog_footer_links/index.html b/pelican-theme/test/blog_footer_links/index.html new file mode 100644 index 00000000..aa2400e0 --- /dev/null +++ b/pelican-theme/test/blog_footer_links/index.html @@ -0,0 +1,85 @@ + + + + + A Pelican Blog + + + + + +
+
+
+
+
+ + +
+ +
+
+
+ + + diff --git a/pelican-theme/test/blog_hide_summary_article/article-jumbo.rst b/pelican-theme/test/blog_hide_summary_article/article-jumbo.rst new file mode 100644 index 00000000..ed8e65b3 --- /dev/null +++ b/pelican-theme/test/blog_hide_summary_article/article-jumbo.rst @@ -0,0 +1,9 @@ +A jumbo article +############### + +:date: 2017-12-08 +:cover: image.jpg +:hide_summary: True +:summary: The summary, shown in listing but not on the page. + +The content, expanded fully only on the page. diff --git a/pelican-theme/test/blog_hide_summary_article/article.rst b/pelican-theme/test/blog_hide_summary_article/article.rst new file mode 100644 index 00000000..be3ab525 --- /dev/null +++ b/pelican-theme/test/blog_hide_summary_article/article.rst @@ -0,0 +1,8 @@ +An article +########## + +:date: 2017-12-09 +:hide_summary: True +:summary: The summary, shown neither in listing nor on the page. + +The content, expanded fully both in listing and on the page. diff --git a/pelican-theme/test/blog_hide_summary_both/article-jumbo.html b/pelican-theme/test/blog_hide_summary_both/article-jumbo.html new file mode 100644 index 00000000..9ab7c70d --- /dev/null +++ b/pelican-theme/test/blog_hide_summary_both/article-jumbo.html @@ -0,0 +1,83 @@ + + + + + A jumbo article | A Pelican Blog + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
Dec 08, 2017
+
+
+ +
+
+
+
+
+
+
+

The summary, shown in both listing and on the page.

+
+
+
+
+
+
+
+ +

The content, expanded fully only on the page.

+ +
+
+
+
+
+
+

Posted on in misc.

+
+
+
+
+ +
+ + \ No newline at end of file diff --git a/pelican-theme/test/blog_hide_summary_both/article-jumbo.rst b/pelican-theme/test/blog_hide_summary_both/article-jumbo.rst new file mode 100644 index 00000000..099cde9c --- /dev/null +++ b/pelican-theme/test/blog_hide_summary_both/article-jumbo.rst @@ -0,0 +1,9 @@ +A jumbo article +############### + +:date: 2017-12-08 +:cover: image.jpg +:hide_summary: False +:summary: The summary, shown in both listing and on the page. + +The content, expanded fully only on the page. diff --git a/pelican-theme/test/blog_hide_summary_both/article.html b/pelican-theme/test/blog_hide_summary_both/article.html new file mode 100644 index 00000000..40a871b9 --- /dev/null +++ b/pelican-theme/test/blog_hide_summary_both/article.html @@ -0,0 +1,58 @@ + + + + + An article | A Pelican Blog + + + + + + + + + + + + + + +
+
+
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/pelican-theme/test/blog_hide_summary_both/article.rst b/pelican-theme/test/blog_hide_summary_both/article.rst new file mode 100644 index 00000000..daa4f855 --- /dev/null +++ b/pelican-theme/test/blog_hide_summary_both/article.rst @@ -0,0 +1,8 @@ +An article +########## + +:date: 2017-12-09 +:hide_summary: False +:summary: The summary, repeated on the page. + +The content, expanded fully both in the listing and on the page. diff --git a/pelican-theme/test/blog_hide_summary_both/category-misc.html b/pelican-theme/test/blog_hide_summary_both/category-misc.html new file mode 100644 index 00000000..3c97633a --- /dev/null +++ b/pelican-theme/test/blog_hide_summary_both/category-misc.html @@ -0,0 +1,66 @@ + + + + + misc | A Pelican Blog + + + + + +
+
+
+
+
+
+ Showing only posts in misc. Show all posts. +
+ + +
+ +
+
+
+ + \ No newline at end of file diff --git a/pelican-theme/test/blog_hide_summary_both/index.html b/pelican-theme/test/blog_hide_summary_both/index.html new file mode 100644 index 00000000..cafbffdc --- /dev/null +++ b/pelican-theme/test/blog_hide_summary_both/index.html @@ -0,0 +1,66 @@ + + + + + A Pelican Blog + + + + + +
+
+
+
+
+ + +
+ +
+
+
+ + \ No newline at end of file diff --git a/pelican-theme/test/blog_hide_summary_global/article-jumbo.html b/pelican-theme/test/blog_hide_summary_global/article-jumbo.html new file mode 100644 index 00000000..094f8804 --- /dev/null +++ b/pelican-theme/test/blog_hide_summary_global/article-jumbo.html @@ -0,0 +1,76 @@ + + + + + A jumbo article | A Pelican Blog + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
Dec 08, 2017
+
+
+ +
+
+
+
+
+
+
+
+ +

The content, expanded fully only on the page.

+ +
+
+
+
+
+
+

Posted on in misc.

+
+
+
+
+ +
+ + diff --git a/pelican-theme/test/blog_hide_summary_global/article-jumbo.rst b/pelican-theme/test/blog_hide_summary_global/article-jumbo.rst new file mode 100644 index 00000000..04e4b51c --- /dev/null +++ b/pelican-theme/test/blog_hide_summary_global/article-jumbo.rst @@ -0,0 +1,8 @@ +A jumbo article +############### + +:date: 2017-12-08 +:cover: image.jpg +:summary: The summary, shown in listing but not on the page. + +The content, expanded fully only on the page. diff --git a/pelican-theme/test/blog_hide_summary_global/article.html b/pelican-theme/test/blog_hide_summary_global/article.html new file mode 100644 index 00000000..3f20aba7 --- /dev/null +++ b/pelican-theme/test/blog_hide_summary_global/article.html @@ -0,0 +1,57 @@ + + + + + An article | A Pelican Blog + + + + + + + + + + + + + + +
+
+
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/pelican-theme/test/blog_hide_summary_global/article.rst b/pelican-theme/test/blog_hide_summary_global/article.rst new file mode 100644 index 00000000..be3ab525 --- /dev/null +++ b/pelican-theme/test/blog_hide_summary_global/article.rst @@ -0,0 +1,8 @@ +An article +########## + +:date: 2017-12-09 +:hide_summary: True +:summary: The summary, shown neither in listing nor on the page. + +The content, expanded fully both in listing and on the page. diff --git a/pelican-theme/test/blog_hide_summary_global/category-misc.html b/pelican-theme/test/blog_hide_summary_global/category-misc.html new file mode 100644 index 00000000..89c35725 --- /dev/null +++ b/pelican-theme/test/blog_hide_summary_global/category-misc.html @@ -0,0 +1,66 @@ + + + + + misc | A Pelican Blog + + + + + +
+
+
+
+
+
+ Showing only posts in misc. Show all posts. +
+ + +
+ +
+
+
+ + \ No newline at end of file diff --git a/pelican-theme/test/blog_hide_summary_global/index.html b/pelican-theme/test/blog_hide_summary_global/index.html new file mode 100644 index 00000000..abdd81d6 --- /dev/null +++ b/pelican-theme/test/blog_hide_summary_global/index.html @@ -0,0 +1,65 @@ + + + + + A Pelican Blog + + + + + +
+
+
+
+
+ + +
+ +
+
+
+ + \ No newline at end of file diff --git a/pelican-theme/test/blog_jumbo_inverted/article-jumbo.html b/pelican-theme/test/blog_jumbo_inverted/article-jumbo.html new file mode 100644 index 00000000..ab42d552 --- /dev/null +++ b/pelican-theme/test/blog_jumbo_inverted/article-jumbo.html @@ -0,0 +1,65 @@ + + + + + A jumbo article | A Pelican Blog + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
Dec 09, 2017
+
+
+ +
+
+
+
+
+
+
+
+

Posted on in misc.

+
+
+
+
+ +
+ + \ No newline at end of file diff --git a/pelican-theme/test/blog_jumbo_inverted/article-jumbo.rst b/pelican-theme/test/blog_jumbo_inverted/article-jumbo.rst new file mode 100644 index 00000000..14687eb9 --- /dev/null +++ b/pelican-theme/test/blog_jumbo_inverted/article-jumbo.rst @@ -0,0 +1,6 @@ +A jumbo article +############### + +:date: 2017-12-09 +:cover: image.jpg +:class: m-inverted diff --git a/pelican-theme/test/blog_minimal/article-jumbo.html b/pelican-theme/test/blog_minimal/article-jumbo.html new file mode 100644 index 00000000..4f78f88a --- /dev/null +++ b/pelican-theme/test/blog_minimal/article-jumbo.html @@ -0,0 +1,65 @@ + + + + + A jumbo article | A Pelican Blog + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
Dec 09, 2017
+
+
+ +
+
+
+
+
+
+
+
+

Posted on in misc.

+
+
+
+
+ +
+ + diff --git a/pelican-theme/test/blog_minimal/article-jumbo.rst b/pelican-theme/test/blog_minimal/article-jumbo.rst new file mode 100644 index 00000000..b254d981 --- /dev/null +++ b/pelican-theme/test/blog_minimal/article-jumbo.rst @@ -0,0 +1,5 @@ +A jumbo article +############### + +:date: 2017-12-09 +:cover: image.jpg diff --git a/pelican-theme/test/blog_minimal/article.html b/pelican-theme/test/blog_minimal/article.html new file mode 100644 index 00000000..e467254f --- /dev/null +++ b/pelican-theme/test/blog_minimal/article.html @@ -0,0 +1,52 @@ + + + + + An article | A Pelican Blog + + + + + + + + + + + + +
+
+
+
+ + +
+
+
+ + diff --git a/pelican-theme/test/blog_minimal/article.rst b/pelican-theme/test/blog_minimal/article.rst new file mode 100644 index 00000000..ea8d0b95 --- /dev/null +++ b/pelican-theme/test/blog_minimal/article.rst @@ -0,0 +1,4 @@ +An article +########## + +:date: 2017-12-09 diff --git a/pelican-theme/test/blog_minimal/category-misc.html b/pelican-theme/test/blog_minimal/category-misc.html new file mode 100644 index 00000000..d1c58f10 --- /dev/null +++ b/pelican-theme/test/blog_minimal/category-misc.html @@ -0,0 +1,64 @@ + + + + + misc | A Pelican Blog + + + + + +
+
+
+
+
+
+ Showing only posts in misc. Show all posts. +
+ + +
+ +
+
+
+ + diff --git a/pelican-theme/test/blog_minimal/index.html b/pelican-theme/test/blog_minimal/index.html new file mode 100644 index 00000000..f3d42c24 --- /dev/null +++ b/pelican-theme/test/blog_minimal/index.html @@ -0,0 +1,61 @@ + + + + + A Pelican Blog + + + + + +
+
+
+
+
+ + +
+ +
+
+
+ + diff --git a/pelican-theme/test/blog_modified_date/article.rst b/pelican-theme/test/blog_modified_date/article.rst new file mode 100644 index 00000000..5b176b1b --- /dev/null +++ b/pelican-theme/test/blog_modified_date/article.rst @@ -0,0 +1,5 @@ +An article +########## + +:date: 2017-12-08 +:modified: 2017-12-10 diff --git a/pelican-theme/test/blog_modified_date/article2.rst b/pelican-theme/test/blog_modified_date/article2.rst new file mode 100644 index 00000000..0cbfcd86 --- /dev/null +++ b/pelican-theme/test/blog_modified_date/article2.rst @@ -0,0 +1,4 @@ +An article 2 +############ + +:date: 2017-12-09 diff --git a/pelican-theme/test/blog_modified_date/index.html b/pelican-theme/test/blog_modified_date/index.html new file mode 100644 index 00000000..6382c7c1 --- /dev/null +++ b/pelican-theme/test/blog_modified_date/index.html @@ -0,0 +1,61 @@ + + + + + A Pelican Blog + + + + + +
+
+
+
+
+ + +
+ +
+
+
+ + diff --git a/pelican-theme/test/blog_pagination/article1.rst b/pelican-theme/test/blog_pagination/article1.rst new file mode 100644 index 00000000..7305b3a3 --- /dev/null +++ b/pelican-theme/test/blog_pagination/article1.rst @@ -0,0 +1,7 @@ +An article +########## + +:date: 2017-12-07 +:summary: A summary. + +The content. It's not shown. diff --git a/pelican-theme/test/blog_pagination/article2.rst b/pelican-theme/test/blog_pagination/article2.rst new file mode 100644 index 00000000..3f8a2053 --- /dev/null +++ b/pelican-theme/test/blog_pagination/article2.rst @@ -0,0 +1,7 @@ +Another article +############### + +:date: 2017-12-08 +:summary: Another summary. + +The content. It's also not shown. diff --git a/pelican-theme/test/blog_pagination/article3.rst b/pelican-theme/test/blog_pagination/article3.rst new file mode 100644 index 00000000..96561c2e --- /dev/null +++ b/pelican-theme/test/blog_pagination/article3.rst @@ -0,0 +1,7 @@ +Third article +############# + +:date: 2017-12-09 +:summary: Third summary. + +The content. It's shown because it's first on the first page. diff --git a/pelican-theme/test/blog_pagination/category-misc.html b/pelican-theme/test/blog_pagination/category-misc.html new file mode 100644 index 00000000..97b07816 --- /dev/null +++ b/pelican-theme/test/blog_pagination/category-misc.html @@ -0,0 +1,53 @@ + + + + + misc | A Pelican Blog + + + + + + +
+
+
+
+
+
+ Showing only posts in misc. Show all posts. +
+ +
page 1 | older articles »
+
+ +
+
+
+ + diff --git a/pelican-theme/test/blog_pagination/category-misc2.html b/pelican-theme/test/blog_pagination/category-misc2.html new file mode 100644 index 00000000..439bf168 --- /dev/null +++ b/pelican-theme/test/blog_pagination/category-misc2.html @@ -0,0 +1,54 @@ + + + + + misc | A Pelican Blog + + + + + + + +
+
+
+
+
+
+ Showing only posts in misc. Show all posts. +
+ +
« newer articles | page 2 | older articles »
+
+ +
+
+
+ + diff --git a/pelican-theme/test/blog_pagination/category-misc3.html b/pelican-theme/test/blog_pagination/category-misc3.html new file mode 100644 index 00000000..20a9d27c --- /dev/null +++ b/pelican-theme/test/blog_pagination/category-misc3.html @@ -0,0 +1,53 @@ + + + + + misc | A Pelican Blog + + + + + + +
+
+
+
+
+
+ Showing only posts in misc. Show all posts. +
+ +
« newer articles | page 3
+
+ +
+
+
+ + diff --git a/pelican-theme/test/blog_pagination/index.html b/pelican-theme/test/blog_pagination/index.html new file mode 100644 index 00000000..6a8e54d1 --- /dev/null +++ b/pelican-theme/test/blog_pagination/index.html @@ -0,0 +1,53 @@ + + + + + A Pelican Blog + + + + + + +
+
+
+
+
+ +
page 1 | older articles »
+
+ +
+
+
+ + diff --git a/pelican-theme/test/blog_pagination/index2.html b/pelican-theme/test/blog_pagination/index2.html new file mode 100644 index 00000000..1b45d247 --- /dev/null +++ b/pelican-theme/test/blog_pagination/index2.html @@ -0,0 +1,51 @@ + + + + + A Pelican Blog + + + + + + + +
+
+
+
+
+ +
« newer articles | page 2 | older articles »
+
+ +
+
+
+ + diff --git a/pelican-theme/test/blog_pagination/index3.html b/pelican-theme/test/blog_pagination/index3.html new file mode 100644 index 00000000..aa1df55d --- /dev/null +++ b/pelican-theme/test/blog_pagination/index3.html @@ -0,0 +1,50 @@ + + + + + A Pelican Blog + + + + + + +
+
+
+
+
+ +
« newer articles | page 3
+
+ +
+
+
+ + diff --git a/pelican-theme/test/blog_pagination_disabled/article1.rst b/pelican-theme/test/blog_pagination_disabled/article1.rst new file mode 120000 index 00000000..b55c0b7e --- /dev/null +++ b/pelican-theme/test/blog_pagination_disabled/article1.rst @@ -0,0 +1 @@ +../blog_pagination/article1.rst \ No newline at end of file diff --git a/pelican-theme/test/blog_pagination_disabled/article2.rst b/pelican-theme/test/blog_pagination_disabled/article2.rst new file mode 120000 index 00000000..0afef4f8 --- /dev/null +++ b/pelican-theme/test/blog_pagination_disabled/article2.rst @@ -0,0 +1 @@ +../blog_pagination/article2.rst \ No newline at end of file diff --git a/pelican-theme/test/blog_pagination_disabled/article3.rst b/pelican-theme/test/blog_pagination_disabled/article3.rst new file mode 120000 index 00000000..221642b3 --- /dev/null +++ b/pelican-theme/test/blog_pagination_disabled/article3.rst @@ -0,0 +1 @@ +../blog_pagination/article3.rst \ No newline at end of file diff --git a/pelican-theme/test/blog_pagination_disabled/index.html b/pelican-theme/test/blog_pagination_disabled/index.html new file mode 100644 index 00000000..e1cbcf1e --- /dev/null +++ b/pelican-theme/test/blog_pagination_disabled/index.html @@ -0,0 +1,81 @@ + + + + + A Pelican Blog + + + + + +
+
+
+
+
+ + + +
+ +
+
+
+ + \ No newline at end of file diff --git a/pelican-theme/test/test_blog.py b/pelican-theme/test/test_blog.py new file mode 100644 index 00000000..e530b40b --- /dev/null +++ b/pelican-theme/test/test_blog.py @@ -0,0 +1,398 @@ +from test import BlogTestCase + +class Blog(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, '', *args, **kwargs) + + def test(self): + self.run_pelican({ + 'AUTHOR': "Implicit Author", + 'STATIC_PATHS': ['ship.jpg'], + 'M_BLOG_URL': 'archives.html', + 'FORMATTED_FIELDS': ['summary', 'description'] + }) + + # The archives and index page should be exactly the same + self.assertEqual(*self.actual_expected_contents('index.html')) + self.assertEqual(*self.actual_expected_contents('archives.html', 'index.html')) + + # Default and jumbo article rendering + self.assertEqual(*self.actual_expected_contents('article.html')) + self.assertEqual(*self.actual_expected_contents('article-jumbo.html')) + + # Author, category, tag pages (selecting just one of each) + self.assertEqual(*self.actual_expected_contents('author-explicit-author.html')) + self.assertEqual(*self.actual_expected_contents('category-another-category.html')) + self.assertEqual(*self.actual_expected_contents('tag-third.html')) + +class Minimal(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'minimal', *args, **kwargs) + + def test(self): + self.run_pelican({}) + + # The summary, content blocks should not be there at all, no mention of + # authors. Index and archive page should be exactly the same. Header + # metadata should be empty as well. Verify also the category page as it + # is a base for author/tag listing as well. + self.assertEqual(*self.actual_expected_contents('index.html')) + self.assertEqual(*self.actual_expected_contents('archives.html', 'index.html')) + self.assertEqual(*self.actual_expected_contents('category-misc.html')) + self.assertEqual(*self.actual_expected_contents('article.html')) + self.assertEqual(*self.actual_expected_contents('article-jumbo.html')) + +class JumboInverted(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'jumbo_inverted', *args, **kwargs) + + def test(self): + self.run_pelican({}) + + # The
should have a m-inverted class + self.assertEqual(*self.actual_expected_contents('article-jumbo.html')) + +class AuthorList(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'author_list', *args, **kwargs) + + def test(self): + self.run_pelican({ + 'AUTHOR': "An Author", + 'M_SHOW_AUTHOR_LIST': True + }) + + # Verify both right sidebar and bottom columns on jumbo articles. It's + # without tags, which is the third option to be considered there. + self.assertEqual(*self.actual_expected_contents('index.html')) + self.assertEqual(*self.actual_expected_contents('article-jumbo.html')) + +class FooterLinks(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'footer_links', *args, **kwargs) + + def test(self): + self.run_pelican({'M_LINKS_FOOTER2': [('Title', '#')]}) + + # There should be second and fourth column + self.assertEqual(*self.actual_expected_contents('index.html')) + +class ModifiedDate(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'modified_date', *args, **kwargs) + + def test(self): + self.run_pelican({}) + + # Article footer should show the modified date, but it doesn't affect + # ordering + self.assertEqual(*self.actual_expected_contents('index.html')) + +class Pagination(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'pagination', *args, **kwargs) + + def test(self): + self.run_pelican({ + 'DEFAULT_PAGINATION': 1, + 'PAGINATION_PATTERNS': + [(1, 'index.html', '{name}.html'), + (2, 'index{number}.html', '{name}{number}.html')], + 'DIRECT_TEMPLATES': ['index', 'archives'], + 'PAGINATED_DIRECT_TEMPLATES': ['index', 'archives'] + }) + + # Every page should contain just one article, only the first page + # should have it expanded + self.assertEqual(*self.actual_expected_contents('index.html')) + self.assertEqual(*self.actual_expected_contents('index2.html')) + self.assertEqual(*self.actual_expected_contents('index3.html')) + + # Archives are fully equivalent to index (even the links due to patched + # pagination patterns) + self.assertEqual(*self.actual_expected_contents('archives.html', 'index.html')) + self.assertEqual(*self.actual_expected_contents('archives2.html', 'index2.html')) + self.assertEqual(*self.actual_expected_contents('archives3.html', 'index3.html')) + + def test_categories(self): + self.run_pelican({ + 'DEFAULT_PAGINATION': 1, + 'DIRECT_TEMPLATES': [] + }) + + # Test the category pages as well (same as author/tag). Couldn't test + # that in the above test case because of the overriden pagination + # patterns. + self.assertEqual(*self.actual_expected_contents('category-misc.html')) + self.assertEqual(*self.actual_expected_contents('category-misc2.html')) + self.assertEqual(*self.actual_expected_contents('category-misc3.html')) + +class PaginationDisabled(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'pagination_disabled', *args, **kwargs) + + def test(self): + self.run_pelican({ + 'DEFAULT_PAGINATION': 1, + 'PAGINATED_DIRECT_TEMPLATES': [] + }) + + # Nothing is paginated + self.assertEqual(*self.actual_expected_contents('index.html')) + self.assertEqual(*self.actual_expected_contents('archives.html', 'index.html')) + +class CollapseFirstGlobal(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'collapse_first_global', *args, **kwargs) + + def test(self): + self.run_pelican({ + 'M_COLLAPSE_FIRST_ARTICLE': True + }) + + # First article should be collapsed. Index the same as archives. + self.assertEqual(*self.actual_expected_contents('index.html')) + self.assertEqual(*self.actual_expected_contents('archives.html', 'index.html')) + +class CollapseFirstArticle(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'collapse_first_article', *args, **kwargs) + + def test(self): + self.run_pelican({}) + + # First article should be collapsed. Index the same as archives. + self.assertEqual(*self.actual_expected_contents('index.html', '../blog_collapse_first_global/index.html')) + self.assertEqual(*self.actual_expected_contents('archives.html', '../blog_collapse_first_global/index.html')) + +class CollapseFirstBoth(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'collapse_first_both', *args, **kwargs) + + def test(self): + self.run_pelican({ + 'M_COLLAPSE_FIRST_ARTICLE': True + }) + + # Globally enabled, re-enabled in article, so it should be expanded. + # Index the same as archives. + self.assertEqual(*self.actual_expected_contents('index.html')) + self.assertEqual(*self.actual_expected_contents('archives.html', 'index.html')) + +class HideSummaryGlobal(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'hide_summary_global', *args, **kwargs) + + def test(self): + self.run_pelican({ + 'M_HIDE_ARTICLE_SUMMARY': True + }) + + # First (expanded) article summary should be hidden. Index the same as + # archives. + self.assertEqual(*self.actual_expected_contents('index.html')) + self.assertEqual(*self.actual_expected_contents('archives.html', 'index.html')) + + # Both classic and jumbo article should have summary hidden + self.assertEqual(*self.actual_expected_contents('article.html')) + self.assertEqual(*self.actual_expected_contents('article-jumbo.html')) + + # Category (and other listing) has always just the summary + self.assertEqual(*self.actual_expected_contents('category-misc.html')) + +class HideSummaryArticle(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'hide_summary_article', *args, **kwargs) + + def test(self): + self.run_pelican({}) + + # First article summary should be shown + self.assertEqual(*self.actual_expected_contents('index.html', '../blog_hide_summary_global/index.html')) + self.assertEqual(*self.actual_expected_contents('archives.html', '../blog_hide_summary_global/index.html')) + + # Both classic and jumbo article should have summary hidden + self.assertEqual(*self.actual_expected_contents('article.html', '../blog_hide_summary_global/article.html')) + self.assertEqual(*self.actual_expected_contents('article-jumbo.html', '../blog_hide_summary_global/article-jumbo.html')) + +class HideSummaryBoth(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'hide_summary_both', *args, **kwargs) + + def test(self): + self.run_pelican({ + 'M_HIDE_ARTICLE_SUMMARY': True + }) + + # Globally enabled, re-enabled in article, so it should be shown. Index + # the same as archives. + self.assertEqual(*self.actual_expected_contents('index.html')) + self.assertEqual(*self.actual_expected_contents('index.html')) + + # Both classic and jumbo article should have summary shown + self.assertEqual(*self.actual_expected_contents('article.html')) + self.assertEqual(*self.actual_expected_contents('article-jumbo.html')) + +class CollapseFirstGlobalHideSummaryGlobal(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'collapse_first_global_hide_summary_global', *args, **kwargs) + + def test(self): + self.run_pelican({ + 'M_COLLAPSE_FIRST_ARTICLE': True, + 'M_HIDE_ARTICLE_SUMMARY': True + }) + + # First article is not expanded, with visible summary. Index the same + # as archives. + self.assertEqual(*self.actual_expected_contents('index.html')) + self.assertEqual(*self.actual_expected_contents('archives.html', 'index.html')) + + # Both classic and jumbo article should have summary hidden + self.assertEqual(*self.actual_expected_contents('article.html')) + self.assertEqual(*self.actual_expected_contents('article-jumbo.html')) + +class CollapseFirstGlobalHideSummaryArticle(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'collapse_first_global_hide_summary_article', *args, **kwargs) + + def test(self): + self.run_pelican({ + 'M_COLLAPSE_FIRST_ARTICLE': True + }) + + # First article is not expanded, with visible summary. Index the same + # as archives. + self.assertEqual(*self.actual_expected_contents('index.html', '../blog_collapse_first_global_hide_summary_global/index.html')) + self.assertEqual(*self.actual_expected_contents('archives.html', '../blog_collapse_first_global_hide_summary_global/index.html')) + + # Both classic and jumbo article should have summary hidden + self.assertEqual(*self.actual_expected_contents('article.html', '../blog_collapse_first_global_hide_summary_global/article.html')) + self.assertEqual(*self.actual_expected_contents('article-jumbo.html', '../blog_collapse_first_global_hide_summary_global/article-jumbo.html')) + +class CollapseFirstGlobalHideSummaryBoth(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'collapse_first_global_hide_summary_both', *args, **kwargs) + + def test(self): + self.run_pelican({ + 'M_COLLAPSE_FIRST_ARTICLE': True, + 'M_HIDE_ARTICLE_SUMMARY': True + }) + + # First article is not expanded, with visible summary. Index the same + # as archives. + self.assertEqual(*self.actual_expected_contents('index.html')) + self.assertEqual(*self.actual_expected_contents('archives.html', 'index.html')) + + # Both classic and jumbo article should have summary shown + self.assertEqual(*self.actual_expected_contents('article.html')) + self.assertEqual(*self.actual_expected_contents('article-jumbo.html')) + +class CollapseFirstArticleHideSummaryGlobal(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'collapse_first_article_hide_summary_global', *args, **kwargs) + + def test(self): + self.run_pelican({ + 'M_HIDE_ARTICLE_SUMMARY': True, + }) + + # First article is not expanded, with visible summary. Index the same + # as archives. + self.assertEqual(*self.actual_expected_contents('index.html', '../blog_collapse_first_global_hide_summary_global/index.html')) + self.assertEqual(*self.actual_expected_contents('archives.html', '../blog_collapse_first_global_hide_summary_global/index.html')) + + # Both classic and jumbo article should have summary hidden + self.assertEqual(*self.actual_expected_contents('article.html', '../blog_collapse_first_global_hide_summary_global/article.html')) + self.assertEqual(*self.actual_expected_contents('article-jumbo.html', '../blog_collapse_first_global_hide_summary_global/article-jumbo.html')) + +class CollapseFirstArticleHideSummaryArticle(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'collapse_first_article_hide_summary_article', *args, **kwargs) + + def test(self): + self.run_pelican({}) + + # First article is not expanded, with visible summary. Index the same + # as archives. + self.assertEqual(*self.actual_expected_contents('index.html', '../blog_collapse_first_global_hide_summary_global/index.html')) + self.assertEqual(*self.actual_expected_contents('archives.html', '../blog_collapse_first_global_hide_summary_global/index.html')) + + # Both classic and jumbo article should have summary hidden + self.assertEqual(*self.actual_expected_contents('article.html', '../blog_collapse_first_global_hide_summary_global/article.html')) + self.assertEqual(*self.actual_expected_contents('article-jumbo.html', '../blog_collapse_first_global_hide_summary_global/article-jumbo.html')) + +class CollapseFirstArticleHideSummaryBoth(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'collapse_first_article_hide_summary_both', *args, **kwargs) + + def test(self): + self.run_pelican({ + 'M_HIDE_ARTICLE_SUMMARY': True + }) + + # First article is not expanded, with visible summary. Index the same + # as archives. + self.assertEqual(*self.actual_expected_contents('index.html', '../blog_collapse_first_global_hide_summary_both/index.html')) + self.assertEqual(*self.actual_expected_contents('archives.html', '../blog_collapse_first_global_hide_summary_both/index.html')) + + # Both classic and jumbo article should have summary shown + self.assertEqual(*self.actual_expected_contents('article.html', '../blog_collapse_first_global_hide_summary_both/article.html')) + self.assertEqual(*self.actual_expected_contents('article-jumbo.html', '../blog_collapse_first_global_hide_summary_both/article-jumbo.html')) + +class CollapseFirstBothHideSummaryGlobal(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'collapse_first_both_hide_summary_global', *args, **kwargs) + + def test(self): + self.run_pelican({ + 'M_COLLAPSE_FIRST_ARTICLE': True, + 'M_HIDE_ARTICLE_SUMMARY': True + }) + + # First (expanded) article summary should be shown. Index the same as + # archives. + self.assertEqual(*self.actual_expected_contents('index.html')) + self.assertEqual(*self.actual_expected_contents('archives.html', 'index.html')) + + # Both classic and jumbo article should have summary hidden + self.assertEqual(*self.actual_expected_contents('article.html')) + self.assertEqual(*self.actual_expected_contents('article-jumbo.html')) + +class CollapseFirstBothHideSummaryArticle(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'collapse_first_both_hide_summary_article', *args, **kwargs) + + def test(self): + self.run_pelican({ + 'M_COLLAPSE_FIRST_ARTICLE': True + }) + + # First (expanded) article summary should be shown. Index the same as + # archives. + self.assertEqual(*self.actual_expected_contents('index.html', '../blog_collapse_first_both_hide_summary_global/index.html')) + self.assertEqual(*self.actual_expected_contents('archives.html', '../blog_collapse_first_both_hide_summary_global/index.html')) + + # Both classic and jumbo article should have summary hidden + self.assertEqual(*self.actual_expected_contents('article.html', '../blog_collapse_first_both_hide_summary_global/article.html')) + self.assertEqual(*self.actual_expected_contents('article-jumbo.html', '../blog_collapse_first_both_hide_summary_global/article-jumbo.html')) + +class CollapseFirstBothHideSummaryBoth(BlogTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'collapse_first_both_hide_summary_both', *args, **kwargs) + + def test(self): + self.run_pelican({ + 'M_COLLAPSE_FIRST_ARTICLE': True, + 'M_HIDE_ARTICLE_SUMMARY': True + }) + + # First (expanded) article summary should be shown. Index the same as + # archives. + self.assertEqual(*self.actual_expected_contents('index.html')) + self.assertEqual(*self.actual_expected_contents('archives.html', 'index.html')) + + # Both classic and jumbo article should have summary shown + self.assertEqual(*self.actual_expected_contents('article.html')) + self.assertEqual(*self.actual_expected_contents('article-jumbo.html'))