Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat slug='' as if there is no slug #3705

Merged
merged 1 commit into from
Aug 3, 2023
Merged

Treat slug='' as if there is no slug #3705

merged 1 commit into from
Aug 3, 2023

Conversation

ralsina
Copy link
Member

@ralsina ralsina commented Aug 1, 2023

When switching post metadata to YAML and having Nikola save it, it will look like this:

---
category: ''
date: Mon, 01 Oct 2012 19:03:42 -0700
description: ''
link: ''
slug: ''
tags: books, goodreads
title: '1633'
type: text
---

But when reading it back, it will only use the title as the slug if the slug key is missing. That means it will consider the slug to be an empty string and try to generate whatever/.html which is bad.

This tiny PR fixes that.

@ralsina ralsina merged commit 65f362e into master Aug 3, 2023
10 checks passed
@ralsina ralsina deleted the fix-empty-slug branch August 3, 2023 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants