statik icon indicating copy to clipboard operation
statik copied to clipboard

Batteries-included RSS/Atom feed support

Open thanethomson opened this issue 9 years ago • 2 comments

RSS/Atom feeds should be generated automatically from configuration options in the project's config.yml file.

e.g.

project-name: RSS demo project
base-path: /
feeds:
  posts:
    file: /feeds/posts.xml
    query: session.query(Post).order_by(Post.date.desc())
  projects:
    file: /feeds/projects.xml
    query: session.query(Project).order_by(Project.released.desc())

thanethomson avatar Jul 20 '16 11:07 thanethomson

Wouldn't this only create a feed for all posts/projects/etc? How could we get feeds for more specific queries, such as all posts of a certain category or with a certain tag?

konstruktiv avatar Jan 28 '18 18:01 konstruktiv

That particular example would get all posts and projects, but to make it more specific, just tweak your SQLAlchemy/MLAlchemy query that generates the feed.

e.g.

feeds:
  programming-posts:
    file: /feeds/programming-posts.xml
    query: session.query(Post).filter(Post.tags.any(name='programming')).order_by(Post.date.desc())

See SQLAlchemy's documentation for details.

thanethomson avatar Feb 10 '18 06:02 thanethomson