Skip to content

Commit

Permalink
Treat slug='' as if there is no slug (#3705)
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed Aug 3, 2023
1 parent e019118 commit 65f362e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nikola/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -1213,12 +1213,12 @@ def get_meta(post, lang):

if lang is None:
# Only perform these checks for the default language
if 'slug' not in meta:
if 'slug' not in meta or not meta['slug']:
# If no slug is found in the metadata use the filename
meta['slug'] = slugify(os.path.splitext(
os.path.basename(post.source_path))[0], post.default_lang)

if 'title' not in meta:
if 'title' not in meta or not meta['title']:
# If no title is found, use the filename without extension
meta['title'] = os.path.splitext(
os.path.basename(post.source_path))[0]
Expand Down

0 comments on commit 65f362e

Please sign in to comment.