From 96ffe2037dd35fce46c1cc420efa9085541f20ba Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Tue, 1 Aug 2023 10:25:28 -0300 Subject: [PATCH] Treat slug='' as if there is no slug --- nikola/post.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nikola/post.py b/nikola/post.py index c753f874e3..1dcd33d609 100644 --- a/nikola/post.py +++ b/nikola/post.py @@ -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]