Sign inDemoInstall


Package Overview
File Explorer

Install Socket

Protect your apps from supply chain attacks



Lektor plugin that generates Atom feeds.




Lektor Atom Plugin

Linux tests Code Style: Black Join the chat at

Builds one or more Atom XML feeds for your Lektor-based site.

Inspired by the atom-feed-support plugin Armin Ronacher wrote for the Lektor official blog.


Add lektor-atom to your project from command line:

lektor plugins add lektor-atom

See the Lektor documentation for more instructions on installing plugins.


Here is a basic configuration:

name = My Site's Blog
source_path = /blog
url_path = /feed.xml

For each feed you want to publish, add a section to configs/atom.ini. For example, a blog with a feed of all recent posts, and a feed of recent posts about coffee:

name = My Blog
source_path = /
url_path = /feed.xml
items = site.query('/').filter(F.type == 'post')
item_model = blog-post

name = My Blog: Articles About Coffee
source_path = /
url_path = /category/coffee/feed.xml
items = site.query('/blog').filter(F.categories.contains('coffee'))
item_model = blog-post

The section names, like blog and coffee, are just used as internal identifiers.


source_path/Where in the content directory to find items' parent source
nameconfig section nameFeed name
filenamefeed.xmlName of generated Atom feed file
url_pathsource_path + filenameFeed's URL on your site
blog_author_fieldauthorName of source's author field
blog_summary_fieldsummaryName of source's summary field
itemssource_path's childrenA query expression: e.g. site.query('/').filter(F.type == 'post')
limit50How many recent items to include
item_title_fieldtitleName of items' title field
item_body_fieldbodyName of items' content body field
item_author_fieldauthorName of items' author field
item_date_fieldpub_dateName of items' publication date field
item_modelNoneFilters items on name of items' model

Customizing the plugin for your models

Use the field options to tell lektor-atom how to read your items. For example, if your site's model is:

name = Blog

type = string

type = string

Then add to atom.ini:

blog_author_field = writer
blog_summary_field = short_description

See tests/demo-project/configs/atom.ini for a complete example.

Filtering items

By default, lektor-atom gets the source at source_path and includes all its children in the feed. If you set item_model, lektor-atom includes only the children with that data model.

Set items to any query expression to override the default. If items_model is also specified, lektor-atom applies it as a filter to items.

Use In Templates

You can link to a specific feed in your template. If your atom.ini contains a feed like this:

source_path = /blog

Link to the feed in a template like this:

{{ '/blog@atom/main'|url }}



Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.


Related posts

SocketSocket SOC 2 Logo


  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc