84 lines
3.7 KiB
PHP
84 lines
3.7 KiB
PHP
<?php
|
|
|
|
/* partials/langswitcher.hreflang.html.twig */
|
|
class __TwigTemplate_daeaea00a1561c15d372f5796dd835964a7cd23bcf7754a0d18da9b5ca184604 extends Twig_Template
|
|
{
|
|
public function __construct(Twig_Environment $env)
|
|
{
|
|
parent::__construct($env);
|
|
|
|
$this->parent = false;
|
|
|
|
$this->blocks = array(
|
|
);
|
|
}
|
|
|
|
protected function doDisplay(array $context, array $blocks = array())
|
|
{
|
|
// line 1
|
|
$context["langobj"] = $this->getAttribute(($context["grav"] ?? null), "language", array(), "array");
|
|
// line 2
|
|
$context['_parent'] = $context;
|
|
$context['_seq'] = twig_ensure_traversable($this->getAttribute(($context["langswitcher"] ?? null), "languages", array()));
|
|
foreach ($context['_seq'] as $context["_key"] => $context["key"]) {
|
|
// line 3
|
|
if (($context["key"] == $this->getAttribute(($context["langswitcher"] ?? null), "current", array()))) {
|
|
// line 4
|
|
echo "\t";
|
|
$context["lang_url"] = $this->getAttribute(($context["page"] ?? null), "url", array());
|
|
} else {
|
|
// line 6
|
|
echo "\t";
|
|
$context["lang_url"] = (((((($context["base_url_simple"] ?? null) . $this->getAttribute(($context["langobj"] ?? null), "getLanguageURLPrefix", array(0 => $context["key"]), "method")) . $this->getAttribute(($context["langswitcher"] ?? null), "page_route", array())) . $this->getAttribute(($context["page"] ?? null), "urlExtension", array()))) ? ((((($context["base_url_simple"] ?? null) . $this->getAttribute(($context["langobj"] ?? null), "getLanguageURLPrefix", array(0 => $context["key"]), "method")) . $this->getAttribute(($context["langswitcher"] ?? null), "page_route", array())) . $this->getAttribute(($context["page"] ?? null), "urlExtension", array()))) : ("/"));
|
|
}
|
|
// line 8
|
|
echo "<link rel=\"alternate\" hreflang=\"";
|
|
echo $context["key"];
|
|
echo "\" href=\"";
|
|
echo (($context["lang_url"] ?? null) . $this->getAttribute(($context["uri"] ?? null), "params", array()));
|
|
echo "\" />
|
|
";
|
|
}
|
|
$_parent = $context['_parent'];
|
|
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['key'], $context['_parent'], $context['loop']);
|
|
$context = array_intersect_key($context, $_parent) + $_parent;
|
|
}
|
|
|
|
public function getTemplateName()
|
|
{
|
|
return "partials/langswitcher.hreflang.html.twig";
|
|
}
|
|
|
|
public function isTraitable()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public function getDebugInfo()
|
|
{
|
|
return array ( 35 => 8, 31 => 6, 27 => 4, 25 => 3, 21 => 2, 19 => 1,);
|
|
}
|
|
|
|
/** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
|
|
public function getSource()
|
|
{
|
|
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
|
|
|
|
return $this->getSourceContext()->getCode();
|
|
}
|
|
|
|
public function getSourceContext()
|
|
{
|
|
return new Twig_Source("{% set langobj = grav['language'] %}
|
|
{% for key in langswitcher.languages %}
|
|
{% if key == langswitcher.current %}
|
|
\t{% set lang_url = page.url %}
|
|
{% else %}
|
|
\t{% set lang_url = base_url_simple ~ langobj.getLanguageURLPrefix(key) ~ langswitcher.page_route ~ page.urlExtension ?: '/' %}
|
|
{% endif %}
|
|
<link rel=\"alternate\" hreflang=\"{{ key }}\" href=\"{{ lang_url ~ uri.params }}\" />
|
|
{% endfor %}
|
|
", "partials/langswitcher.hreflang.html.twig", "/home/kevin/Sites/static-ethica.net/user/plugins/langswitcher/templates/partials/langswitcher.hreflang.html.twig");
|
|
}
|
|
}
|