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

[i18n_subsites]: Fix broken feed links #1299

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions i18n_subsites/i18n_subsites.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ def prepare_site_db_and_overrides():
overrides['THEME_STATIC_DIR'] = posixpath.join(
relpath, _MAIN_SETTINGS['THEME_STATIC_DIR'])
overrides['THEME_STATIC_PATHS'] = []
if 'FEED_DOMAIN' not in overrides:
overrides['FEED_DOMAIN'] = posixpath.join(_MAIN_SETTINGS['FEED_DOMAIN'], lang)
# to change what is perceived as translations
overrides['DEFAULT_LANG'] = lang

Expand Down
3 changes: 2 additions & 1 deletion i18n_subsites/test_data/output/an-untranslated-article.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<title>Testing site - An untranslated article</title>
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testing site Full Atom Feed" />
<link href="http://example.com/test/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Testing site Full Atom Feed" />
<link href="http://example.com/test/feeds/misc.atom.xml" type="application/atom+xml" rel="alternate" title="Testing site Categories Atom Feed" />

<link rel="stylesheet" href="http://example.com/test/theme/style.css" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<title>Testovací stránka - An untranslated article</title>
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testovací stránka Full Atom Feed" />
<link href="http://example.com/test/cz/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Testovací stránka Full Atom Feed" />
<link href="http://example.com/test/cz/feeds/misc.atom.xml" type="application/atom+xml" rel="alternate" title="Testovací stránka Categories Atom Feed" />

<link rel="stylesheet" href="http://example.com/test/cz/../theme/style.css" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Testovací stránka</title><link href="http://example.com/test/cz/" rel="alternate"></link><link href="http://example.com/test/feeds_all.atom.xml" rel="self"></link><id>http://example.com/test/cz/</id><updated>2014-09-15T00:00:00+00:00</updated><entry><title>Přeložený článek</title><link href="http://example.com/test/cz/translated-article.html" rel="alternate"></link><published>2014-09-15T00:00:00+00:00</published><updated>2014-09-15T00:00:00+00:00</updated><author><name>Test Testovič</name></author><id>tag:example.com,2014-09-15:/test/cz/translated-article.html</id><content type="html">&lt;p&gt;Jednoduchý článek s překlady.
<feed xmlns="http://www.w3.org/2005/Atom"><title>Testovací stránka</title><link href="http://example.com/test/cz/" rel="alternate"></link><link href="http://example.com/test/cz/feeds/all.atom.xml" rel="self"></link><id>http://example.com/test/cz/</id><updated>2014-09-15T00:00:00+00:00</updated><entry><title>Přeložený článek</title><link href="http://example.com/test/cz/translated-article.html" rel="alternate"></link><published>2014-09-15T00:00:00+00:00</published><updated>2014-09-15T00:00:00+00:00</updated><author><name>Test Testovič</name></author><id>tag:example.com,2014-09-15:/test/cz/translated-article.html</id><content type="html">&lt;p&gt;Jednoduchý článek s překlady.
Zde je odkaz na &lt;a class="reference external" href="http://example.com/test/images/img.png"&gt;nějaký obrázek&lt;/a&gt;.&lt;/p&gt;
</content><category term="misc"></category></entry><entry><title>Ein übersetzter Artikel</title><link href="http://example.com/test/de/translated-article.html" rel="alternate"></link><published>2014-09-14T00:00:00+00:00</published><updated>2014-09-14T00:00:00+00:00</updated><author><name>Test Testovič</name></author><id>tag:example.com,2014-09-14:/test/de/translated-article.html</id><content type="html">&lt;p&gt;Ein einfacher Artikel mit einer Übersetzung.
Hier ist ein Link zur &lt;a class="reference external" href="http://example.com/test/images/img.png"&gt;einigem Bild&lt;/a&gt;.&lt;/p&gt;
Expand Down
6 changes: 6 additions & 0 deletions i18n_subsites/test_data/output/cz/feeds/misc.atom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Testovací stránka - misc</title><link href="http://example.com/test/cz/" rel="alternate"></link><link href="http://example.com/test/cz/feeds/misc.atom.xml" rel="self"></link><id>http://example.com/test/cz/</id><updated>2014-09-15T00:00:00+00:00</updated><entry><title>Přeložený článek</title><link href="http://example.com/test/cz/translated-article.html" rel="alternate"></link><published>2014-09-15T00:00:00+00:00</published><updated>2014-09-15T00:00:00+00:00</updated><author><name>Test Testovič</name></author><id>tag:example.com,2014-09-15:/test/cz/translated-article.html</id><content type="html">&lt;p&gt;Jednoduchý článek s překlady.
Zde je odkaz na &lt;a class="reference external" href="http://example.com/test/images/img.png"&gt;nějaký obrázek&lt;/a&gt;.&lt;/p&gt;
</content><category term="misc"></category></entry><entry><title>An untranslated article</title><link href="http://example.com/test/cz/an-untranslated-article-en.html" rel="alternate"></link><published>2014-07-14T00:00:00+00:00</published><updated>2014-07-14T00:00:00+00:00</updated><author><name>Test Testovič</name></author><id>tag:example.com,2014-07-14:/test/cz/an-untranslated-article-en.html</id><content type="html">&lt;p&gt;An article without a translation.
Here is a link to an &lt;a class="reference external" href="http://example.com/test/pages/untranslated-page.html"&gt;untranslated page&lt;/a&gt;&lt;/p&gt;
</content><category term="misc"></category></entry></feed>
2 changes: 1 addition & 1 deletion i18n_subsites/test_data/output/cz/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Welcome to our Testovací stránka</title>
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testovací stránka Full Atom Feed" />
<link href="http://example.com/test/cz/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Testovací stránka Full Atom Feed" />

<link rel="stylesheet" href="http://example.com/test/cz/../theme/style.css" />
</head>
Expand Down
4 changes: 2 additions & 2 deletions i18n_subsites/test_data/output/cz/pages/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Testovací stránka - 404 stránka</title>
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testovací stránka Full Atom Feed" />
<link href="http://example.com/test/cz/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Testovací stránka Full Atom Feed" />

<link rel="stylesheet" href="http://example.com/test/cz/../theme/style.css" />

Expand Down Expand Up @@ -37,4 +37,4 @@ <h1>404 stránka</h1>
</address><!-- /#about -->
</footer><!-- /#contentinfo -->
</body>
</html>
</html>
3 changes: 2 additions & 1 deletion i18n_subsites/test_data/output/cz/translated-article.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<title>Testovací stránka - Přeložený článek</title>
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testovací stránka Full Atom Feed" />
<link href="http://example.com/test/cz/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Testovací stránka Full Atom Feed" />
<link href="http://example.com/test/cz/feeds/misc.atom.xml" type="application/atom+xml" rel="alternate" title="Testovací stránka Categories Atom Feed" />

<link rel="stylesheet" href="http://example.com/test/cz/../theme/style.css" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<title>Testseite - An untranslated article</title>
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testseite Full Atom Feed" />
<link href="http://example.com/test/de/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Testseite Full Atom Feed" />
<link href="http://example.com/test/de/feeds/misc.atom.xml" type="application/atom+xml" rel="alternate" title="Testseite Categories Atom Feed" />

<link rel="stylesheet" href="http://example.com/test/de/../theme/style.css" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Testseite</title><link href="http://example.com/test/de/" rel="alternate"></link><link href="http://example.com/test/feeds_all.atom.xml" rel="self"></link><id>http://example.com/test/de/</id><updated>2014-09-15T00:00:00+00:00</updated><entry><title>Přeložený článek</title><link href="http://example.com/test/cz/translated-article.html" rel="alternate"></link><published>2014-09-15T00:00:00+00:00</published><updated>2014-09-15T00:00:00+00:00</updated><author><name>Der Tester</name></author><id>tag:example.com,2014-09-15:/test/cz/translated-article.html</id><content type="html">&lt;p&gt;Jednoduchý článek s překlady.
<feed xmlns="http://www.w3.org/2005/Atom"><title>Testseite</title><link href="http://example.com/test/de/" rel="alternate"></link><link href="http://example.com/test/de/feeds/all.atom.xml" rel="self"></link><id>http://example.com/test/de/</id><updated>2014-09-15T00:00:00+00:00</updated><entry><title>Přeložený článek</title><link href="http://example.com/test/cz/translated-article.html" rel="alternate"></link><published>2014-09-15T00:00:00+00:00</published><updated>2014-09-15T00:00:00+00:00</updated><author><name>Der Tester</name></author><id>tag:example.com,2014-09-15:/test/cz/translated-article.html</id><content type="html">&lt;p&gt;Jednoduchý článek s překlady.
Zde je odkaz na &lt;a class="reference external" href="http://example.com/test/images/img.png"&gt;nějaký obrázek&lt;/a&gt;.&lt;/p&gt;
</content><category term="misc"></category></entry><entry><title>Ein übersetzter Artikel</title><link href="http://example.com/test/de/translated-article.html" rel="alternate"></link><published>2014-09-14T00:00:00+00:00</published><updated>2014-09-14T00:00:00+00:00</updated><author><name>Der Tester</name></author><id>tag:example.com,2014-09-14:/test/de/translated-article.html</id><content type="html">&lt;p&gt;Ein einfacher Artikel mit einer Übersetzung.
Hier ist ein Link zur &lt;a class="reference external" href="http://example.com/test/images/img.png"&gt;einigem Bild&lt;/a&gt;.&lt;/p&gt;
Expand Down
4 changes: 4 additions & 0 deletions i18n_subsites/test_data/output/de/feeds/misc.atom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Testseite - misc</title><link href="http://example.com/test/de/" rel="alternate"></link><link href="http://example.com/test/de/feeds/misc.atom.xml" rel="self"></link><id>http://example.com/test/de/</id><updated>2014-09-14T00:00:00+00:00</updated><entry><title>Ein übersetzter Artikel</title><link href="http://example.com/test/de/translated-article.html" rel="alternate"></link><published>2014-09-14T00:00:00+00:00</published><updated>2014-09-14T00:00:00+00:00</updated><author><name>Der Tester</name></author><id>tag:example.com,2014-09-14:/test/de/translated-article.html</id><content type="html">&lt;p&gt;Ein einfacher Artikel mit einer Übersetzung.
Hier ist ein Link zur &lt;a class="reference external" href="http://example.com/test/images/img.png"&gt;einigem Bild&lt;/a&gt;.&lt;/p&gt;
</content><category term="misc"></category></entry></feed>
2 changes: 1 addition & 1 deletion i18n_subsites/test_data/output/de/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Willkommen Sie zur unserer Testseite</title>
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testseite Full Atom Feed" />
<link href="http://example.com/test/de/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Testseite Full Atom Feed" />

<link rel="stylesheet" href="http://example.com/test/de/../theme/style.css" />
</head>
Expand Down
2 changes: 1 addition & 1 deletion i18n_subsites/test_data/output/de/pages/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Testseite - Eine 404 Seite</title>
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testseite Full Atom Feed" />
<link href="http://example.com/test/de/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Testseite Full Atom Feed" />

<link rel="stylesheet" href="http://example.com/test/de/../theme/style.css" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Testseite - Untranslated page</title>
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testseite Full Atom Feed" />
<link href="http://example.com/test/de/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Testseite Full Atom Feed" />

<link rel="stylesheet" href="http://example.com/test/de/../theme/style.css" />

Expand Down
3 changes: 2 additions & 1 deletion i18n_subsites/test_data/output/de/translated-article.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<title>Testseite - Ein übersetzter Artikel</title>
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testseite Full Atom Feed" />
<link href="http://example.com/test/de/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Testseite Full Atom Feed" />
<link href="http://example.com/test/de/feeds/misc.atom.xml" type="application/atom+xml" rel="alternate" title="Testseite Categories Atom Feed" />

<link rel="stylesheet" href="http://example.com/test/de/../theme/style.css" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Testing site</title><link href="http://example.com/test/" rel="alternate"></link><link href="http://example.com/test/feeds_all.atom.xml" rel="self"></link><id>http://example.com/test/</id><updated>2014-09-15T00:00:00+00:00</updated><entry><title>Přeložený článek</title><link href="http://example.com/test/cz/translated-article.html" rel="alternate"></link><published>2014-09-15T00:00:00+00:00</published><updated>2014-09-15T00:00:00+00:00</updated><author><name>The Tester</name></author><id>tag:example.com,2014-09-15:/test/cz/translated-article.html</id><content type="html">&lt;p&gt;Jednoduchý článek s překlady.
<feed xmlns="http://www.w3.org/2005/Atom"><title>Testing site</title><link href="http://example.com/test/" rel="alternate"></link><link href="http://example.com/test/feeds/all.atom.xml" rel="self"></link><id>http://example.com/test/</id><updated>2014-09-15T00:00:00+00:00</updated><entry><title>Přeložený článek</title><link href="http://example.com/test/cz/translated-article.html" rel="alternate"></link><published>2014-09-15T00:00:00+00:00</published><updated>2014-09-15T00:00:00+00:00</updated><author><name>The Tester</name></author><id>tag:example.com,2014-09-15:/test/cz/translated-article.html</id><content type="html">&lt;p&gt;Jednoduchý článek s překlady.
Zde je odkaz na &lt;a class="reference external" href="http://example.com/test/images/img.png"&gt;nějaký obrázek&lt;/a&gt;.&lt;/p&gt;
</content><category term="misc"></category></entry><entry><title>Ein übersetzter Artikel</title><link href="http://example.com/test/de/translated-article.html" rel="alternate"></link><published>2014-09-14T00:00:00+00:00</published><updated>2014-09-14T00:00:00+00:00</updated><author><name>The Tester</name></author><id>tag:example.com,2014-09-14:/test/de/translated-article.html</id><content type="html">&lt;p&gt;Ein einfacher Artikel mit einer Übersetzung.
Hier ist ein Link zur &lt;a class="reference external" href="http://example.com/test/images/img.png"&gt;einigem Bild&lt;/a&gt;.&lt;/p&gt;
Expand Down
6 changes: 6 additions & 0 deletions i18n_subsites/test_data/output/feeds/misc.atom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Testing site - misc</title><link href="http://example.com/test/" rel="alternate"></link><link href="http://example.com/test/feeds/misc.atom.xml" rel="self"></link><id>http://example.com/test/</id><updated>2014-09-13T00:00:00+00:00</updated><entry><title>A translated article</title><link href="http://example.com/test/translated-article.html" rel="alternate"></link><published>2014-09-13T00:00:00+00:00</published><updated>2014-09-13T00:00:00+00:00</updated><author><name>The Tester</name></author><id>tag:example.com,2014-09-13:/test/translated-article.html</id><content type="html">&lt;p&gt;A simple article with a translation.
Here is a link to &lt;a class="reference external" href="http://example.com/test/images/img.png"&gt;some image&lt;/a&gt;.&lt;/p&gt;
</content><category term="misc"></category></entry><entry><title>An untranslated article</title><link href="http://example.com/test/an-untranslated-article.html" rel="alternate"></link><published>2014-07-14T00:00:00+00:00</published><updated>2014-07-14T00:00:00+00:00</updated><author><name>The Tester</name></author><id>tag:example.com,2014-07-14:/test/an-untranslated-article.html</id><content type="html">&lt;p&gt;An article without a translation.
Here is a link to an &lt;a class="reference external" href="http://example.com/test/pages/untranslated-page.html"&gt;untranslated page&lt;/a&gt;&lt;/p&gt;
</content><category term="misc"></category></entry></feed>
2 changes: 1 addition & 1 deletion i18n_subsites/test_data/output/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Welcome to our Testing site</title>
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testing site Full Atom Feed" />
<link href="http://example.com/test/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Testing site Full Atom Feed" />

<link rel="stylesheet" href="http://example.com/test/theme/style.css" />
</head>
Expand Down
2 changes: 1 addition & 1 deletion i18n_subsites/test_data/output/pages/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Testing site - A 404 page</title>
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testing site Full Atom Feed" />
<link href="http://example.com/test/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Testing site Full Atom Feed" />

<link rel="stylesheet" href="http://example.com/test/theme/style.css" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Testing site - Untranslated page</title>
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testing site Full Atom Feed" />
<link href="http://example.com/test/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Testing site Full Atom Feed" />

<link rel="stylesheet" href="http://example.com/test/theme/style.css" />

Expand Down
3 changes: 2 additions & 1 deletion i18n_subsites/test_data/output/translated-article.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<title>Testing site - A translated article</title>
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testing site Full Atom Feed" />
<link href="http://example.com/test/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Testing site Full Atom Feed" />
<link href="http://example.com/test/feeds/misc.atom.xml" type="application/atom+xml" rel="alternate" title="Testing site Categories Atom Feed" />

<link rel="stylesheet" href="http://example.com/test/theme/style.css" />

Expand Down
5 changes: 2 additions & 3 deletions i18n_subsites/test_data/pelicanconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
DEFAULT_LANG = 'en'
LOCALE = 'en_US.UTF-8'

# Generate only one feed
FEED_ALL_ATOM = 'feeds_all.atom.xml'
CATEGORY_FEED_ATOM = None
FEED_ALL_ATOM = 'feeds/all.atom.xml'
CATEGORY_FEED_ATOM = 'feeds/{slug}.atom.xml'
TRANSLATION_FEED_ATOM = None
AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None
Expand Down