Skip to content

Commit

Permalink
Merge pull request #9 from binxio/optional-subtitle
Browse files Browse the repository at this point in the history
Made subtitle an optional attribute, as it's not used for the Xebia.com brand
  • Loading branch information
mvanholsteijn authored Feb 9, 2024
2 parents 96e380a + 008e3fc commit 36f3cb8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/wordpress_markdown_blog_loader/new.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def convert(self, value, param, ctx):

@click.command(name="new")
@click.option("--title", required=True, help="of the blog")
@click.option("--subtitle", required=True, help="of the blog")
@click.option("--subtitle", required=False, help="(Optional) subtitle of the blog")
@click.option("--author", required=True, help="of the blog")
@click.option("--email", required=False, help="of the author")
@click.option("--image", required=False, type=ImageType(), help="for the banner")
Expand Down Expand Up @@ -67,7 +67,8 @@ def command(title, subtitle, author, image, brand, email, image_credits):
blog.dir = directory
blog.path = directory.joinpath("index.md")
blog.title = title.strip()
blog.subtitle = subtitle.strip()
if subtitle:
blog.subtitle = subtitle.strip()
blog.focus_keywords = " ".join(stopwords.clean(title.lower().split(), "en"))
blog.status = "draft"
blog.slug = slug
Expand Down

0 comments on commit 36f3cb8

Please sign in to comment.