-
Notifications
You must be signed in to change notification settings - Fork 104
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 1.0 support #1089
Atom 1.0 support #1089
Conversation
…d error propogation for Atom generation. Ensure atom parent folder exists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This includes some parts that are new features outside of atomic support. We should make sure we are on the same page for the requirements in an issue and then do a PR for them.
For what atom support doesn't directly depend on, let's not have atom block on it but then have another PR to take advantage of it
@@ -21,12 +21,16 @@ pub struct Frontmatter { | |||
#[serde(skip_serializing_if = "Option::is_none")] | |||
pub categories: Option<Vec<liquid_core::model::KString>>, | |||
#[serde(skip_serializing_if = "Option::is_none")] | |||
pub authors: Option<Vec<liquid_core::model::KString>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you split this out into its own Issue / PR?
pub tags: Option<Vec<liquid_core::model::KString>>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub excerpt_separator: Option<liquid_core::model::KString>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub published_date: Option<DateTime>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub updated_date: Option<DateTime>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you split this out into its own issue / PR?
#197 exists but that is more about automatically inferring it
// create target directories if any exist | ||
if let Some(parent) = path.parent() { | ||
fs::create_dir_all(parent) | ||
.with_context(|_| failure::format_err!("Could not create {}", parent.display()))?; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other ones don't have this. Is there a reason to do it to one vs all?
use vimwiki::vendor::chrono::DateTime; | ||
use vimwiki::vendor::chrono::Utc; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't be relying on vimwiki like this. If we need chrono, we should use chrono.
@@ -0,0 +1,16 @@ | |||
```console | |||
$ cobalt -v build --destination _dest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need .out
directories made so we can snapshot the filesystem.
TRYCMD=dump
will dump to a directory. You can then copy the output over into the test
@epage Hey thanks for reviewing my PR. I actually ended up using Jekyll to fix my issue, and thereby lost the driving need to add this to Cobalt. 😆 |
This PR resolves issue #1081 by adding Atom 1.0 feed support.
In order to generate valid Atom feeds, I had to add 2 new frontmatter settings,
updated_date
andauthors
:The Atom spec demands the existence of an "updated" date, while the "published" date is optional -- this seems backwards to me but I won't argue with the spec 😄 . Since
published_date
is more common in cobalt, I've made Atom use it as a fallback. That way, most existing cobalt blogs should be fine.However, Atom also demands the existence of "authors". For single-author blogs, you may be well-served to stick the author into your _cobalt.yml's "default" section.