From 58f77012dd937000661ca26f26561d27ff4df86a Mon Sep 17 00:00:00 2001 From: Colin Dunklau Date: Tue, 26 Mar 2013 00:12:59 -0500 Subject: [PATCH 1/6] Nuked spurious ./tests directory Only images, someone added a bit too much to the index --- .../basic/theme/images/icons/google-groups.png | Bin 803 -> 0 bytes tests/output/basic/theme/images/icons/vimeo.png | Bin 544 -> 0 bytes tests/output/basic/theme/images/icons/youtube.png | Bin 458 -> 0 bytes .../custom/theme/images/icons/google-groups.png | Bin 803 -> 0 bytes tests/output/custom/theme/images/icons/vimeo.png | Bin 544 -> 0 bytes .../output/custom/theme/images/icons/youtube.png | Bin 458 -> 0 bytes 6 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 tests/output/basic/theme/images/icons/google-groups.png delete mode 100644 tests/output/basic/theme/images/icons/vimeo.png delete mode 100644 tests/output/basic/theme/images/icons/youtube.png delete mode 100644 tests/output/custom/theme/images/icons/google-groups.png delete mode 100644 tests/output/custom/theme/images/icons/vimeo.png delete mode 100644 tests/output/custom/theme/images/icons/youtube.png diff --git a/tests/output/basic/theme/images/icons/google-groups.png b/tests/output/basic/theme/images/icons/google-groups.png deleted file mode 100644 index 5de15e68f4d1e4176b46fe6346d42f53e3296b21..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 803 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstUx|vage(c z!@6@aFM%9|WRD45bDP46hOx7_4S6Fo+k-*%fF5)Mpyt z6XFU~@c;jRouXIDNvA)3c>3}ElMnA6zkmDa-J1t*U*CKC>h7DDcV4}?_43)x7td}y ze|qiNlPk|2Uv}&NGS4Ioi}&t+__Wd%$cHF^5*9C6Zh|& zS-fcGqD3=xieDc*uvxqCB`~XH4>TcVYa`q+>QZfU%sx2Z(n*wUnoNHS?EYjGdv*%IzuiFv_(s)h|m2&VRzopr01MEB^#A|> diff --git a/tests/output/basic/theme/images/icons/vimeo.png b/tests/output/basic/theme/images/icons/vimeo.png deleted file mode 100644 index dba472022f0fcf7ecdd8f4847a8a3bde90789bc7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstUx|vage(c z!@6@aFM%9|WRD45bDP46hOx7_4S6Fo+k-*%fF5l;{oc z32_C|+_Uys@43gj_L}zg+illgm0x@zv+3s4+i(B>|Nr6VAFo3XmfU;0&*Mqkod+xp6y#3gPyN@QHxXzy0-n4wn!XxLor|jgco@-h?@!*{&Jj>5-y7s_z z@+$6G2Ohk5z2Vroh5JukeEmths6S=tPM4Z~$^H#Vee))+-^JCwnxk~8b9t9&bn*5L zvT{HNF_r}R1v5B2yO9RsBze2LaDKeG^bL^H>FMGaB5^si|EAa>1s)gXg^zYT($l&Y zn|<~Fe;e+k=x2)RJNb=;l_qw0c;tC<3C(%IzGPL~DJ!ccy{fL?3~Y=q61VnM+{k& zPwWILICuW)Iw1Sxx96+>e|Uf6_up&l^DbVzD4uS~541_8B*-rqWG?~05TV1%3sir^ z)5S5Q;#N{XT0%k!1BU`zox({D0S6wQ93LMAIc5h2!;S_HIkiHz2^JA8f(i{15>tM# zJZaz(V9+^u@ZiY45bDP46hOx7_4S6Fo+k-*%fF5)Mpyt z6XFU~@c;jRouXIDNvA)3c>3}ElMnA6zkmDa-J1t*U*CKC>h7DDcV4}?_43)x7td}y ze|qiNlPk|2Uv}&NGS4Ioi}&t+__Wd%$cHF^5*9C6Zh|& zS-fcGqD3=xieDc*uvxqCB`~XH4>TcVYa`q+>QZfU%sx2Z(n*wUnoNHS?EYjGdv*%IzuiFv_(s)h|m2&VRzopr01MEB^#A|> diff --git a/tests/output/custom/theme/images/icons/vimeo.png b/tests/output/custom/theme/images/icons/vimeo.png deleted file mode 100644 index dba472022f0fcf7ecdd8f4847a8a3bde90789bc7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstUx|vage(c z!@6@aFM%9|WRD45bDP46hOx7_4S6Fo+k-*%fF5l;{oc z32_C|+_Uys@43gj_L}zg+illgm0x@zv+3s4+i(B>|Nr6VAFo3XmfU;0&*Mqkod+xp6y#3gPyN@QHxXzy0-n4wn!XxLor|jgco@-h?@!*{&Jj>5-y7s_z z@+$6G2Ohk5z2Vroh5JukeEmths6S=tPM4Z~$^H#Vee))+-^JCwnxk~8b9t9&bn*5L zvT{HNF_r}R1v5B2yO9RsBze2LaDKeG^bL^H>FMGaB5^si|EAa>1s)gXg^zYT($l&Y zn|<~Fe;e+k=x2)RJNb=;l_qw0c;tC<3C(%IzGPL~DJ!ccy{fL?3~Y=q61VnM+{k& zPwWILICuW)Iw1Sxx96+>e|Uf6_up&l^DbVzD4uS~541_8B*-rqWG?~05TV1%3sir^ z)5S5Q;#N{XT0%k!1BU`zox({D0S6wQ93LMAIc5h2!;S_HIkiHz2^JA8f(i{15>tM# zJZaz(V9+^u@ZiY Date: Tue, 26 Mar 2013 01:28:42 -0400 Subject: [PATCH 2/6] Fix for issue #219: tags should list only main articles, not translations --- pelican/generators.py | 10 +++--- pelican/tests/output/basic/tag/bar.html | 42 +++++----------------- pelican/tests/output/basic/tag/baz.html | 40 ++++----------------- pelican/tests/output/basic/tag/foo.html | 42 +++++----------------- pelican/tests/output/custom/tag/bar.html | 45 +++++------------------- pelican/tests/output/custom/tag/baz.html | 43 ++++------------------ pelican/tests/output/custom/tag/foo.html | 45 +++++------------------- 7 files changed, 54 insertions(+), 213 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index f748766a..02412440 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -417,9 +417,6 @@ class ArticlesGenerator(Generator): self.add_source_path(article) if article.status == "published": - if hasattr(article, 'tags'): - for tag in article.tags: - self.tags[tag].append(article) all_articles.append(article) elif article.status == "draft": self.drafts.append(article) @@ -431,12 +428,17 @@ class ArticlesGenerator(Generator): self.articles, self.translations = process_translations(all_articles) for article in self.articles: - # only main articles are listed in categories, not translations + # only main articles are listed in categories and tags + # not translations self.categories[article.category].append(article) + if hasattr(article, 'tags'): + for tag in article.tags: + self.tags[tag].append(article) # ignore blank authors as well as undefined if hasattr(article, 'author') and article.author.name != '': self.authors[article.author].append(article) + # sort the articles by date self.articles.sort(key=attrgetter('date'), reverse=True) self.dates = list(self.articles) diff --git a/pelican/tests/output/basic/tag/bar.html b/pelican/tests/output/basic/tag/bar.html index 219f0e00..793cf737 100644 --- a/pelican/tests/output/basic/tag/bar.html +++ b/pelican/tests/output/basic/tag/bar.html @@ -35,48 +35,24 @@ -
-

Other articles

-
-
    - - - -
  1. - +

    This is some article, in english

    + + +
    +

    Other articles

    +
    +
      +
    1. diff --git a/pelican/tests/output/basic/tag/baz.html b/pelican/tests/output/basic/tag/baz.html index 97c9f387..5ca0c5de 100644 --- a/pelican/tests/output/basic/tag/baz.html +++ b/pelican/tests/output/basic/tag/baz.html @@ -35,49 +35,21 @@ -
      -

      Other articles

      -
      -
        - - - -
      1. -
      -
      +

      This is some article, in english

      +
      + +
    +