-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add basic English intro #58
base: master
Are you sure you want to change the base?
Changes from 1 commit
e366fe2
b161b5b
dfc0976
a947b55
73d4020
8d248c1
302b368
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,19 +12,27 @@ | |
<script src="/leaflet/leaflet.js"></script> | ||
<script src="/js/turbolinks.js"></script> | ||
<link rel="shortcut icon" href="/img/favicon.ico"> | ||
{% assign base = '' %} | ||
{% if page.lang != "de" %} | ||
{% assign base = "/" | append: page.lang | append: "/" %} | ||
{% endif %} | ||
</head> | ||
<body lang="de"> | ||
|
||
<div class="site"> | ||
<div class="menu_scroll_wrapper"><div class="menu"> | ||
<a {% if page.url == "/index.html" %} class="active" {% endif %} href="/">tl;dr</a> | ||
<a {% if page.url == "/howtotreff.html" %} class="active" {% endif %} href="/howtotreff.html">Treff</a> | ||
<a {% if page.url == "/chaotische_viertelstunde.html" %} class="active" {% endif %} href="/chaotische_viertelstunde.html?latest={{ page.vortraege_latest }}">c¼h</a> | ||
<a {% if page.url == "/verein.html" %} class="active" {% endif %} href="/verein.html">Verein</a> | ||
<a {% if page.url == "/kontakt.html" %} class="active" {% endif %} href="/kontakt.html">Kontakt</a> | ||
<a {% if page.url == "{{base}}index.html" %} class="active" {% endif %} href="{{base}}index.html">tl;dr</a> | ||
<a {% if page.url == "{{base}}howtotreff.html" %} class="active" {% endif %} href="{{base}}howtotreff.html">Treff</a> | ||
<a {% if page.url == "{{base}}chaotische_viertelstunde.html" %} class="active" {% endif %} href="{{base}}chaotische_viertelstunde.html?latest={{ page.vortraege_latest }}">c¼h</a> | ||
<a {% if page.url == "{{base}}verein.html" %} class="active" {% endif %} href="{{base}}verein.html">Verein</a> | ||
<a {% if page.url == "{{base}}kontakt.html" %} class="active" {% endif %} href="{{base}}kontakt.html">Kontakt</a> | ||
<a data-no-turbolink href="https://www.noname-ev.de/w/">Wiki</a> | ||
<a {% if page.url == "/cryptoparty.html" %} class="active" {% endif %} href="/cryptoparty.html">Cryptoparty</a> | ||
<a {% if page.url == "/en/intro.html" %} class="active" {% endif %} href="/en/intro.html" lang="en">English</a> | ||
<a {% if page.url == "{{base}}cryptoparty.html" %} class="active" {% endif %} href="{{base}}cryptoparty.html">Cryptoparty</a> | ||
{% if page.lang == "de" %} | ||
<a href="{{ 'en/' | append: page.url | replace: '//','/' }}" lang="en">English</a> | ||
{% else %} | ||
<a href="{{ page.url | replace: 'en/','' }}" lang="de">Deutsch</a> | ||
{% endif %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still unhappy about having this in the navigation… Can't it be in the sidebar? Or… anywhere else? :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and this will still break the navbar layout. This issue have to be fixed first (ref #55). |
||
</div></div> | ||
|
||
<div class="cont"> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# encoding: utf-8 | ||
|
||
|
||
|
||
module Jekyll | ||
class LangPolyfill < Generator | ||
priority :high | ||
|
||
def generate(site) | ||
fakes = site.pages.map do |p| | ||
next if p.data['lang'] != 'de' | ||
next if File.exist?("en/#{p.name}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't that be |
||
|
||
copy = p.dup | ||
copy.data['lang'] = 'en' | ||
copy.process("en/#{copy.name}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
copy.data['title'] << " (untranslated, sorry)" | ||
|
||
notice = <<~NOTICE | ||
# Translation missing | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
Sorry, unfortunately the current page has not been translated yet. [Maybe an | ||
automated translation suffices](https://translate.google.com/translate?hl=en&sl=de&tl=en&u=#{site.config['url']}#{copy.url})? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only link |
||
NOTICE | ||
copy.content = "#{notice}\n\n#{copy.content}" | ||
|
||
copy | ||
end.compact | ||
|
||
site.pages += fakes | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either
assign base = "/"
above, or leave out the first"/"
here. It should either be"/"
and"/en/"
, or""
and"en/"
(I believe the former, so links are interpreted correctly as domain-relative when in a deeper path).