diff options
author | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2021-03-12 18:44:41 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2021-03-12 18:44:41 +0300 |
commit | 5716bfd7548e386b12703e76cdf273bce839116c (patch) | |
tree | 5b21a9a8f6fd53e225f43385537d39fde70fa7c3 /templates | |
download | saucesource.cc-5716bfd7548e386b12703e76cdf273bce839116c.tar.gz saucesource.cc-5716bfd7548e386b12703e76cdf273bce839116c.zip |
Initial commit
Essential functional website.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/about.es.html | 10 | ||||
-rw-r--r-- | templates/about.html | 233 | ||||
-rw-r--r-- | templates/about.ru.html | 10 | ||||
-rw-r--r-- | templates/archive.html | 30 | ||||
-rw-r--r-- | templates/base.html | 69 | ||||
-rw-r--r-- | templates/index.es.html | 45 | ||||
-rw-r--r-- | templates/index.html | 47 | ||||
-rw-r--r-- | templates/index.ru.html | 46 | ||||
-rw-r--r-- | templates/page.html | 51 | ||||
-rw-r--r-- | templates/recipes.html | 48 |
10 files changed, 589 insertions, 0 deletions
diff --git a/templates/about.es.html b/templates/about.es.html new file mode 100644 index 0000000..53aac5c --- /dev/null +++ b/templates/about.es.html @@ -0,0 +1,10 @@ +{% extends "base.html" %} +{% block h1title %} +<h1 id="start">Acerca de {{ config.title }}</h1> +{% endblock %} +{% block body %} +<p> +La traducción de esta página todavía no está lista. Por el momento pueden leer +la página <a href="/about">en inglés</a>. +</p> +{% endblock %} diff --git a/templates/about.html b/templates/about.html new file mode 100644 index 0000000..7ca7a81 --- /dev/null +++ b/templates/about.html @@ -0,0 +1,233 @@ +{% extends "base.html" %} +{% block title %}About {{ config.title }}{% endblock %} +{% block h1title %} +<h1 id="start">About {{ config.title }}</h1> +{% endblock %} +{% block body %} +<p> +Searching for recipes, or reading almost anything on the internet for that +matter, has turned into a dreadful chore over the last decade. Each time you go +to most websites, they are loaded with unnecessary javascript, cookies, trackers +and other useless and in most cases even harmful things. This website aims to +provide for a better alternative to the thousands of JS-and-ad-riddle cookbook +websites out there. +</p> +<p> +Anybody is free to share their recipes on this website or even contribute to the +development of saucesource. If you are interested on sharing your recipes or +just helping, keep on reading to know how to contribute. +</p> +<h2>Formatting the recipe</h2> +<p> +Recipes on this site are stored in Markdown files. Markdown files are nice to +read in plain text and are widely known on the internet and in programming +circles, so chances are you are already familiar with the format. +</p> +<p> +However, the markdown files for the recipes in this site contain some additional +information at the beginning of the file that is called the "front matter". It +looks like this: +</p> +<pre> ++++ +title = "Spaghetti alla carbonara" +date = 2021-03-07T20:00:00Z +[extra] +author = "Yaroslav de la Peña Smirnov <yps[at]yaroslavps.com>" +website = "https://www.yaroslavps.com/" +donate = "https://www.yaroslavps.com/donate/" ++++ +</pre> +<ul> + <li> + <code>title</code> — pretty self-explanatory. + </li> + <li> + <code>date</code> — approximate date and time of publishing in Zulu + (UTC+0). + </li> + <li> + <code>author</code> — Your real name, nickname, pseudonym or just + <code>"Anonymous"</code> if you prefer to remain that way. You can also + add your email after your name/nickname if you wish. + </li> + <li> + <code>website</code> — Your website, or profile link (e.g. Github + profile). Optional. + </li> + <li> + <code>donate</code> — A link where people can tip you some money if they + want. Optional. + </li> +</ul> +<p> +<code>author</code>, <code>website</code> and <code>donate</code> all need to be +under the extra section. +</p> +<p> +The first picture (if any) and paragraph should be separated from the rest of +the text by a line containing <code><!-- more --></code>. This will allow +the picture and paragraph to appear as a short description in the main list of +recipes. +</p> +<p>The rest of the text is just plain Markdown.</p> +<h3>A guide on keeping the quality high</h3> +<p> +In order to keep with the site's theme and assure that the site is not bloated +with unnecessary information, there are some rules as to what a recipe should +contain and how it should be structured: +</p> +<ol> + <li> + There shouldn't be much text not related to the making of the recipe at + the beginning of it. You can have a small introduction paragraph, but it + shouldn't be a whole essay detailing your whole family story. It should + be short and concise, so as not to distract or annoy the reader with + information that is not necessary for them. + </li> + <li> + If there is something that you wish to tell that is a little bit too + long to be at the beginning, put it at the end of the recipe. It still + shouldn't be way too long. + </li> + <li> + It's okay to add links to other sites inside your recipes, but the + content inside the link should be related to your recipe. For example a + footnote link, or a link to a video with instructions on a video hosting + site like YouTube. + </li> + <li> + The recipe should contain at least the following two sections: + Ingredients and Instructions/Directions. You can add one or two sections + more, for example, with tips on choosing ingredients or serving your + recipe. + </li> + <li> + I recommended that you at least add one picture of your recipe. If + you add pictures, at least one of them should be of the prepared dish + and it should be at the very beginning of the recipe so that it can be + displayed on the list of recipes. If you don't have a picture of your + own authorship or that you have the rights to, don't submit it. + Absolutely no stock images. + </li> + <li> + You can add as many pictures as you like, but the total sum of the + pictures' size shouldn't exceed 3MB. + </li> +</ol> +<p> +These rules may change a bit in the future, but not much. +</p> +<h3>Tip on optimizing pictures</h3> +<p> +So that the website and your recipe are lighter on bandwidth, it is recommended +you optimize your pictures by compressing them. The (JPEG) settings I recommend +for a pretty good size/quality ratio are: +</p> +<ul> + <li>Strip any exif tags, color profiles, thumbnails, etc.</li> + <li>Quality 80-85.</li> + <li>Use interlace plane (i.e. progressive JPEG).</li> + <li>Use a chroma sampling factor of 4:2:0</li> + <li>Don't use a very high resolution. Something like 1200x800 pixels should + be more than enough.</li> +</ul> +<p>If you're using ImageMagick, the command looks something like this: </p> +<pre> +convert "$input" \ + -strip \ + -interlace plane \ + -define jpeg:dct-method=float \ + -sampling-factor 4:2:0 \ + -resize 1200x800 \ + -quality 80 \ + "$output" +</pre> +<p> +If you prefer using a GUI program like GIMP or Photoshop, (most of) these +settings should be available when you export your image to JPEG. +</p> +<h2 id="publishing">Publishing recipes</h2> +<p> +There are three ways to publish. The only thing that is required in order to +publish is that you have installed a plain text editor that can output text in +UTF-8 and an email address from which to send the recipe. +</p> +<p> +If you are not very tech-savy or don't know just what in the name of god is git, +no worries, there is still a way for you to share your recipes on this site. +Check the <a href="#email-publish">plain text email</a> instructions to learn +how. +</p> +<h3>Git over email</h3> +<p> +The main repository for this website is hosted at +<a href="https://git.sr.ht/~yaroslav/saucesource.cc">https://git.sr.ht/~yaroslav/saucesource.cc</a>. +The main and recommended way for you to publish your recipes is to send a patch +using git send-email to the project's mailing list. This doesn't require to make +an account on any service and only requires that you have git installed on your +computer properly configured with your email address. +</p> +<p> +If you are not very familiar with this way of collaborating, I recommend that +you read this <a href="https://git-send-email.io/">guide</a> and you'll be ready +to collaborate the way git was meant to be used in no time. +</p> +<h3>Github Pull Request</h3> +<p> +If you are more familiar with Github's pull request system, and you can't or +don't want to send patches by email, the project has a mirror repository on +Github where you can open a pull request to get your recipe added. +</p> +<p> +The Github mirror is located at +<a href="https://github.com/Yaroslav-95/saucesource.cc">https://github.com/Yaroslav-95/saucesource.cc</a>. +</p> +<h3 id="email-publish">Plain text email</h3> +<p> +If you are not familiar with git you can still send your recipe to me to my +personal email address for me to review it and add it to the website. Just make +sure that your recipe is properly formatted and send it as an attachment along +with any pictures in your recipe to +<a href="mailto:yps@yaroslavps.com?subject=Recipe ">yps@yaroslavps.com</a>. +</p> +<p> +<b>Important: </b> If you send me an email to my personal address, make sure to +add it to your whitelist, or check your spam folder. Especially if you are using +something like gmail or outlook. +</p> +<h2>Other ways of contributing</h2> +<p> +If you like this website, you can donate some money for the maintenance of the +website <a href="https://www.yaroslavps.com/donate/">over here</a>. +</p> +<p> +You can also donate money to the author of a recipe you liked, if that author +provided a donation link in their recipe. +</p> +<h2 id="roadmap">Roadmap</h2> +<p> +This is just a short kind of to-do list for the short-term: +</p> +<ul> + <li>Add dark pallet using prefers-color-scheme</li> + <li>Finish Russian and Spanish translations</li> + <li>Maybe add some kind of search functionality on the backend</li> + <li>Maybe add some way to categorize recipes</li> +</ul> +<h2>License</h2> +<p> +Everything that is presented in this site is published under the +<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA 3.0</a> +license. By publishing your recipe in this site, you retain authorship of your +recipe (unless you post anonymously), but the recipe is published under the same +license as the site. +</p> +<p> +The "code" or functional part of the site (such as templates, stylesheets and so +on) is published under the +<a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPLv3</a>. By contributing +any improvements or modifications to site, they are automatically licensed under +the same AGPLv3 license as the site. +</p> +{% endblock %} diff --git a/templates/about.ru.html b/templates/about.ru.html new file mode 100644 index 0000000..e1f7d06 --- /dev/null +++ b/templates/about.ru.html @@ -0,0 +1,10 @@ +{% extends "base.html" %} +{% block h1title %} +<h1 id="start">О {{ config.title }}</h1> +{% endblock %} +{% block body %} +<p> +Перевод данной страницы ещё не готов. Пока советую прочитать страницу на +<a href="/about">английском языке</a> +</p> +{% endblock %} diff --git a/templates/archive.html b/templates/archive.html new file mode 100644 index 0000000..445f37b --- /dev/null +++ b/templates/archive.html @@ -0,0 +1,30 @@ +{% extends "base.html" %} +{% block title %}Recipes archive — {{ config.title }}{% endblock %} +{% block h1title %} +<h1>{{ trans(key="archive_title", lang=lang) }}</h1> +{% endblock %} +{% block body %} +{% if lang != "en" %} +{% set section_path = "recipes/_index." ~ lang ~ ".md" %} +{% else %} +{% set section_path = "recipes/_index.md" %} +{% endif %} +{% set section = get_section(path=section_path) %} +<p> +<i>Tip: If you want to search for some recipe, try using your browsers "Find" + function. In most browsers you can open it with Ctrl+F or F3.</i> +</p> +<div class="recipe-container"> + {% for year, recipes in section.pages | group_by(attribute="year") %} + <h2>{{ year }}</h2> + <ul> + {% for recipe in recipes %} + <li> + <span class="publish-date">{{ recipe.date | date }}</span> - + <a href="{{ recipe.permalink }}">{{ recipe.title }}</a> + </li> + {% endfor %} + </ul> + {% endfor %} +</div> +{% endblock %} diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..43bf603 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,69 @@ +{% if lang != "en" %} +{% set url_prefix = "/" ~ lang ~ "/" %} +{% else %} +{% set url_prefix = "/" %} +{% endif %} +<!DOCTYPE html> +<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/main.css") }}"> + </head> + <body> + <div class="header-container"> + <div class="brand-container"> + <div class="brand"> + <a href="{{ url_prefix }}">{{ config.title }}</a> + </div> + </div> + <div class="title-container"> + {% block h1title %} + {% endblock %} + </div> + <nav class="navbar"> + <a href="{{ url_prefix }}"> + {{ trans(key="home", lang=lang) }} + </a> + <a href="{{ url_prefix }}recipes/"> + {{ trans(key="recipes", lang=lang) }} + </a> + <a href="{{ url_prefix }}recipes/archive"> + {{ trans(key="archive", lang=lang) }} + </a> + <a href="{{ url_prefix }}about/"> + {{ trans(key="about", lang=lang) }} + </a> + <a href="{{ url_prefix }}recipes/atom.xml">RSS</a> + </nav> + </div> + <div class="body-container"> + {% block body %} + {% endblock %} + </div> + <div class="footer-container"> + <hr> + <p> + <!-- TODO: do this programmaticaly --> + {% if lang == "ru" %} + Есть вопросы? Напиши мне на + <a href="yps@yaroslavps.com">yps@yaroslavps.com</a>, или глянь в + список рассылки + <a + href="https://lists.sr.ht/~yaroslav/saucesource.cc-comments">здесь</a>. + {% elif lang == "es" %} + ¿Dudas, preguntas? Envíame un correo electrónico a + <a href="yps@yaroslavps.com">yps@yaroslavps.com</a>, o hechale un + vistazo a la lista de correo + <a href="https://lists.sr.ht/~yaroslav/saucesource.cc-comments">aquí</a>. + {% else %} + Have any questions? Send me an email at + <a href="yps@yaroslavps.com">yps@yaroslavps.com</a>, or checkout the + comments mailing list + <a href="https://lists.sr.ht/~yaroslav/saucesource.cc-comments">here</a>. + {% endif %} + </p> + </div> + </body> +</html> diff --git a/templates/index.es.html b/templates/index.es.html new file mode 100644 index 0000000..26ac2b8 --- /dev/null +++ b/templates/index.es.html @@ -0,0 +1,45 @@ +{% extends "base.html" %} +{% block h1title %} +<h1>Bienvenidos a {{ config.title }}</h1> +<p class="publish-date">Un simple sitio de recetas que no apesta.</p> +{% endblock %} +{% block body %} +{% if lang != "en" %} +{% set section_path = "recipes/_index." ~ lang ~ ".md" %} +{% else %} +{% set section_path = "recipes/_index.md" %} +{% endif %} +{% set section = get_section(path=section_path) %} +<h2>Última receta</h2> +{% set latest = section.pages[0] %} +<div class="recipe-container partial"> + <h2> + <a href="{{ latest.permalink }}">{{ latest.title }}</a> + <span class="publish-date">{{ latest.date | date }}</span> + </h2> + {% if latest.summary %} + {{ latest.summary | safe }} + {% endif %} +</div> +<div class="more-link-container"> +<a href="/es/recipes/">Más recetas...</a> +</div> +<h2>Contribuye</h2> +<p> +Si quieres publicar tu receta o mejorar este sitio, no dudes en ayudar. Puedes +encontrar más información acerca de como contribuir +<a href="/es/about/">aquí</a>. +</p> +<h2>Otros idiomas</h2> +<p> +El sitio está actualmente disponible en los siguientes idiomas: +</p> +<ul> + <li><a href="/">English</a></li> + <li><a href="/ru/">Русский</a></li> +</ul> +<p> +Ten en cuenta que las recetas no van a estar traducidas a todos los idiomas en +que este sitio se encuentra disponible. +</p> +{% endblock %} diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..68dde54 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,47 @@ +{% extends "base.html" %} +{% block h1title %} +<h1>Welcome to {{ config.title }}</h1> +<p class="publish-date">A simple recipe website that doesn't suck.</p> +{% endblock %} +{% block body %} +{% if lang != "en" %} +{% set section_path = "recipes/_index." ~ lang ~ ".md" %} +{% else %} +{% set section_path = "recipes/_index.md" %} +{% endif %} +{% set section = get_section(path=section_path) %} +<h2>Latest Recipe</h2> +{% set latest = section.pages[0] %} +<div class="recipe-container partial"> + <h2> + <a href="{{ latest.permalink }}">{{ latest.title }}</a> + <span class="publish-date">{{ latest.date | date }}</span> + </h2> + {% if latest.summary %} + {{ latest.summary | safe }} + {% endif %} +</div> +<div class="more-link-container"> +<a href="/recipes/">More recipes...</a> +</div> +<h2>Make a contribution</h2> +<p> +If you want to publish your recipe or make this site better, don't hesitate to +help. You can find more information on how to contribute +<a href="/about/">here</a>. +</p> +<h2>Other languages</h2> +<p> +This site is currently also available in the following languages: +</p> +<ul> + <li><a href="/es/">Español</a></li> + <li><a href="/ru/">Русский</a></li> +</ul> +<p> +Do keep in mind that not all recipes will be translated to every language the +site is available on. If you want to help translate the site to another +language, or help improve existing translations check the +<a href="/about/">about</a> page. +</p> +{% endblock %} diff --git a/templates/index.ru.html b/templates/index.ru.html new file mode 100644 index 0000000..aabfb4f --- /dev/null +++ b/templates/index.ru.html @@ -0,0 +1,46 @@ +{% extends "base.html" %} +{% block h1title %} +<h1>Добро пожаловать в {{ config.title }}</h1> +<p class="publish-date">Простой и не отстойный сайт рецептов.</p> +{% endblock %} +{% block body %} +{% if lang != "en" %} +{% set section_path = "recipes/_index." ~ lang ~ ".md" %} +{% else %} +{% set section_path = "recipes/_index.md" %} +{% endif %} +{% set section = get_section(path=section_path) %} +<h2>Последний рецепт</h2> +{% set latest = section.pages[0] %} +<div class="recipe-container partial"> + <h2> + <a href="{{ latest.permalink }}">{{ latest.title }}</a> + <span class="publish-date">{{ latest.date | date }}</span> + </h2> + {% if latest.summary %} + {{ latest.summary | safe }} + {% endif %} +</div> +<div class="more-link-container"> +<a href="/ru/recipes/">Больше рецептов...</a> +</div> +<h2>Сделай вклад</h2> +<p> +Если хочешь опубликовать свой рецепт или улучшить сайт, мы здесь этому рады. +Больше информации можно найти <a href="/ru/about/">здесь</a>. +</p> +<h2>Другие языки</h2> +<p> +Сайт также доступен на данный момент на этих языках: +</p> +<ul> + <li><a href="/es/">Español</a></li> + <li><a href="/">English</a></li> +</ul> +<p> +Учтите что рецепты переводятся отдельно от самого сайта. То есть, не все рецепты +доступны на всех языках сайта. Если вы желаете помочь в переводе сайта на другие +языки или улучшить существующие переводы, прочитайте страницу +<a href="/ru/about/">о сайте</a>. +</p> +{% endblock %} diff --git a/templates/page.html b/templates/page.html new file mode 100644 index 0000000..85630b6 --- /dev/null +++ b/templates/page.html @@ -0,0 +1,51 @@ +{% extends "base.html" %} +{% block title %}{{ page.title }} — {{ config.title }}{% endblock %} +{% block h1title %} +<h1>{{ page.title }}</h1> +<p class="publish-date"> + {{ trans(key="published", lang=lang) }} + {{ page.date | date(format="%Y-%m-%d") }} + by + {{ page.extra["author"] }} +</p> +{% if page.updated %} +<p class="publish-date"> + {{ trans(key="edited", lang=lang) }} + {{ page.updated | date(format="%Y-%m-%d") }} +</p> +{% endif %} +<div class="author-links"> + {% if page.extra["website"] %} + <a href="{{ page.extra["website"] }}"> + {{ trans(key="author_website", lang=lang) }} + </a> + {% endif %} + {% if page.extra["donate"] %} + <a href="{{ page.extra["donate"] }}"> + {{ trans(key="author_donate", lang=lang) }} + </a> + {% endif %} +</div> +{% endblock %} +{% block body %} +<div class="recipe-container full"> + {% if page.translations | length > 1 %} + <p class="publish-date"> + <!-- TODO: make this more programmatic --> + {{ trans(key="also_read", lang=lang) }} + {% for trans in page.translations %} + {% if trans.lang != lang %} + {% if trans.lang == "ru" %} + <a href="{{ trans.permalink }}">Русский</a>. + {% elif trans.lang == "es" %} + <a href="{{ trans.permalink }}">Español</a>. + {% else %} + <a href="{{ trans.permalink }}">English</a>. + {% endif %} + {% endif %} + {% endfor %} + </p> + {% endif %} + {{ page.content | safe }} +</div> +{% endblock %} diff --git a/templates/recipes.html b/templates/recipes.html new file mode 100644 index 0000000..a0149be --- /dev/null +++ b/templates/recipes.html @@ -0,0 +1,48 @@ +{% extends "base.html" %} +{% block title %}{{ section.title }} — {{ config.title }}{% endblock %} +{% block h1title %} +<h1>{{ trans(key="recipes_title", lang=lang) }}</h1> +{% endblock %} +{% block body %} +<div class="recipes-list"> + {% for recipe in paginator.pages %} + <div class="recipe-container partial"> + <h2> + <a href="{{ recipe.permalink }}">{{ recipe.title }}</a> + <span class="publish-date">{{ recipe.date | date }}</span> + </h2> + {% if recipe.summary %} + {{ recipe.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> + {{ trans(key="first", lang=lang) }} + </a> + <a href="{{ paginator.previous }}"> + <span class="icon">←</span> + {{ trans(key="page", lang=lang) }} + {{ paginator.current_index - 1 }} + </a> + {% endif %} + {% if paginator.next %} + <a href="{{ paginator.next }}"> + {{ trans(key="page", lang=lang) }} + {{ paginator.current_index + 1 }} + <span class="icon">→</span> + </a> + <a href="{{ paginator.last }}"> + {{ trans(key="last", lang=lang) }} + <span class="icon">→|</span> + </a> + {% endif %} + </div> + {% endif %} +{% endif %} +{% endblock %} |