Skip to content

{attach} and {filename} don't work in metadata fields #2360

@torfsen

Description

@torfsen

I'm not sure whether this is a bug or intentional, but {attach} and {filename} don't work in the metadata fields of an article. For example, the following article is working fine, except that image.png is not copied to the articles output directory:

A Test
######

:date: 2018-06-22
:thumbnail: {attach}./image.png

Some text

Note that the image is copied to the output directory, but like a "normal" static file: its path is preserved instead of the image being put in the article's directory.

In addition, the thumbnail property of the article's article object in the template equals {attach}./image.png.

Using {attach} in the body of the article works as documented.

I would have expected that

  1. the image is copied to the same directory as the article's HTML file
  2. article.thumbnail equals the image file's output filename

{filename} is also affected, i.e. when using {filename} instead of {attach} in the example above the article.thumbnail property is equal to {filename}./image.png. Again I would have expected it to be equal to the image's output filename.

$ pelican --version
3.7.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions