{% if page.noindex %}{% endif %} {% comment %}Use via `JEKYLL_ENV=production bundle exec jekyll serve`{% endcomment %} {% comment %}TODO: Since GCE, this does not do anything for staging. We dont have a staging ATM. We left the code to make it easier to add a staging later.{% endcomment %} {% if jekyll.environment == 'production' %} {% assign hostname = 'https://www.betterplace.org' %} {% assign style_host = 'https://www.betterplace.org' %} {% elsif jekyll.environment == 'staging' %} {% assign hostname = 'https://www.bp42.com' %} {% assign style_host = 'https://www.bp42.com' %} {% endif %} {% comment %}Avoid redirect loop. We cannot have URLs ending in "/" since we redirect those with 302. But our "/index.html" files are translated to "/" since page.url is "/" for index.html. This creates the loop for the facebook-debugger for example. Using this clean_page_url solves the problem for the "/index". For "//index" we have a different solution: we need to add a "permalink"-front-matter that has the same name as the folder, which also removes the trailing "/". Update 2019-07-19: Another problem that came us is, that URLs endet in .html which also caused a redirect loop. We solve this by removing the .html from the URL.{% endcomment %} {% capture clean_page_url %}{% if page.url == '/' %}#{% else %}{{ page.url | replace:'.html','' }}{% endif %}{% endcapture %} {{ page.title | default:'betterplace.org' }} {% if page.alternate_url %} {% for item in page.alternate_url %} {% endfor %} {% endif %} {% if page.canonical_url %} {% else %} {% comment %}So stellen wir sicher, dass wir nicht versehentlich eine content-LOREM.betterplace.org Domain im Index haben.{% endcomment %} {% endif %} {% comment %}Das content--theme legt die default.css für jedes repo ab. Nicht geil, aber OK.{% endcomment %} {% comment %}Für das Layout "landingpage" haben wir eine zusätzliche Datei {% endcomment %} {% if page.layout == 'landingpage' or page.layout == 'lpm-styleguide' %} {% endif %} {% if site._options.content.styles %} {% endif %} {{ page.head_include }}{{ site.head_include }}{{ layout.head_include }} {% include sharing.html sharing_host=hostname clean_page_url=clean_page_url %} {% if site.feed_meta_in_head %}{% feed_meta %}{% endif %} {% include schema_org_structured_data.html %} {% assign transparent_header = page.transparent_header | default: site.transparent_header %}
{% include subnavi-helper.html hostname=hostname %} {{ content }} {% capture other_lang %} {% if site.lang == 'de' %}English{% else %}Deutsch{% endif %} {% endcapture %} {% capture language_switch_content %} {% if page.alternate_url %} {% if site.translation_lang == 'de' %} {% if page.alternate_url contains 'de_DE' %} {% assign translation = 'de_DE' %} {% else %} {% assign translation = 'de' %} {% endif %} {% else %} {% assign translation = site.translation_lang %} {% endif %} {{ other_lang }} {% else %} {{ other_lang }} {% endif %} {% endcapture %} {% capture footer %} {% include footer-{{ site.lang }}.html hostname=hostname %} {% endcapture %} {{ footer | replace_first:'',language_switch_content }} {% include cookie_banner.html %}