hreflang rel=alternate is not implemented for galleries and tags #993

Open
Kwpolska opened this Issue Jan 22, 2014 · 7 comments

Projects

None yet

3 participants

Owner

cc @Aeyoun.

I did something very dumb. I misunderstood how _link works in our templates, thus leading to a big failure for people with localized sites (like @smartass101). Long story short:

########################################
TaskError - taskid:render_galleries:output/galleries/index.html
PythonAction Error
Traceback (most recent call last):
  File "/home/kwpolska/virtualenvs/nikola-py2/lib/python2.7/site-packages/doit/action.py", line 360, in execute
    returned_value = self.py_callable(*self.args, **kwargs)
  File "/home/kwpolska/git/nikola/nikola/plugins/task/galleries.py", line 466, in render_gallery_index
    self.site.render_template(template_name, output_name, context)
  File "/home/kwpolska/git/nikola/scripts/../nikola/nikola.py", line 607, in render_template
    template_name, None, local_context)
  File "/home/kwpolska/git/nikola/nikola/plugins/template/mako.py", line 88, in render_template
    data = template.render_unicode(**context)
  File "/home/kwpolska/virtualenvs/nikola-py2/lib/python2.7/site-packages/mako/template.py", line 452, in render_unicode
    as_unicode=True)
  File "/home/kwpolska/virtualenvs/nikola-py2/lib/python2.7/site-packages/mako/runtime.py", line 807, in _render
    **_kwargs_for_callable(callable_, data))
  File "/home/kwpolska/virtualenvs/nikola-py2/lib/python2.7/site-packages/mako/runtime.py", line 839, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/home/kwpolska/virtualenvs/nikola-py2/lib/python2.7/site-packages/mako/runtime.py", line 865, in _exec_template
    callable_(context, *args, **kwargs)
  File "/home/kwpolska/Desktop/nikola-translated-path/cache/.mako.tmp/base.tmpl.py", line 91, in render_body
    __M_writer(unicode(base.meta_translations()))
  File "/home/kwpolska/Desktop/nikola-translated-path/cache/.mako.tmp/base_helper.tmpl.py", line 274, in render_meta_translations
    __M_writer(unicode(_link(permalink, None, langname)))
  File "/home/kwpolska/git/nikola/scripts/../nikola/nikola.py", line 765, in link
    return self.path(*args, is_link=True)
  File "/home/kwpolska/git/nikola/scripts/../nikola/nikola.py", line 729, in path
    path = self.path_handlers[kind](name, lang)
KeyError: u'/galleries/galleries/index.html'

I tried to use permalink as the first argument to _link. That doesn’t work, we need to do more checking. Thus, the feature is currently removed. We need to find a better way.

@Kwpolska Kwpolska added a commit that referenced this issue Jan 22, 2014
@Kwpolska Kwpolska Revert "fix #988 — add <link>s to translations"
Via #993.

This reverts commit f098fc3.
977bb8f
Contributor
da2x commented Jan 22, 2014

@Kwpolska but it should still work for posts? Maybe include it in post_helper instead

@Kwpolska Kwpolska added a commit that referenced this issue Jan 22, 2014
@Kwpolska Kwpolska add hreflang rel=alternate for posts (#993)
Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
9f2d691
Owner

@Aeyoun done. That’s a good compromise already. I might even try to do it for other things…

Owner
ralsina commented Jan 27, 2014

So, what about this issue? Is it still broken? Is it fixable?

Owner

It could be done for galleries or tags.

@ralsina ralsina modified the milestone: v6.5.0, v6.4.0 Feb 26, 2014
@ralsina ralsina modified the milestone: v7.0.0, v6.5.0 Mar 22, 2014
@Kwpolska Kwpolska added the minor label May 16, 2014
@Kwpolska Kwpolska modified the milestone: Whenever, v7.0.0 May 16, 2014
Owner
ralsina commented May 11, 2015

I don't quite understand what this bug is... is it about adding links to translated RSS feeds to tags and gallery pages?

Owner

It’s about adding this:

<link rel="alternate" hreflang="es" href="/es/categories/foo.html">

to /categories/foo.html (and also other languages, tags and galleries)

Owner
ralsina commented May 12, 2015

Ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment