432c6f1e39fa917e282dcd5ff6e1d2bb86c775443f1df2c79809c205ab6635ed.php 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /* partials/langswitcher.hreflang.html.twig */
  3. class __TwigTemplate_daeaea00a1561c15d372f5796dd835964a7cd23bcf7754a0d18da9b5ca184604 extends Twig_Template
  4. {
  5. public function __construct(Twig_Environment $env)
  6. {
  7. parent::__construct($env);
  8. $this->parent = false;
  9. $this->blocks = array(
  10. );
  11. }
  12. protected function doDisplay(array $context, array $blocks = array())
  13. {
  14. // line 1
  15. $context["langobj"] = $this->getAttribute(($context["grav"] ?? null), "language", array(), "array");
  16. // line 2
  17. $context['_parent'] = $context;
  18. $context['_seq'] = twig_ensure_traversable($this->getAttribute(($context["langswitcher"] ?? null), "languages", array()));
  19. foreach ($context['_seq'] as $context["_key"] => $context["key"]) {
  20. // line 3
  21. if (($context["key"] == $this->getAttribute(($context["langswitcher"] ?? null), "current", array()))) {
  22. // line 4
  23. echo "\t";
  24. $context["lang_url"] = $this->getAttribute(($context["page"] ?? null), "url", array());
  25. } else {
  26. // line 6
  27. echo "\t";
  28. $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()))) : ("/"));
  29. }
  30. // line 8
  31. echo "<link rel=\"alternate\" hreflang=\"";
  32. echo $context["key"];
  33. echo "\" href=\"";
  34. echo (($context["lang_url"] ?? null) . $this->getAttribute(($context["uri"] ?? null), "params", array()));
  35. echo "\" />
  36. ";
  37. }
  38. $_parent = $context['_parent'];
  39. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['key'], $context['_parent'], $context['loop']);
  40. $context = array_intersect_key($context, $_parent) + $_parent;
  41. }
  42. public function getTemplateName()
  43. {
  44. return "partials/langswitcher.hreflang.html.twig";
  45. }
  46. public function isTraitable()
  47. {
  48. return false;
  49. }
  50. public function getDebugInfo()
  51. {
  52. return array ( 35 => 8, 31 => 6, 27 => 4, 25 => 3, 21 => 2, 19 => 1,);
  53. }
  54. /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
  55. public function getSource()
  56. {
  57. @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
  58. return $this->getSourceContext()->getCode();
  59. }
  60. public function getSourceContext()
  61. {
  62. return new Twig_Source("{% set langobj = grav['language'] %}
  63. {% for key in langswitcher.languages %}
  64. {% if key == langswitcher.current %}
  65. \t{% set lang_url = page.url %}
  66. {% else %}
  67. \t{% set lang_url = base_url_simple ~ langobj.getLanguageURLPrefix(key) ~ langswitcher.page_route ~ page.urlExtension ?: '/' %}
  68. {% endif %}
  69. <link rel=\"alternate\" hreflang=\"{{ key }}\" href=\"{{ lang_url ~ uri.params }}\" />
  70. {% endfor %}
  71. ", "partials/langswitcher.hreflang.html.twig", "/home/kevin/Sites/static-ethica.net/user/plugins/langswitcher/templates/partials/langswitcher.hreflang.html.twig");
  72. }
  73. }