Skip to content

[Bug] KeyError: 'Slug' #31

@Kristinita

Description

@Kristinita

1. Summary

If users set [**SLUGIFY_SOURCE = 'basename'**](http://docs.getpelican.com/en/stable/settings.html?highlight=slugify_source#basic-settings) in pelicanconf.py, Slug is not mandatory parameter.

2. Expected behavior

Not stack trace in console.

3. Actual behavior

command: pelican_insert_metadata
Traceback (most recent call last):
  File "D:\Sublime Text 3 x64\sublime_plugin.py", line 818, in run_
    return self.run(edit)
  File "Pelican in D:\Sublime Text 3 x64\Data\Installed Packages\Pelican.sublime-package", line 187, in run
KeyError: 'Slug'

4. Settings

Example of User/Pelican.sublime-settings file, I remove Slug parameter:

{
    "article_metadata_template": {
    // Metadata template for Markdown articles
    "md":
      [
        "Title: ",
        "Template: ",
        "Date: %(date)s",
        "Modified: %(modified)s",
        "Author: %(author)s",
        "Lang: %(lang)s",
        "JQuery: true",
        "DetailsPolyfill: false"
      ]
      }
}

5. Steps to reproduce

The problem is reproduced for me in a version of Sublime Text without plugins and user settings.

I open any md file → Ctrl+Shift+PPelican: Insert Metadata → I get actual behavior.

6. Environment

Operating system and version:
Windows 10 Enterprise LTSB 64-bit EN
Sublime Text:
Build 3126

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions