diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2019-04-20 02:48:57 +0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2019-04-20 03:18:45 +0200 |
commit | cf95aa88595184f51da4eeb06301e436a6a5f589 (patch) | |
tree | 8381f416e4963a9a1501fcc67fa8ea1f5f99bee5 /tests/blogc-make/check_atom.c | |
parent | 8dd8f936bc973f28b67624709b96e805f58dd6bd (diff) | |
download | blogc-cf95aa88595184f51da4eeb06301e436a6a5f589.tar.gz blogc-cf95aa88595184f51da4eeb06301e436a6a5f589.tar.bz2 blogc-cf95aa88595184f51da4eeb06301e436a6a5f589.zip |
make: use permalinks as atom ids
I have just realized that was implementing atom feeds wrong for long
time. atom ids are supposed to be valid uris. this is a small but
breaking change. it is supposed to make some clients think that all
of the old posts were republished. This can be avoided by running
something like this, before upgrading:
$ blogc-make atom_dump > templates/atom.tmpl
however, keep in mind that your atom ids are invalid :/
Diffstat (limited to 'tests/blogc-make/check_atom.c')
-rw-r--r-- | tests/blogc-make/check_atom.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/tests/blogc-make/check_atom.c b/tests/blogc-make/check_atom.c index 551201d..a8fe4af 100644 --- a/tests/blogc-make/check_atom.c +++ b/tests/blogc-make/check_atom.c @@ -40,7 +40,7 @@ test_atom_generate_empty_file(void **state) "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n" " <title type=\"text\">{{ SITE_TITLE }}{% ifdef FILTER_TAG %} - " "{{ FILTER_TAG }}{% endif %}</title>\n" - " <id>{{ BASE_URL }}{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" + " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" "{% else %}/index{% endif %}.xml</id>\n" " <updated>{{ DATE_FIRST_FORMATTED }}</updated>\n" " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/\" />\n" @@ -54,7 +54,7 @@ test_atom_generate_empty_file(void **state) " {% block listing %}\n" " <entry>\n" " <title type=\"text\">{{ TITLE }}</title>\n" - " <id>{{ BASE_URL }}/{{ FILENAME }}.html</id>\n" + " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}/{{ FILENAME }}.html</id>\n" " <updated>{{ DATE_FORMATTED }}</updated>\n" " <published>{{ DATE_FORMATTED }}</published>\n" " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/{{ FILENAME }}.html\" />\n" @@ -92,7 +92,7 @@ test_atom_generate_empty_dir(void **state) "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n" " <title type=\"text\">{{ SITE_TITLE }}{% ifdef FILTER_TAG %} - " "{{ FILTER_TAG }}{% endif %}</title>\n" - " <id>{{ BASE_URL }}{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" + " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" "{% endif %}/index.xml</id>\n" " <updated>{{ DATE_FIRST_FORMATTED }}</updated>\n" " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/\" />\n" @@ -106,7 +106,7 @@ test_atom_generate_empty_dir(void **state) " {% block listing %}\n" " <entry>\n" " <title type=\"text\">{{ TITLE }}</title>\n" - " <id>{{ BASE_URL }}/{{ FILENAME }}/index.html</id>\n" + " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}/{{ FILENAME }}/index.html</id>\n" " <updated>{{ DATE_FORMATTED }}</updated>\n" " <published>{{ DATE_FORMATTED }}</published>\n" " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/{{ FILENAME }}/index.html\" />\n" @@ -144,7 +144,7 @@ test_atom_generate_file(void **state) "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n" " <title type=\"text\">{{ SITE_TITLE }}{% ifdef FILTER_TAG %} - " "{{ FILTER_TAG }}{% endif %}</title>\n" - " <id>{{ BASE_URL }}/atom{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" + " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}/atom{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" "{% endif %}.xml</id>\n" " <updated>{{ DATE_FIRST_FORMATTED }}</updated>\n" " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/\" />\n" @@ -158,7 +158,7 @@ test_atom_generate_file(void **state) " {% block listing %}\n" " <entry>\n" " <title type=\"text\">{{ TITLE }}</title>\n" - " <id>{{ BASE_URL }}/post/{{ FILENAME }}.html</id>\n" + " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}/post/{{ FILENAME }}.html</id>\n" " <updated>{{ DATE_FORMATTED }}</updated>\n" " <published>{{ DATE_FORMATTED }}</published>\n" " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/post/{{ FILENAME }}.html\" />\n" @@ -196,7 +196,7 @@ test_atom_generate_dir(void **state) "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n" " <title type=\"text\">{{ SITE_TITLE }}{% ifdef FILTER_TAG %} - " "{{ FILTER_TAG }}{% endif %}</title>\n" - " <id>{{ BASE_URL }}/atom{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" + " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}/atom{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" "{% endif %}/index.xml</id>\n" " <updated>{{ DATE_FIRST_FORMATTED }}</updated>\n" " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/\" />\n" @@ -210,7 +210,7 @@ test_atom_generate_dir(void **state) " {% block listing %}\n" " <entry>\n" " <title type=\"text\">{{ TITLE }}</title>\n" - " <id>{{ BASE_URL }}/post/{{ FILENAME }}/index.html</id>\n" + " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}/post/{{ FILENAME }}/index.html</id>\n" " <updated>{{ DATE_FORMATTED }}</updated>\n" " <published>{{ DATE_FORMATTED }}</published>\n" " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/post/{{ FILENAME }}/index.html\" />\n" @@ -256,7 +256,7 @@ test_atom_empty_file(void **state) "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n" " <title type=\"text\">{{ SITE_TITLE }}{% ifdef FILTER_TAG %} - " "{{ FILTER_TAG }}{% endif %}</title>\n" - " <id>{{ BASE_URL }}{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" + " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" "{% else %}/index{% endif %}.xml</id>\n" " <updated>{{ DATE_FIRST_FORMATTED }}</updated>\n" " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/\" />\n" @@ -270,7 +270,7 @@ test_atom_empty_file(void **state) " {% block listing %}\n" " <entry>\n" " <title type=\"text\">{{ TITLE }}</title>\n" - " <id>{{ BASE_URL }}/{{ FILENAME }}.html</id>\n" + " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}/{{ FILENAME }}.html</id>\n" " <updated>{{ DATE_FORMATTED }}</updated>\n" " <published>{{ DATE_FORMATTED }}</published>\n" " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/{{ FILENAME }}.html\" />\n" @@ -318,7 +318,7 @@ test_atom_empty_dir(void **state) "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n" " <title type=\"text\">{{ SITE_TITLE }}{% ifdef FILTER_TAG %} - " "{{ FILTER_TAG }}{% endif %}</title>\n" - " <id>{{ BASE_URL }}{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" + " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" "{% endif %}/index.xml</id>\n" " <updated>{{ DATE_FIRST_FORMATTED }}</updated>\n" " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/\" />\n" @@ -332,7 +332,7 @@ test_atom_empty_dir(void **state) " {% block listing %}\n" " <entry>\n" " <title type=\"text\">{{ TITLE }}</title>\n" - " <id>{{ BASE_URL }}/{{ FILENAME }}/index.html</id>\n" + " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}/{{ FILENAME }}/index.html</id>\n" " <updated>{{ DATE_FORMATTED }}</updated>\n" " <published>{{ DATE_FORMATTED }}</published>\n" " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/{{ FILENAME }}/index.html\" />\n" @@ -380,7 +380,7 @@ test_atom_file(void **state) "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n" " <title type=\"text\">{{ SITE_TITLE }}{% ifdef FILTER_TAG %} - " "{{ FILTER_TAG }}{% endif %}</title>\n" - " <id>{{ BASE_URL }}/atom{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" + " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}/atom{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" "{% endif %}.xml</id>\n" " <updated>{{ DATE_FIRST_FORMATTED }}</updated>\n" " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/\" />\n" @@ -394,7 +394,7 @@ test_atom_file(void **state) " {% block listing %}\n" " <entry>\n" " <title type=\"text\">{{ TITLE }}</title>\n" - " <id>{{ BASE_URL }}/post/{{ FILENAME }}.html</id>\n" + " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}/post/{{ FILENAME }}.html</id>\n" " <updated>{{ DATE_FORMATTED }}</updated>\n" " <published>{{ DATE_FORMATTED }}</published>\n" " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/post/{{ FILENAME }}.html\" />\n" @@ -442,7 +442,7 @@ test_atom_dir(void **state) "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n" " <title type=\"text\">{{ SITE_TITLE }}{% ifdef FILTER_TAG %} - " "{{ FILTER_TAG }}{% endif %}</title>\n" - " <id>{{ BASE_URL }}/atom{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" + " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}/atom{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" "{% endif %}/index.xml</id>\n" " <updated>{{ DATE_FIRST_FORMATTED }}</updated>\n" " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/\" />\n" @@ -456,7 +456,7 @@ test_atom_dir(void **state) " {% block listing %}\n" " <entry>\n" " <title type=\"text\">{{ TITLE }}</title>\n" - " <id>{{ BASE_URL }}/post/{{ FILENAME }}/index.html</id>\n" + " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}/post/{{ FILENAME }}/index.html</id>\n" " <updated>{{ DATE_FORMATTED }}</updated>\n" " <published>{{ DATE_FORMATTED }}</published>\n" " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/post/{{ FILENAME }}/index.html\" />\n" @@ -505,7 +505,7 @@ test_atom_legacy_entry_id_empty(void **state) "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n" " <title type=\"text\">{{ SITE_TITLE }}{% ifdef FILTER_TAG %} - " "{{ FILTER_TAG }}{% endif %}</title>\n" - " <id>{{ BASE_URL }}{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" + " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" "{% else %}/index{% endif %}.xml</id>\n" " <updated>{{ DATE_FIRST_FORMATTED }}</updated>\n" " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/\" />\n" @@ -519,7 +519,7 @@ test_atom_legacy_entry_id_empty(void **state) " {% block listing %}\n" " <entry>\n" " <title type=\"text\">{{ TITLE }}</title>\n" - " <id>{{ BASE_URL }}/{{ FILENAME }}/</id>\n" + " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}/{{ FILENAME }}/</id>\n" " <updated>{{ DATE_FORMATTED }}</updated>\n" " <published>{{ DATE_FORMATTED }}</published>\n" " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/{{ FILENAME }}.html\" />\n" @@ -568,7 +568,7 @@ test_atom_legacy_entry_id(void **state) "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n" " <title type=\"text\">{{ SITE_TITLE }}{% ifdef FILTER_TAG %} - " "{{ FILTER_TAG }}{% endif %}</title>\n" - " <id>{{ BASE_URL }}/atom{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" + " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}/atom{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" "{% endif %}.xml</id>\n" " <updated>{{ DATE_FIRST_FORMATTED }}</updated>\n" " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/\" />\n" @@ -582,7 +582,7 @@ test_atom_legacy_entry_id(void **state) " {% block listing %}\n" " <entry>\n" " <title type=\"text\">{{ TITLE }}</title>\n" - " <id>{{ BASE_URL }}/post/{{ FILENAME }}/</id>\n" + " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}/post/{{ FILENAME }}/</id>\n" " <updated>{{ DATE_FORMATTED }}</updated>\n" " <published>{{ DATE_FORMATTED }}</published>\n" " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/post/{{ FILENAME }}.html\" />\n" |