diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/blogc-make/atom.c | 12 | ||||
-rw-r--r-- | src/blogc-make/settings.c | 1 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/blogc-make/atom.c b/src/blogc-make/atom.c index ae5e0c1..b953876 100644 --- a/src/blogc-make/atom.c +++ b/src/blogc-make/atom.c @@ -84,11 +84,21 @@ bm_atom_deploy(bm_settings_t *settings, bc_error_t **err) char *post_url = bm_generate_filename(NULL, post_prefix, "{{ FILENAME }}", post_ext); + char *entry_id = NULL; + if (bc_str_to_bool(bc_trie_lookup(settings->settings, "atom_legacy_entry_id"))) { + entry_id = bc_strdup_printf("%s%s/{{ FILENAME }}/", + post_prefix[0] == '\0' ? "" : "/", post_prefix); + } + else { + entry_id = bc_strdup(post_url); + } + char *content = bc_strdup_printf(atom_template, atom_url->str, atom_url->str, - post_url, post_url); + entry_id, post_url); bc_string_free(atom_url, true); free(post_url); + free(entry_id); if (-1 == write(fd, content, strlen(content))) { *err = bc_error_new_printf(BLOGC_MAKE_ERROR_ATOM, diff --git a/src/blogc-make/settings.c b/src/blogc-make/settings.c index 2029199..719afe1 100644 --- a/src/blogc-make/settings.c +++ b/src/blogc-make/settings.c @@ -43,6 +43,7 @@ static const struct default_settings_map { {"atom_prefix", "atom"}, {"atom_ext", ".xml"}, {"atom_order", "DESC"}, + {"atom_legacy_entry_id", NULL}, // generic {"date_format", "%b %d, %Y, %I:%M %p GMT"}, |