Pysmith
latest

Contents

  • Pysmith
  • Plugin Interface
  • Built-in Plugins
    • Core
      • Collection
      • Frontmatter
    • Web
      • Markdown
      • Minify
      • Permalink
      • Sass
      • Template
Pysmith
  • »
  • Built-in Plugins »
  • Web »
  • Permalink
  • Edit on GitHub

Permalink¶

class pysmith.contrib.web.permalink.Permalink(match_pattern='*.html', permalink_selector='permalink')[source]¶

Creates permalinks for pages. The permalink will be pulled from the FileInfo object as specified by the permalink_selector, and the file will be moved under the correct key for the new path. If the permalink cannot be found in the FileInfo, the file will not be renamed. Leading slashes are ignored in the permalink. If the path ends with a slash, the file will be moved to index.html in the specified folder. Otherwise the permalink will be treated as a literal path for the file.

Parameters
  • match_pattern (str) – The pattern of files to rename.

  • permalink_selector (str or func(FileInfo)) – The permalink selector. If this is a string, it will be used as the key to look up the permalink in the file metadata. If this is a function, it will be executed to find the permalink.

Next Previous

© Copyright 2020, Dave Korhumel Revision 58dca798.

Built with Sphinx using a theme provided by Read the Docs.