From 5716bfd7548e386b12703e76cdf273bce839116c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Fri, 12 Mar 2021 18:44:41 +0300 Subject: Initial commit Essential functional website. --- templates/about.es.html | 10 +++ templates/about.html | 233 ++++++++++++++++++++++++++++++++++++++++++++++++ templates/about.ru.html | 10 +++ templates/archive.html | 30 +++++++ templates/base.html | 69 ++++++++++++++ templates/index.es.html | 45 ++++++++++ templates/index.html | 47 ++++++++++ templates/index.ru.html | 46 ++++++++++ templates/page.html | 51 +++++++++++ templates/recipes.html | 48 ++++++++++ 10 files changed, 589 insertions(+) create mode 100644 templates/about.es.html create mode 100644 templates/about.html create mode 100644 templates/about.ru.html create mode 100644 templates/archive.html create mode 100644 templates/base.html create mode 100644 templates/index.es.html create mode 100644 templates/index.html create mode 100644 templates/index.ru.html create mode 100644 templates/page.html create mode 100644 templates/recipes.html (limited to 'templates') 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 %} +

Acerca de {{ config.title }}

+{% endblock %} +{% block body %} +

+La traducción de esta página todavía no está lista. Por el momento pueden leer +la página en inglés. +

+{% 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 %} +

About {{ config.title }}

+{% endblock %} +{% block body %} +

+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. +

+

+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. +

+

Formatting the recipe

+

+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. +

+

+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: +

+
++++
+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/"
++++
+
+ +

+author, website and donate all need to be +under the extra section. +

+

+The first picture (if any) and paragraph should be separated from the rest of +the text by a line containing <!-- more -->. This will allow +the picture and paragraph to appear as a short description in the main list of +recipes. +

+

The rest of the text is just plain Markdown.

+

A guide on keeping the quality high

+

+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: +

+
    +
  1. + 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. +
  2. +
  3. + 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. +
  4. +
  5. + 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. +
  6. +
  7. + 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. +
  8. +
  9. + 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. +
  10. +
  11. + You can add as many pictures as you like, but the total sum of the + pictures' size shouldn't exceed 3MB. +
  12. +
+

+These rules may change a bit in the future, but not much. +

+

Tip on optimizing pictures

+

+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: +

+ +

If you're using ImageMagick, the command looks something like this:

+
+convert "$input" \
+    -strip \
+    -interlace plane \
+    -define jpeg:dct-method=float \
+    -sampling-factor 4:2:0 \
+    -resize 1200x800 \
+    -quality 80 \
+    "$output"
+
+

+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. +

+

Publishing recipes

+

+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. +

+

+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 plain text email instructions to learn +how. +

+

Git over email

+

+The main repository for this website is hosted at +https://git.sr.ht/~yaroslav/saucesource.cc. +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. +

+

+If you are not very familiar with this way of collaborating, I recommend that +you read this guide and you'll be ready +to collaborate the way git was meant to be used in no time. +

+

Github Pull Request

+

+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. +

+

+The Github mirror is located at +https://github.com/Yaroslav-95/saucesource.cc. +

+

Plain text email

+

+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 +yps@yaroslavps.com. +

+

+Important: 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. +

+

Other ways of contributing

+

+If you like this website, you can donate some money for the maintenance of the +website over here. +

+

+You can also donate money to the author of a recipe you liked, if that author +provided a donation link in their recipe. +

+

Roadmap

+

+This is just a short kind of to-do list for the short-term: +

+ +

License

+

+Everything that is presented in this site is published under the +CC-BY-SA 3.0 +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. +

+

+The "code" or functional part of the site (such as templates, stylesheets and so +on) is published under the +AGPLv3. By contributing +any improvements or modifications to site, they are automatically licensed under +the same AGPLv3 license as the site. +

+{% 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 %} +

О {{ config.title }}

+{% endblock %} +{% block body %} +

+Перевод данной страницы ещё не готов. Пока советую прочитать страницу на +английском языке +

+{% 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 %} +

{{ trans(key="archive_title", lang=lang) }}

+{% 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) %} +

+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. +

+
+ {% for year, recipes in section.pages | group_by(attribute="year") %} +

{{ year }}

+ + {% endfor %} +
+{% 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 %} + + + + + + {% block title %}{{ config.title }}{% endblock %} + + + +
+ +
+ {% block h1title %} + {% endblock %} +
+ +
+
+ {% block body %} + {% endblock %} +
+ + + 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 %} +

Bienvenidos a {{ config.title }}

+

Un simple sitio de recetas que no apesta.

+{% 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) %} +

Última receta

+{% set latest = section.pages[0] %} +
+

+ {{ latest.title }} + {{ latest.date | date }} +

+ {% if latest.summary %} + {{ latest.summary | safe }} + {% endif %} +
+ +

Contribuye

+

+Si quieres publicar tu receta o mejorar este sitio, no dudes en ayudar. Puedes +encontrar más información acerca de como contribuir +aquí. +

+

Otros idiomas

+

+El sitio está actualmente disponible en los siguientes idiomas: +

+ +

+Ten en cuenta que las recetas no van a estar traducidas a todos los idiomas en +que este sitio se encuentra disponible. +

+{% 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 %} +

Welcome to {{ config.title }}

+

A simple recipe website that doesn't suck.

+{% 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) %} +

Latest Recipe

+{% set latest = section.pages[0] %} +
+

+ {{ latest.title }} + {{ latest.date | date }} +

+ {% if latest.summary %} + {{ latest.summary | safe }} + {% endif %} +
+ +

Make a contribution

+

+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 +here. +

+

Other languages

+

+This site is currently also available in the following languages: +

+ +

+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 +about page. +

+{% 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 %} +

Добро пожаловать в {{ config.title }}

+

Простой и не отстойный сайт рецептов.

+{% 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) %} +

Последний рецепт

+{% set latest = section.pages[0] %} +
+

+ {{ latest.title }} + {{ latest.date | date }} +

+ {% if latest.summary %} + {{ latest.summary | safe }} + {% endif %} +
+ +

Сделай вклад

+

+Если хочешь опубликовать свой рецепт или улучшить сайт, мы здесь этому рады. +Больше информации можно найти здесь. +

+

Другие языки

+

+Сайт также доступен на данный момент на этих языках: +

+ +

+Учтите что рецепты переводятся отдельно от самого сайта. То есть, не все рецепты +доступны на всех языках сайта. Если вы желаете помочь в переводе сайта на другие +языки или улучшить существующие переводы, прочитайте страницу +о сайте. +

+{% 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 %} +

{{ page.title }}

+

+ {{ trans(key="published", lang=lang) }} + {{ page.date | date(format="%Y-%m-%d") }} + by + {{ page.extra["author"] }} +

+{% if page.updated %} +

+ {{ trans(key="edited", lang=lang) }} + {{ page.updated | date(format="%Y-%m-%d") }} +

+{% endif %} + +{% endblock %} +{% block body %} +
+ {% if page.translations | length > 1 %} +

+ + {{ trans(key="also_read", lang=lang) }} + {% for trans in page.translations %} + {% if trans.lang != lang %} + {% if trans.lang == "ru" %} + Русский. + {% elif trans.lang == "es" %} + Español. + {% else %} + English. + {% endif %} + {% endif %} + {% endfor %} +

+ {% endif %} + {{ page.content | safe }} +
+{% 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 %} +

{{ trans(key="recipes_title", lang=lang) }}

+{% endblock %} +{% block body %} +
+ {% for recipe in paginator.pages %} +
+

+ {{ recipe.title }} + {{ recipe.date | date }} +

+ {% if recipe.summary %} + {{ recipe.summary | safe }} + {% endif %} +
+ {% endfor %} +
+{% if paginator %} + {% if paginator.number_pagers > 1 %} +
+ {% if paginator.previous %} + + |← + {{ trans(key="first", lang=lang) }} + + + + {{ trans(key="page", lang=lang) }} + {{ paginator.current_index - 1 }} + + {% endif %} + {% if paginator.next %} + + {{ trans(key="page", lang=lang) }} + {{ paginator.current_index + 1 }} + + + + {{ trans(key="last", lang=lang) }} + →| + + {% endif %} +
+ {% endif %} +{% endif %} +{% endblock %} -- cgit v1.2.3