'PAGE_URL': '{slug}.html',
'PAGE_EXCLUDES': ['output'],
'ARTICLE_PATHS': ['articles'], # does not exist
- 'FEED_ALL_ATOM': None, # Don't render feeds, we're not testing them *ever*
+ # Don't render feeds, we don't want to test them all the time
+ 'FEED_ALL_ATOM': None,
+ 'CATEGORY_FEED_ATOM': None,
'THEME': '../pelican-theme',
'PLUGIN_PATHS': ['.'],
'THEME_STATIC_DIR': 'static',
{% endblock head_links %}
{% if FEED_ALL_ATOM_URL %}
<link href="{{ FEED_ALL_ATOM_URL|format_siteurl|e }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|e }}" />
+ {% elif FEED_ALL_ATOM %}
+ <link href="{{ FEED_ALL_ATOM|format_siteurl|e }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|e }}" />
{% endif %}
- {% if CATEGORY_FEED_ATOM_URL and category %}
+ {% if category %}
+ {% if CATEGORY_FEED_ATOM_URL %}
<link href="{{ CATEGORY_FEED_ATOM_URL|format(category.slug)|format_siteurl }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|e }} | {{ category|e }}" />
+ {% elif CATEGORY_FEED_ATOM %}
+ <link href="{{ CATEGORY_FEED_ATOM|format(category.slug)|format_siteurl }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|e }} | {{ category|e }}" />
+ {% endif %}
{% endif %}
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
{% if M_THEME_COLOR %}
'OUTPUT_PATH': os.path.join(self.path, 'output'),
'PAGE_EXCLUDES': [os.path.join(self.path, 'output')],
'ARTICLE_EXCLUDES': [os.path.join(self.path, 'output')],
- 'FEED_ALL_ATOM': None, # Don't render feeds, we're not testing them *ever*
+ # Don't render feeds, we don't want to test them all the time
+ 'FEED_ALL_ATOM': None,
+ 'CATEGORY_FEED_ATOM': None
}
implicit_settings.update(settings)
settings = read_settings(path=None, override=implicit_settings)
--- /dev/null
+An article
+##########
+
+:date: 2018-09-13
+:category: A Category
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>A Category | A Pelican Blog</title>
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
+ <link rel="stylesheet" href="static/m-dark.css" />
+ <link href="feeds/atom.xml" type="application/atom+xml" rel="alternate" title="A Pelican Blog" />
+ <link href="feeds/a-category.atom.xml" type="application/atom+xml" rel="alternate" title="A Pelican Blog | A Category" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+ <div class="m-container">
+ <div class="m-row">
+ <a href="./" id="m-navbar-brand" class="m-col-t-9 m-col-m-none m-left-m">A Pelican Blog</a>
+ </div>
+ </div>
+</nav></header>
+<main>
+<div class="m-container">
+ <div class="m-row">
+ <div class="m-col-m-10">
+ <div class="m-info m-note">
+ Showing only posts in <em>A Category</em>. <a href="./">Show all posts.</a>
+ </div>
+ <article>
+ <header>
+ <h1><a href="article.html" rel="bookmark" title="Permalink to An article">
+ <time class="m-date" datetime="2018-09-13T00:00:00+00:00">
+ Sep <span class="m-date-day">13</span> 2018
+ </time>
+ An article
+ </a></h1>
+ </header>
+ <footer>
+ <p>Posted on <time datetime="2018-09-13T00:00:00+00:00">Sep 13, 2018</time> in <a href="category-a-category.html">A Category</a>.</p>
+ </footer>
+ <div class="m-clearfix-l"></div>
+ </article>
+ </div>
+ <nav class="m-navpanel m-col-m-2">
+ <h3>Categories</h3>
+ <ol class="m-block-bar-m">
+ <li><a href="category-a-category.html">A Category</a></li>
+ </ol>
+ </nav>
+ </div>
+</div>
+</main>
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>A Pelican Blog</title>
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
+ <link rel="stylesheet" href="static/m-dark.css" />
+ <link href="feeds/atom.xml" type="application/atom+xml" rel="alternate" title="A Pelican Blog" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+ <div class="m-container">
+ <div class="m-row">
+ <a href="./" id="m-navbar-brand" class="m-col-t-9 m-col-m-none m-left-m">A Pelican Blog</a>
+ </div>
+ </div>
+</nav></header>
+<main>
+<div class="m-container">
+ <div class="m-row">
+ <div class="m-col-m-10">
+ <article>
+ <header>
+ <h1><a href="article.html" rel="bookmark" title="Permalink to An article">
+ <time class="m-date" datetime="2018-09-13T00:00:00+00:00">
+ Sep <span class="m-date-day">13</span> 2018
+ </time>
+ An article
+ </a></h1>
+ </header>
+ <footer>
+ <p>Posted on <time datetime="2018-09-13T00:00:00+00:00">Sep 13, 2018</time> in <a href="category-a-category.html">A Category</a>.</p>
+ </footer>
+ <div class="m-clearfix-l"></div>
+ </article>
+ </div>
+ <nav class="m-navpanel m-col-m-2">
+ <h3>Categories</h3>
+ <ol class="m-block-bar-m">
+ <li><a href="category-a-category.html">A Category</a></li>
+ </ol>
+ </nav>
+ </div>
+</div>
+</main>
+</body>
+</html>
--- /dev/null
+An article
+##########
+
+:date: 2018-09-13
+:category: A Category
self.assertEqual(*self.actual_expected_contents('article.html'))
self.assertEqual(*self.actual_expected_contents('article-jumbo.html'))
+
+class Feeds(BlogTestCase):
+ def __init__(self, *args, **kwargs):
+ super().__init__(__file__, 'feeds', *args, **kwargs)
+
+ def test(self):
+ self.run_pelican({
+ 'M_DISABLE_SOCIAL_META_TAGS': True,
+ 'FEED_ALL_ATOM': 'atom.xml',
+ 'FEED_ALL_ATOM_URL': 'feeds/atom.xml',
+ 'CATEGORY_FEED_ATOM': '%s.atom.xml',
+ 'CATEGORY_FEED_ATOM_URL': 'feeds/%s.atom.xml',
+ })
+
+ # There should be just the first column
+ self.assertEqual(*self.actual_expected_contents('index.html'))
+ self.assertEqual(*self.actual_expected_contents('category-a-category.html'))
+
+class FeedsNoUrl(BlogTestCase):
+ def __init__(self, *args, **kwargs):
+ super().__init__(__file__, 'feeds_no_url', *args, **kwargs)
+
+ def test(self):
+ self.run_pelican({
+ 'M_DISABLE_SOCIAL_META_TAGS': True,
+ 'FEED_ALL_ATOM': 'feeds/atom.xml',
+ 'CATEGORY_FEED_ATOM': 'feeds/%s.atom.xml',
+ })
+
+ # The feed URLs should be the same as above
+ self.assertEqual(*self.actual_expected_contents('index.html', '../blog_feeds/index.html'))
+ self.assertEqual(*self.actual_expected_contents('category-a-category.html', '../blog_feeds/category-a-category.html'))