Taxonomy language link left-overs #2844
Conversation
…nd categories, and deprecating the setting (#2785).
…author post lists).
(The only changes in the baseline are added |
@@ -5,11 +5,17 @@ Features | |||
-------- | |||
|
|||
* Use ``PRETTY_URLS`` by default on all sites (Issue #1838) | |||
* `also_create_classifications_from_other_languages` is deprecated |
Kwpolska
Jun 16, 2017
Member
Nuke the setting altogether. I doubt there are any third-party taxonomy plugins that depend on it.
Nuke the setting altogether. I doubt there are any third-party taxonomy plugins that depend on it.
felixfontein
Jun 16, 2017
Author
Contributor
Done.
Done.
## Handles both feeds and translations | ||
<%def name="head(classification=None)"> | ||
% if rss_link: | ||
<%def name="_append_language(language)">${ " (" + language + ")" if len(translations) > 1 else "" }</%def> |
Kwpolska
Jun 16, 2017
Member
That’s not going to pass jinjification.
That’s not going to pass jinjification.
felixfontein
Jun 16, 2017
Author
Contributor
That reminds me I forgot to run jinjify...
That reminds me I forgot to run jinjify...
felixfontein
Jun 16, 2017
Author
Contributor
(FYI: I need this "the whole macro in one line" because it seems to be impossible to get rid of the generated whitespace in Mako otherwise. And if these macros generate superfluous whitespace, this screws up the generated link texts. In Jinja2, this could be done better with whitespace control.)
(FYI: I need this "the whole macro in one line" because it seems to be impossible to get rid of the generated whitespace in Mako otherwise. And if these macros generate superfluous whitespace, this screws up the generated link texts. In Jinja2, this could be done better with whitespace control.)
Kwpolska
Jun 16, 2017
Member
A bit more code duplication is better than unreadable one-liners.
A bit more code duplication is better than unreadable one-liners.
felixfontein
Jun 16, 2017
Author
Contributor
If it would be only a bit more, I'd agree. But here it will be a lot.
Except if I add a function for generating a <link>
or <a>
which contains all the cases in there and has some more additional variables. I don't know if that's easier to read.
If it would be only a bit more, I'd agree. But here it will be a lot.
Except if I add a function for generating a <link>
or <a>
which contains all the cases in there and has some more additional variables. I don't know if that's easier to read.
Kwpolska
Jun 16, 2017
Member
That might look better. _proper
screams “this is an ugly hack”
That might look better. _proper
screams “this is an ugly hack”
## Handles both feeds and translations | ||
<%def name="head(classification=None, kind='index', feeds=True, other=True, rss_override=True, has_no_feeds=False)"> | ||
% if feeds and not has_no_feeds: | ||
${_head_rss(classification, 'index' if (kind == 'archive' and rss_override) else kind, rss_override)} |
Kwpolska
Jun 16, 2017
Member
Jinja probably won’t like this inline if either.
Jinja probably won’t like this inline if either.
felixfontein
Jun 16, 2017
Author
Contributor
That survived jinjification (as opposed to the above) and should work fine in jinja.
That survived jinjification (as opposed to the above) and should work fine in jinja.
## Handles both feeds and translations | ||
<%def name="head(classification=None)"> | ||
% if rss_link: | ||
<%def name="_append_language(language)">${ " (" + language + ")" if len(translations) > 1 else "" }</%def> |
Kwpolska
Jun 16, 2017
Member
A bit more code duplication is better than unreadable one-liners.
A bit more code duplication is better than unreadable one-liners.
@@ -16,7 +16,7 @@ | |||
|
|||
<%block name="content"> | |||
<%block name="content_header"> | |||
${feeds_translations.translation_link()} | |||
${feeds_translations.translation_link(kind)} |
Kwpolska
Jun 16, 2017
Member
Is kind
present in /index.html?
Is kind
present in /index.html?
felixfontein
Jun 16, 2017
Author
Contributor
Yes, /index.html
is generated by the index
taxonomy.
Yes, /index.html
is generated by the index
taxonomy.
@@ -42,7 +42,7 @@ lang="${lang}"> | |||
% if meta_generator_tag: | |||
<meta name="generator" content="Nikola (getnikola.com)"> | |||
% endif | |||
${feeds_translations.head()} | |||
${feeds_translations.head(classification=None, kind=kind, other=False)} |
Kwpolska
Jun 16, 2017
Member
We shouldn’t use maybe-defined variables in every file. We should avoid undefined variables if possible.
We shouldn’t use maybe-defined variables in every file. We should avoid undefined variables if possible.
felixfontein
Jun 16, 2017
Author
Contributor
There was actually no need for using kind
, since classification
is set to None
. I've now set kind
to 'index'
, which generates the same result.
There was actually no need for using kind
, since classification
is set to None
. I've now set kind
to 'index'
, which generates the same result.
Thanks for doing this! |
Thanks for reviewing and merging! :) |
This completes some things missing in #2778:
hreflang
salso_create_classifications_from_other_languages
for tags and categories, and marking this option as deprecatedrss_link
overriding in tags, categories and some more taxonomies, which prevented correct translated RSS feed linkslist.tmpl
was used for a classification page(fixes #993; fixes #2785)