Skip to content

Commit

Permalink
precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
nabobalis committed Sep 16, 2020
1 parent 288089f commit 5191079
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions ablog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from .blog import CONFIG, Blog
from .post import (
CheckFrontMatter,
PostDirective,
PostListDirective,
UpdateDirective,
Expand All @@ -17,7 +18,6 @@
process_postlist,
process_posts,
purge_posts,
CheckFrontMatter,
)
from .version import version as __version__

Expand Down Expand Up @@ -100,8 +100,7 @@ def setup(app):

def config_inited(app, config):
app.config.templates_path.append(get_html_templates_path())
app.config.matched_blog_posts = [os.path.splitext(ii)[0]
for ii in glob(config.blog_post_pattern)]
app.config.matched_blog_posts = [os.path.splitext(ii)[0] for ii in glob(config.blog_post_pattern)]


def get_html_templates_path():
Expand Down
6 changes: 3 additions & 3 deletions ablog/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from docutils.parsers.rst.directives.admonitions import BaseAdmonition
from feedgen.feed import FeedGenerator
from sphinx.locale import _
from sphinx.util.nodes import set_source_info
from sphinx.transforms import SphinxTransform
from sphinx.util.nodes import set_source_info

import ablog

Expand Down Expand Up @@ -152,7 +152,7 @@ def run(self):

class CheckFrontMatter(SphinxTransform):
"""Check the doctree for frontmatter meant for a blog post.
This is mutually-exclusive with the PostDirective. Only one much be used."""

# Priority before 880 so that it runs before the `doctree-read` event
Expand Down Expand Up @@ -186,7 +186,7 @@ def apply(self):
elif isinstance(option_spec[key], directives.flag):
new_val = True
metadata[key] = new_val

node = PostNode()
node.document = self.document
node = _update_post_node(node, metadata, [])
Expand Down

0 comments on commit 5191079

Please sign in to comment.