Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atom syndication #26

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

andete
Copy link

@andete andete commented Feb 27, 2018

Implementation for #25 .
Allows to generate an atom feed for the blog. Validated with w3c and tested with feedly and found to work fine.
Following fields are required for it in Leven.toml:

  • uuid (a uuid, used to identify the feed)
  • home_url (the homepage of the feed website)
  • base_url (the base url of the blog, could be same as home_url but doesn't have to)
  • feed_url (the url of the feed.xml, could perhaps be derived from base_url)
  • author (the author of the blog)
  • email (the email of the author)

Optionally a date can also be specified to be used for the generated feed xml, if not specified, now is used.

@quadrupleslap
Copy link
Collaborator

This looks amazing! I'll read over it as soon as I get home. :)

@quadrupleslap
Copy link
Collaborator

quadrupleslap commented Mar 4, 2018

I have a few (very minor) questions:

  • Post.date is already the last updated (i.e. modified) date, so what's the point of adding an updated_date field, too?
  • Instead of changing the default date format in build_atom_feed, wouldn't it be easier to use date.iso8601 in the template? That's basically what it's there for, anyway.
  • config.date should probably be replaced with another global named now.
  • feed.html should be feed.xml, and it isn't currently being written out in init/mod.rs like it should be. Edit: This is my fault, because the template engine assumes the extension is .html, doesn't it? Maybe I should fix that after accepting this pull request.
  • I'm still not sure which syntax is better for frontmatter, but I'm leaning towards ^---$ (i.e. --- that is on its own line). Is it okay if I use that instead?
  • Edit: Also, I think it might be a good idea to add <link rel="alternate" type="application/atom+xml" title="Blog" href="/feed.xml to the default index.html template.

I can write the rest of the code now, that's the easy part. Again, thanks for the massive contribution! :)

@andete
Copy link
Author

andete commented Mar 4, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants