diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/base.html | 234 | ||||
-rw-r--r-- | templates/food_archive.html | 42 | ||||
-rw-r--r-- | templates/index.html | 156 | ||||
-rw-r--r-- | templates/page.html | 52 | ||||
-rw-r--r-- | templates/weblog.html | 120 | ||||
-rw-r--r-- | templates/weblog_archive.html | 42 |
6 files changed, 466 insertions, 180 deletions
diff --git a/templates/base.html b/templates/base.html index d8f27ba..010677b 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,83 +1,165 @@ <!DOCTYPE html> {% set permalink = "/weblog/" %} {% if section %} - {% set permalink = section.permalink %} + {% set permalink = section.permalink %} {% elif page %} - {% set permalink = page.permalink %} + {% set permalink = page.permalink %} {% endif %} <html> - <head> - <meta charset="utf-8"> - <meta content="width=device-width, initial-scale=1" name="viewport"> - <title> - {% block title %} - {{ config.title }} - {% endblock %} - </title> - <link rel="stylesheet" href="{{ get_url(path="css/yaroslavps.css") }}"> - <link rel="icon" type="image/png" href="{{ get_url(path="favicon32x32.png") }}"> - <link rel="icon" type="image/png" href="{{ get_url(path="favicon64x64.png") }}"> - {% block extrahead %} - {% endblock %} - </head> - <body> - <div class="main-container"> - {% block page %} - <div class="header-container"> - {% block header %} - <h1><a href="/">Yaroslav de la Peña Smirnov</a></h1> - {% endblock %} - </div> - <div class="content-container"> - {% block content %} - {% endblock %} - </div> - <div class="sidebar-container"> - <div class="sticky-wrapper"> - {% block sbdesc %} - {% if permalink is containing("weblog") %} - <p>Hello, my name is Yaroslav de la Peña Smirnov, welcome to my weblog. - Sometimes I write software, sometimes I might write my mind here. </p> - {% elif permalink is containing("food") %} - <p>Here I keep some of the recipes for food that I cook. Nothing really - special in here, just food that I find delicious, and generally not very - expensive nor time consuming to cook.</p> - {% endif %} - {% endblock %} - <div class="links-container"> - <a href="https://github.com/Yaroslav-95" title="GitHub"> - <span class="icon"><img src="/svg/icons/github.svg"/></span> - </a> - <a href="https://git.yaroslavps.com/" title="Git server"> - <span class="icon"><img src="/svg/icons/git.svg"/></span> - </a> - </div> - <h3>Navigation</h3> - <ul class="navigation-list"> - <li><a href="/">Landing page</a></li> - <li><a href="/weblog/">Weblog</a> - <ul> - <li><a href="/weblog/archive/">Archive</a></li> - </ul> - </li> - <li><a href="/food/">Recipe book</a> - <ul> - <li><a href="/food/archive/">Archive</a></li> - </ul> - </li> - </ul> - <h3>RSS Feeds</h3> - <ul class="rss-list"> - <li><a href="/weblog/feed.xml">Weblog RSS</a></li> - <li><a href="/food/feed.xml">Recipe book RSS</a></li> - </ul> - <h3>Email</h3> - <a href="mailto:yps@yaroslavps.com">yps@yaroslavps.com</a> - <h3>PGP</h3> - <a href="https://www.yaroslavps.com/files/yaroslavpub.gpg">BD900E5D624046DC</a> - </div> - </div> - {% endblock %} - </div> - </body> + <head> + <meta charset="utf-8"> + <meta content="width=device-width, initial-scale=1" name="viewport"> + <title> + {% block title %} + {{ config.title }} + {% endblock %} + </title> + <link rel="stylesheet" href="{{ get_url(path="css/yaroslavps.css") }}"> + <link rel="icon" type="image/png" href="{{ get_url(path="favicon32x32.png") }}"> + <link rel="icon" type="image/png" href="{{ get_url(path="favicon64x64.png") }}"> + {% block extrahead %} + {% endblock %} + </head> + <body> + <div class="main-container"> + {% block page %} + <div class="header-container"> + {% block header %} + <h1><a href="/">Yaroslav de la Peña Smirnov</a></h1> + {% endblock %} + </div> + <div class="content-container"> + {% block content %} + {% endblock %} + </div> + <div class="sidebar-container"> + <div class="sticky-wrapper"> + <h3> + {% if lang == "ru" %} + Навигация + {% elif lang == "es" %} + En este sitio + {% else %} + Navigation + {% endif %} + </h3> + <ul class="navigation-list"> + <li> + {% if lang == "ru" %} + <a href="/ru/">Главная</a> + {% elif lang == "es" %} + <a href="/es/">Inicio</a> + {% else %} + <a href="/">Home page</a> + {% endif %} + <ul> + {% if lang != "en" %} + <li><a href="/">English</a></li> + {% endif %} + {% if lang != "es" %} + <li><a href="/es/">Español</a></li> + {% endif %} + {% if lang != "ru" %} + <li><a href="/ru/">Русский</a></li> + {% endif %} + </ul> + </li> + <li> + {% if lang == "ru" %} + <a href="/ru/weblog/">Веб-журнал</a> + {% elif lang == "es" %} + <a href="/es/weblog/">Weblog</a> + {% else %} + <a href="/weblog/">Weblog</a> + {% endif %} + <ul> + <li> + {% if lang == "ru" %} + <a href="/ru/weblog/archive/">Архив</a> + {% elif lang == "es" %} + <a href="/es/weblog/archive/">Archivo</a> + {% else %} + <a href="/weblog/archive/">Archive</a> + {% endif %} + </li> + </ul> + </li> + <li> + {% if lang == "ru" %} + <a href="/ru/food/">Книга рецептов</a> + {% elif lang == "es" %} + <a href="/es/food/">Recetario</a> + {% else %} + <a href="/food/">Recipe book</a> + {% endif %} + <ul> + <li> + {% if lang == "ru" %} + <a href="/ru/food/archive/">Архив</a> + {% elif lang == "es" %} + <a href="/es/food/archive/">Archivo</a> + {% else %} + <a href="/food/archive/">Archive</a> + {% endif %} + </li> + </ul> + </li> + </ul> + <h3> + {% if lang == "ru" %} + RSS-лента + {% elif lang == "es" %} + RSS + {% else %} + RSS feeds + {% endif %} + </h3> + <ul class="rss-list"> + <li> + {% if lang == "ru" %} + <a href="/ru/weblog/feed.xml">RSS веб-журнала</a> + {% elif lang == "es" %} + <a href="/es/weblog/feed.xml">RSS del weblog</a> + {% else %} + <a href="/weblog/feed.xml">Weblog RSS</a> + {% endif %} + </li> + <li> + {% if lang == "ru" %} + <a href="/ru/food/feed.xml">RSS книги рецептов</a> + {% elif lang == "es" %} + <a href="/es/food/feed.xml">RSS del recetario</a> + {% else %} + <a href="/food/feed.xml">Recipe book RSS</a> + {% endif %} + </li> + </ul> + <h3>Email</h3> + <a href="mailto:yps@yaroslavps.com">yps@yaroslavps.com</a> + <h3>PGP</h3> + <a href="https://www.yaroslavps.com/files/yaroslavpub.gpg"> + BD900E5D624046DC + </a> + <h3> + {% if lang == "ru" %} + Другие ссылки + {% elif lang == "es" %} + Otros vínculos + {% else %} + Other stuff + {% endif %} + </h3> + <div class="links-container"> + <a href="https://github.com/Yaroslav-95" title="GitHub"> + <span class="icon"><img src="/svg/icons/github.svg"/></span> + </a> + <a href="https://git.yaroslavps.com/" title="Git server"> + <span class="icon"><img src="/svg/icons/git.svg"/></span> + </a> + </div> + </div> + </div> + {% endblock %} + </div> + </body> </html> diff --git a/templates/food_archive.html b/templates/food_archive.html index b298815..e8dab8e 100644 --- a/templates/food_archive.html +++ b/templates/food_archive.html @@ -1,20 +1,42 @@ {% extends "base.html" %} {% block title %} +{% if lang == "ru" %} +Архив рецептов - Книга рецептов Ярослава +{% elif lang == "es" %} +Archivo del recetario - Recetario de Yaroslav +{% else %} Recipe archive - Yaroslav's recipe book +{% endif %} {% endblock %} {% block header %} -<h1>Yaroslav's recipe archive</h1> +<h1> + {% if lang == "ru" %} + Архив рецептов Ярослава + {% elif lang == "es" %} + Archivo del recetario de Yaroslav + {% else %} + Yaroslav's recipe archive + {% endif %} +</h1> {% endblock %} {% block content %} -{% set section = get_section(path="food/_index.md") %} +{% if lang != "en" %} +{% set section_path = "food/_index." ~ lang ~ ".md" %} +{% else %} +{% set section_path = "food/_index.md" %} +{% endif %} +{% set section = get_section(path=section_path) %} <div class="post-container"> - {% for year, posts in section.pages | group_by(attribute="year") %} - <h2>{{ year }}</h2> - <ul> - {% for post in posts %} - <li><span class="publish-date">{{ post.date | date }}</span> - <a href="{{ post.permalink }}">{{ post.title }}</a></li> - {% endfor %} - </ul> - {% endfor %} + {% for year, posts in section.pages | group_by(attribute="year") %} + <h2>{{ year }}</h2> + <ul> + {% for post in posts %} + <li> + <span class="publish-date">{{ post.date | date }}</span> - + <a href="{{ post.permalink }}">{{ post.title }}</a> + </li> + {% endfor %} + </ul> + {% endfor %} </div> {% endblock %} diff --git a/templates/index.html b/templates/index.html index 6af40ef..8928880 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,34 +1,128 @@ {% extends "base.html" %} {% block page %} - <div class="landing-page-container"> - <h1>Yaroslav de la Peña Smirnov</h1> - <div class="links-container"> - <a href="/weblog">Weblog</a> - <a href="/food">Recipe book</a> - </div> - <div class="links-container"> - <a href="https://github.com/Yaroslav-95" title="GitHub"> - <span class="icon"><img src="/svg/icons/github.svg"/></span> - </a> - <a href="https://git.yaroslavps.com/" title="Git server"> - <span class="icon"><img src="/svg/icons/git.svg"/></span> - </a> - </div> - <p>Welcome, my name is Yaroslav de la Peña Smirnov. I keep this site to - sometimes write about what I do or think on my weblog, or to remind myself - of how to do certain things. You can take a look around, maybe you'll find - something interesting or useful.</p> - <h2>Getting in contact</h2> - <p>If you want to contact me, you can do so by email at: - <a href="mailto:yps@yaroslavps.com">yps@yaroslavps.com</a> - </p> - <p>Public PGP key: <a href="https://www.yaroslavps.com/files/yaroslavpub.gpg">BD900E5D624046DC</a></p> - <h2>RSS feeds</h2> - <p>If you are interested in following what I may publish here (however often it - may be), you can add these RSS/Atom urls to your favorite RSS reader:</p> - <pre class="rss-links-list"> - https://www.yaroslavps.com/weblog/feed.xml - https://www.yaroslavps.com/food/feed.xml - </pre> - </div> + <div class="landing-page-container"> + <h1>{{ trans(key="full_name", lang=lang) }}</h1> + <div class="links-container"> + {% if lang == "ru" %} + <a href="/ru/weblog">Веб-журнал</a> + <a href="/ru/food">Книга рецептов</a> + {% elif lang == "es" %} + <a href="/es/weblog">Weblog</a> + <a href="/es/food">Recetario</a> + {% else %} + <a href="/weblog">Weblog</a> + <a href="/food">Recipe book</a> + {% endif %} + </div> + <div class="links-container"> + <a href="https://github.com/Yaroslav-95" title="GitHub"> + <span class="icon"><img src="/svg/icons/github.svg"/></span> + </a> + <a href="https://git.yaroslavps.com/" title="Git server"> + <span class="icon"><img src="/svg/icons/git.svg"/></span> + </a> + </div> + <p> + {% if lang == "ru" %} + Здравствуйте! Меня зовут Ярослав и это мой сайт. Здесь я пишу о том что + я думаю или делаю, или чтобы напомнить себе как что-то делать, будь это + настроить сервер или приготовить блюдо. Возможно вы найдёте что-нибудь + интересного. Большая часть того что я пишу, на + <a href="/">английском</a>. Но, бывает иногда пишу или перевожу то, что + пишу, на русский и/или <a href="/es/">испанский</a> языки. + {% elif lang == "es" %} + Buenas y bienvenidos sean. Mi nombre es Yaroslav y éste es mi sitio. + Aquí escribo lo que pienso o hago, o simplemente para acordarme luego de + como hacer ciertas cosas, sea configurar un servidor, o cocinar una + receta. Echa una mirada, a lo mejor encuentras algo interestante o útil. + Escribo en su mayoría en <a href="/">inglés</a>, pero a veces también + escribo o traduzco lo que escribo al español y/o al + <a href="/">ruso</a>. + {% else %} + Welcome, my name is Yaroslav. I keep this site to sometimes write about + what I do or think on my weblog, or to remind myself of how to do + certain things, be it set up a server or how to make some dishes. You + can take a look around, maybe you'll find something interesting or + useful. Most of the time I write in English, but sometimes I might also + write or translate what I write in <a href="/es/">Spanish</a> or + <a href="/ru/">Russian</a>. + {% endif %} + </p> + <h2> + {% if lang == "ru" %} + Связаться + {% elif lang == "es" %} + Contacto + {% else %} + Getting in contact + {% endif %} + </h2> + <p> + {% if lang == "ru" %} + Связаться со мной можно по электронной почты: + {% elif lang == "es" %} + Si quieres contactarme, puedes enviarme un correo electrónico a la + siguiente dirección: + {% else %} + If you want to contact me, you can do so by email at: + {% endif %} + <a href="mailto:yps@yaroslavps.com">yps@yaroslavps.com</a> + </p> + <p> + {% if lang == "ru" %} + Если вы пользуетесь такими сервисами как gmail, mail.ru или другими + крупными провайдерами из этого разряда, то мой ответ может попасть в + спам. Если вы хотите быть полностью уверенными что вы получите мой + ответ, добавьте мой адрес в свой белый список. + {% elif lang == "es" %} + Una pequeña nota para aquellos que usan servicios como gmail, + outlook u otros proveedores similares. Mi respuesta de email puede + llegar a su bandeja de espam. Si quieres estar completamente seguro + de recibir mi respuesta, agrega mi dirección a tu lista blanca. + {% else %} + A little note for those using services like gmail, outlook, or any + other big provider like that. My email response might end up in your + spam folder, so you might want to check that. If you want to make + 100% sure to receive my reponse, the best option is to add my + address to your whitelist. + {% endif %} + </p> + <p> + {% if lang == "ru" %} + Публичный PGP-ключ: + {% elif lang == "es" %} + Llave pública de PGP: + {% else %} + Public PGP key: + {% endif %} + <a href="https://www.yaroslavps.com/files/yaroslavpub.gpg">BD900E5D624046DC</a> + </p> + <h2>RSS feeds</h2> + <p> + {% if lang == "ru" %} + Если вам хочеться следить за тем что я здесь публикую, вы можете + добавить эти RSS/Atom-ссылки в свой любимый RSS-ридер: + {% elif lang == "es" %} + Si te interesa estar al tanto de lo que publico aquí, cuan seguido + yo publique, puedes agregar estas direcciones de RSS/Atom a tu + lector RSS de preferencia: + {% else %} + If you are interested in following what I may publish here (however + often it may be), you can add these RSS/Atom urls to your favorite + RSS reader: + {% endif %} + </p> + <pre class="rss-links-list"> + {% if lang == "ru" %} +https://www.yaroslavps.com/ru/weblog/feed.xml +https://www.yaroslavps.com/ru/food/feed.xml + {% elif lang == "es" %} +https://www.yaroslavps.com/es/weblog/feed.xml +https://www.yaroslavps.com/es/food/feed.xml + {% else %} +https://www.yaroslavps.com/weblog/feed.xml +https://www.yaroslavps.com/food/feed.xml + {% endif %} + </pre> + </div> {% endblock %} diff --git a/templates/page.html b/templates/page.html index a442437..06dca0b 100644 --- a/templates/page.html +++ b/templates/page.html @@ -9,18 +9,46 @@ {% endif %} {% endblock %} {% block header %} - <h1>{{ page.title }}</h1> - <p class="publish-date">Published {{ page.date | date(format="%b %d, %Y - %H:%M UTC") }} on - {% if page.permalink is containing("weblog") %} - <a href="/weblog">Yaroslav's weblog</a></p> - {% elif page.permalink is containing("food") %} - <a href="/food">Yaroslav's recipe book</a></p> - {% endif %} - {% if page.updated %} - <p class="publish-date">Last edited {{ page.updated | date(format="%b %d, %Y - %H:%M UTC") }}</p> - {% endif %} +<h1>{{ page.title }}</h1> +<p class="publish-date"> + {{ trans(key="published", lang=lang) }} + {{ page.date | date(format="%Y-%m-%d %H:%M UTC") }} + {{ trans(key="published_on", lang=lang) }} + {% if page.permalink is containing("weblog") %} + <a href="{% if lang != "en" %}/{{ lang }}{% endif %}/weblog"> + {{ trans(key="weblog_title", lang=lang) }} + </a> + {% elif page.permalink is containing("food") %} + <a href="{% if lang != "en" %}/{{ lang }}{% endif %}/food"> + {{ trans(key="recipes_title", lang=lang) }} + </a></p> + {% endif %} +</p> +{% if page.updated %} +<p class="publish-date"> + {{ trans(key="edited", lang=lang) }} + {{ page.updated | date(format="%Y-%m-%d %H:%M UTC") }} +</p> +{% endif %} +{% if page.translations | length > 1 %} +{% for trans in page.translations %} +{% if trans.lang != lang %} +{% if trans.lang == "ru" %} +<p class="publish-date"> + Доступно на русском: <a href="{{ trans.permalink }}">{{ trans.title }}</a> +</p> +{% elif trans.lang == "es" %} +<p class="publish-date"> + Disponible en español: <a href="{{ trans.permalink }}">{{ trans.title }}</a> +</p> +{% else %} +<p class="publish-date"> + Available in English: <a href="{{ trans.permalink }}">{{ trans.title }}</a> +</p> +{% endif %} +{% endif %} +{% endfor %} +{% endif %} {% endblock %} {% block content %} <div class="post-container"> diff --git a/templates/weblog.html b/templates/weblog.html index 253f79e..f9889af 100644 --- a/templates/weblog.html +++ b/templates/weblog.html @@ -1,48 +1,86 @@ {% extends "base.html" %} {% block title %} - {% if section.permalink is containing("weblog") %} - A weblog by Yaroslav de la Peña Smirnov - {% elif section.permalink is containing("food") %} - A collection of recipes by Yaroslav de la Peña Smirnov - {% else %} - A website by Yaroslav de la Peña Smirnov - {% endif %} + {% if section.permalink is containing("weblog") %} + {% if lang == "ru" %} + Веб-журнал Ярослава де ла Пенья Смирнова + {% elif lang == "es" %} + Un Weblog escrito por Yaroslav de la Peña Smirnov + {% else %} + A weblog by Yaroslav de la Peña Smirnov + {% endif %} + {% elif section.permalink is containing("food") %} + {% if lang == "ru" %} + Сборник рецептов Ярослава де ла Пенья Смирнова + {% elif lang == "es" %} + Una colección de recetas por Yaroslav de la Peña Smirnov + {% else %} + A collection of recipes by Yaroslav de la Peña Smirnov + {% endif %} + {% else %} + A website by Yaroslav de la Peña Smirnov + {% endif %} {% endblock %} {% block header %} - {% if section.permalink is containing("weblog") %} - <h1>Yaroslav's weblog</h1> - {% elif section.permalink is containing("food") %} - <h1>Yaroslav's recipe book</h1> - {% else %} - <h1>Yaroslav's website</h1> - {% endif %} + {% if section.permalink is containing("weblog") %} + <h1> + {% if lang == "ru" %} + Веб-журнал Ярослава + {% elif lang == "es" %} + Weblog de Yaroslav + {% else %} + Yaroslav's weblog + {% endif %} + </h1> + {% elif section.permalink is containing("food") %} + <h1> + {% if lang == "ru" %} + Книга рецептов Ярослава + {% elif lang == "es" %} + Recetario de Yaroslav + {% else %} + Yaroslav's recipe book + {% endif %} + </h1> + {% else %} + <h1>Yaroslav's website</h1> + {% endif %} {% endblock %} {% block content %} -<div class="posts-list"> - {% for post in paginator.pages %} - <div class="post-container"> - <h2> - <a href="{{ post.permalink }}">{{ post.title }}</a> - <span class="publish-date">{{ post.date | date }}</span> - </h2> - {% if post.summary %} - {{ post.summary | safe }} - {% endif %} - </div> - {% endfor %} -</div> -{% if paginator %} - {% if paginator.number_pagers > 1 %} - <div class="paginator"> - {% if paginator.previous %} - <a href="{{ paginator.first }}"><span class="icon">|←</span> First</a> - <a href="{{ paginator.previous }}"><span class="icon">←</span> Page {{ paginator.current_index - 1 }}</a> - {% endif %} - {% if paginator.next %} - <a href="{{ paginator.next }}">Page {{ paginator.current_index + 1 }} <span class="icon">→</span></a> - <a href="{{ paginator.last }}">Last <span class="icon">→|</span></a> - {% endif %} - </div> - {% endif %} -{% endif %} + <div class="posts-list"> + {% for post in paginator.pages %} + <div class="post-container"> + <h2> + <a href="{{ post.permalink }}">{{ post.title }}</a> + <span class="publish-date">{{ post.date | date }}</span> + </h2> + {% if post.summary %} + {{ post.summary | safe }} + {% endif %} + </div> + {% endfor %} + </div> + {% if paginator %} + {% if paginator.number_pagers > 1 %} + <div class="paginator"> + {% if paginator.previous %} + <a href="{{ paginator.first }}"> + <span class="icon">|←</span> First + </a> + <a href="{{ paginator.previous }}"> + <span class="icon">←</span> Page + {{ paginator.current_index - 1 }} + </a> + {% endif %} + {% if paginator.next %} + <a href="{{ paginator.next }}"> + Page {{ paginator.current_index + 1 }} + <span class="icon">→</span> + </a> + <a href="{{ paginator.last }}"> + Last <span class="icon">→|</span> + </a> + {% endif %} + </div> + {% endif %} + {% endif %} {% endblock %} diff --git a/templates/weblog_archive.html b/templates/weblog_archive.html index cd507ba..74613e4 100644 --- a/templates/weblog_archive.html +++ b/templates/weblog_archive.html @@ -1,20 +1,42 @@ {% extends "base.html" %} {% block title %} +{% if lang == "ru" %} +Архив веб-журнала - Веб-журнал Ярослава +{% elif lang == "es" %} +Archivo del weblog - Weblog de Yaroslav +{% else %} Weblog archive - Yaroslav's weblog +{% endif %} {% endblock %} {% block header %} -<h1>Yaroslav's weblog archive</h1> +<h1> + {% if lang == "ru" %} + Архив веб-журнала Ярослава + {% elif lang == "es" %} + Archivo del weblog de Yaroslav + {% else %} + Yaroslav's weblog archive + {% endif %} +</h1> {% endblock %} {% block content %} -{% set section = get_section(path="weblog/_index.md") %} +{% if lang != "en" %} +{% set section_path = "weblog/_index." ~ lang ~ ".md" %} +{% else %} +{% set section_path = "weblog/_index.md" %} +{% endif %} +{% set section = get_section(path=section_path) %} <div class="post-container"> - {% for year, posts in section.pages | group_by(attribute="year") %} - <h2>{{ year }}</h2> - <ul> - {% for post in posts %} - <li><span class="publish-date">{{ post.date | date }}</span> - <a href="{{ post.permalink }}">{{ post.title }}</a></li> - {% endfor %} - </ul> - {% endfor %} + {% for year, posts in section.pages | group_by(attribute="year") %} + <h2>{{ year }}</h2> + <ul> + {% for post in posts %} + <li> + <span class="publish-date">{{ post.date | date }}</span> - + <a href="{{ post.permalink }}">{{ post.title }}</a> + </li> + {% endfor %} + </ul> + {% endfor %} </div> {% endblock %} |