diff --git a/.gitattributes b/.gitattributes index 4fadf71..fdf8827 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10,5 +10,5 @@ jekyll_site/en/2023/03/** linguist-language=Java jekyll_site/ru/2023/06/** linguist-language=JavaScript jekyll_site/en/2023/06/** linguist-language=JavaScript -jekyll_site/ru/2023/08/** linguist-language=Bash -jekyll_site/en/2023/08/** linguist-language=Bash +jekyll_site/ru/2023/08/** linguist-language=Shell +jekyll_site/en/2023/08/** linguist-language=Shell diff --git a/README.md b/README.md index 9f13029..2d9b998 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ## Исходные тексты - Используемые форматы — Markdown, Liquid, YAML. -- Инструмент сборки — Jekyll с помидорными темами оформления. +- Инструмент сборки — Jekyll и помидорные темы оформления. - Управление процессами — Bash скрипты. diff --git a/build.sh b/build.sh index 9450d71..46b2fe9 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,6 @@ #!/bin/bash echo "Сборка сайта в двух помидорных темах и оптимизация результатов." -milliseconds=$(date '+%s%3N') +currentTimeMillis=$(date '+%s%3N') rm -rf _site rm -rf _site_older rm -rf _site_color @@ -13,7 +13,7 @@ cp -r jekyll_site/ru/index.md _site_older cp -r jekyll_site/_config_older.yml _site_older/_config.yml cp -r jekyll_site/Gemfile_older _site_older/Gemfile cd _site_older || exit -jekyll build +jekyll build --disable-disk-cache cp -r _site .. cd .. echo "Сборка цветного помидора." @@ -25,7 +25,7 @@ cp -r jekyll_site/ru/index.md _site_color cp -r jekyll_site/_config_color.yml _site_color/_config.yml cp -r jekyll_site/Gemfile_color _site_color/Gemfile cd _site_color || exit -jekyll build +jekyll build --disable-disk-cache cp -r _site ../_site/color cd .. echo "Копирование без сборки." @@ -52,4 +52,4 @@ find . -type f -name '*.html' | sort -r | while read -r file; do sed -i 's/
/
/g' "$file" sed -i -r 's///g' "$file" done -echo "Время выполнения сборки: $(("$(date '+%s%3N')" - "$milliseconds")) мс." +echo "Время выполнения сборки: $(("$(date '+%s%3N')" - "$currentTimeMillis")) мс." diff --git a/jekyll_site/_config_color.yml b/jekyll_site/_config_color.yml index 89e32cc..1fdccb9 100644 --- a/jekyll_site/_config_color.yml +++ b/jekyll_site/_config_color.yml @@ -1,18 +1,28 @@ -# site parameters +# название сайта для подписи в футере name: "Код с комментариями" +# подпись в футере для переведённых страниц name_translated: "Code with comments" +# URL адрес сайта, включая протокол url: "https://pomodoro5.mircloud.ru" +# подпапка этой сборки для относительных URLs baseurl: "/color" -homepage_url: "https://git.org.ru/pomodoro/5" -homepage_name: "GIT.ORG.RU" +# ссылка в верхнем левом углу заглавных страниц +homepage_url: "https://gitea.com/pomodoro/5" +# представление ссылки +homepage_name: "GITEA" +# подпапка альтернативной сборки older_tomato_baseurl: "" +# часовой пояс для формата даты ISO-8601 timezone: "Europe/Moscow" +# имя автора для SEO-разметки и подписи в футере author: "Головин Г.Г." +# транслитерация имени автора для переведённых страниц author_translated: "Golovin G.G." +# дополнение к подписи в футере для переведённых страниц translation_caption: "translation from Russian" -# build parameters -disable_disk_cache: true +# тема оформления для сборки theme: color-tomato-theme +# макет для сборки defaults: - scope: path: "" diff --git a/jekyll_site/_config_older.yml b/jekyll_site/_config_older.yml index 8358119..f6a94b9 100644 --- a/jekyll_site/_config_older.yml +++ b/jekyll_site/_config_older.yml @@ -1,18 +1,28 @@ -# site parameters +# название сайта для подписи в футере name: "Код с комментариями" +# подпись в футере для переведённых страниц name_translated: "Code with comments" +# URL адрес сайта, включая протокол url: "https://pomodoro5.mircloud.ru" +# подпапка этой сборки для относительных URLs baseurl: "" -homepage_url: "https://git.org.ru/pomodoro/5" -homepage_name: "GIT.ORG.RU" +# ссылка в верхнем левом углу заглавных страниц +homepage_url: "https://gitea.com/pomodoro/5" +# представление ссылки +homepage_name: "GITEA" +# подпапка альтернативной сборки color_tomato_baseurl: "/color" +# часовой пояс для формата даты ISO-8601 timezone: "Europe/Moscow" +# имя автора для SEO-разметки и подписи в футере author: "Головин Г.Г." +# транслитерация имени автора для переведённых страниц author_translated: "Golovin G.G." +# дополнение к подписи в футере для переведённых страниц translation_caption: "translation from Russian" -# build parameters -disable_disk_cache: true +# тема оформления для сборки theme: older-tomato-theme +# макет для сборки defaults: - scope: path: "" diff --git a/jekyll_site/en/2023/06/20/password-generator.md b/jekyll_site/en/2023/06/20/password-generator.md index 9a89b17..18888e9 100644 --- a/jekyll_site/en/2023/06/20/password-generator.md +++ b/jekyll_site/en/2023/06/20/password-generator.md @@ -2,7 +2,7 @@ title: Password generator description: We write a program in JavaScript for the formation of random 20-symbol combinations of latin letters, numbers and special characters. There are 60 variants... sections: [Cryptography,Random combinations] -tags: [javascript,text,symbols,letters,digits,characters,combinations] +tags: [javascript,online,text,symbols,letters,digits,characters,combinations] scripts: [/js/password-generator.js] styles: [/css/pomodoro5.css] canonical_url: /en/2023/06/20/password-generator.html diff --git a/jekyll_site/en/2023/08/04/directory-tree.md b/jekyll_site/en/2023/08/04/directory-tree.md index fec67d0..a10bafe 100644 --- a/jekyll_site/en/2023/08/04/directory-tree.md +++ b/jekyll_site/en/2023/08/04/directory-tree.md @@ -1,8 +1,8 @@ --- title: Directory tree with links -description: We write a Bash script for building a directory tree for a repository in the Markdown file. We use only the accessories of Bash and the ls program. We will... +description: We write a Bash script for building a directory tree for a repository in the Markdown file. We use only Bash tools and basic Linux software without additional. sections: [Recursion,File processing,Web-navigation] -tags: [linux,bash,markdown,folders,files,references,sorting] +tags: [linux,bash,markdown,html,folders,files,references,sorting] canonical_url: /en/2023/08/04/directory-tree.html url_translated: /ru/2023/08/03/directory-tree.html title_translated: Дерево каталогов со ссылками @@ -10,18 +10,16 @@ date: 2023.08.04 lang: en --- -We write a Bash script for building a directory tree for a [repository]({{ site.homepage_url }}) in -the Markdown file. We use only the accessories of Bash and the `ls` program. We will use the resulting -file in the web interface to navigate over the objects of the repository. +We write a Bash script for building a directory tree for a repository in the Markdown +file. We use only Bash tools and basic Linux software — `ls`, `sed`, `tr` and `echo` — +without additional programs. The obtained file +[`DIRECTORY_TREE.md`]({{ site.homepage_url }} "{{ site.homepage_name }}") +will be used in the web interface to navigate through the objects of the repository. -We create a recursive function and use it to bypass files and directories of the repository. -For each directory, we execute the program `ls` and get a sorted list of files and directories -included in it: first there are directories, then files, first uppercase letters, then lowercase, -exclude the untracked files that are not in the repository — we get the directory tree in -a sorted form. - -We collapse folders with one nested element into one line for conciseness. -We place the generated tree in the `
` container and add the title.
+We create a recursive function and use it to bypass all files and directories of the repository,
+excluding the list from `.gitignore`. We output tree elements as links ``, collapse folders
+with one nested element into one line, place the tree in the container `
` and add the title
+— as a result, we get a short and concise Markdown file with links.
 
 ```bash
 #!/bin/bash
@@ -36,7 +34,7 @@ function directory_tree {
   local path="$1"
   local head="$2"
   local tail="$3"
-  # prefix of the current element
+  # prefix for current element
   if [ "one" == "$4" ]; then
     echo -n "/"
   else
@@ -63,7 +61,7 @@ function directory_tree {
     done
   fi
 }
-# line of exclusions for 'ls' from '.gitignore' file — the untracked files
+# line of exclusions for 'ls' from '.gitignore' list — the untracked files
 exclusions="-I \".git\" $(sed 's/^/ -I "/;s/$/"/' .gitignore | tr -d '\n')"
 # put the tree in a container, add a title and output to a file
 {
@@ -74,4 +72,4 @@ exclusions="-I \".git\" $(sed 's/^/ -I "/;s/$/"/' .gitignore | tr -d '\n')"
 } >DIRECTORY_TREE.md
 ```
 
-We save the file `DIRECTORY_TREE.md` in the root of the repository and send the changes to the server.
+Run the script in the root of the repository and save the obtained file.
diff --git a/jekyll_site/en/index.md b/jekyll_site/en/index.md
index dad5d16..d3e4ab5 100644
--- a/jekyll_site/en/index.md
+++ b/jekyll_site/en/index.md
@@ -12,15 +12,15 @@ lang: en
 {%- assign articles = "" | split: "" %}
 {%- assign articles = articles | push: "Directory tree with links" %}
 {%- capture article_brief %}
-We write a Bash script for building a directory tree for a repository in the Markdown file. We use
-only the accessories of Bash and the `ls` program. We will use the resulting file in the web interface
-to navigate over the objects of the repository.
+We write a Bash script for building a directory tree for a repository in the Markdown
+file. We use only Bash tools and basic Linux software — `ls`, `sed`, `tr` and `echo` —
+without additional programs. The obtained file `DIRECTORY_TREE.md` will be used in the
+web interface to navigate through the objects of the repository.
 
-We create a recursive function and use it to bypass files and directories of the repository.
-For each directory, we execute the program `ls` and get a sorted list of files and directories
-included in it: first there are directories, then files, first uppercase letters, then lowercase,
-exclude the untracked files that are not in the repository — we get the directory tree in
-a sorted form.
+We create a recursive function and use it to bypass all files and directories of the repository,
+excluding the list from `.gitignore`. We output tree elements as links ``, collapse folders
+with one nested element into one line, place the tree in the container `
` and add the title
+— as a result, we get a short and concise Markdown file with links.
 {%- endcapture %}
 {%- assign articles = articles | push: article_brief %}
 {%- assign articles = articles | push: "Password generator" %}
diff --git a/jekyll_site/js/password-generator.js b/jekyll_site/js/password-generator.js
index e763274..b952060 100644
--- a/jekyll_site/js/password-generator.js
+++ b/jekyll_site/js/password-generator.js
@@ -1,4 +1,3 @@
-// © Головин Г.Г., Генератор паролей, 2023
 'use strict';
 // формирование комбинаций
 const generate = function() {
diff --git a/jekyll_site/ru/2023/06/19/password-generator.md b/jekyll_site/ru/2023/06/19/password-generator.md
index f066b62..8964b64 100644
--- a/jekyll_site/ru/2023/06/19/password-generator.md
+++ b/jekyll_site/ru/2023/06/19/password-generator.md
@@ -2,7 +2,7 @@
 title: Генератор паролей
 description: Пишем программу на JavaScript для формирования случайных 20-значных комбинаций из латинских букв, цифр и спецсимволов. На выбор 60 вариантов — 4 столбца по...
 sections: [Криптография,Случайные комбинации]
-tags: [javascript,текст,символы,буквы,цифры,знаки,комбинации]
+tags: [javascript,онлайн,текст,символы,буквы,цифры,знаки,комбинации]
 scripts: [/js/password-generator.js]
 styles: [/css/pomodoro5.css]
 canonical_url: /ru/2023/06/19/password-generator.html
diff --git a/jekyll_site/ru/2023/08/03/directory-tree.md b/jekyll_site/ru/2023/08/03/directory-tree.md
index 6817482..a72db53 100644
--- a/jekyll_site/ru/2023/08/03/directory-tree.md
+++ b/jekyll_site/ru/2023/08/03/directory-tree.md
@@ -1,26 +1,24 @@
 ---
 title: Дерево каталогов со ссылками
-description: Напишем скрипт Bash для построения дерева каталогов для репозитория в файле Markdown. Будем использовать только средства Bash и программу ls. Полученный...
+description: Напишем скрипт Bash для построения дерева каталогов для репозитория в файле Markdown. Будем использовать только средства Bash и базовое ПО Linux без...
 sections: [Рекурсия,Обработка файлов,Вёб-навигация]
-tags: [linux,bash,markdown,каталоги,файлы,ссылки,сортировка]
+tags: [linux,bash,markdown,html,каталоги,файлы,ссылки,сортировка]
 canonical_url: /ru/2023/08/03/directory-tree.html
 url_translated: /en/2023/08/04/directory-tree.html
 title_translated: Directory tree with links
 date: 2023.08.03
 ---
 
-Напишем скрипт Bash для построения дерева каталогов для [репозитория]({{ site.homepage_url }}) в файле
-Markdown. Будем использовать только средства Bash и программу `ls`. Полученный файл будем использовать
-в вёб-интерфейсе для навигации по объектам репозитория.
+Напишем скрипт Bash для построения дерева каталогов для репозитория в
+файле Markdown. Будем использовать только средства Bash и базовое ПО Linux
+— `ls`, `sed`, `tr` и `echo` — без дополнительных программ. Полученный файл
+[`DIRECTORY_TREE.md`]({{ site.homepage_url }} "{{ site.homepage_name }}")
+будем использовать в вёб-интерфейсе для навигации по объектам репозитория.
 
-Создаём рекурсивную функцию и с её помощью обходим файлы и каталоги репозитория. Для каждого
-каталога выполняем программу `ls` и получаем отсортированный список входящих в него файлов
-и каталогов: сначала идут каталоги, потом файлы, сначала заглавные буквы, потом строчные,
-исключаем неотслеживаемые файлы, которых нет в репозитории — получаем дерево каталогов
-в отсортированном виде.
-
-Папки с одним вложенным элементом сворачиваем в одну строку для лаконичности.
-Сформированное дерево помещаем в контейнер `
` и добавляем заголовок.
+Создаём рекурсивную функцию и с её помощью обходим все файлы и каталоги репозитория,
+за исключением списка из `.gitignore`. Выводим элементы дерева в виде ссылок ``,
+сворачиваем папки с одним вложенным элементом в одну строку, помещаем дерево в контейнер `
`
+и добавляем заголовок — в результате получаем краткий и лаконичный файл Markdown со ссылками.
 
 ```bash
 #!/bin/bash
@@ -35,9 +33,9 @@ function directory_tree {
   local path="$1"
   local head="$2"
   local tail="$3"
-  # префикс текущего элемента
+  # префикс для текущего элемента
   if [ "one" == "$4" ]; then
-    echo -n "/" 
+    echo -n "/"
   else
     echo -ne "\n$head"
   fi
@@ -62,7 +60,7 @@ function directory_tree {
     done
   fi
 }
-# строка исключений для 'ls' из файла '.gitignore' — неотслеживаемые файлы
+# строка исключений для 'ls' из списка '.gitignore' — неотслеживаемые файлы
 exclusions="-I \".git\" $(sed 's/^/ -I "/;s/$/"/' .gitignore | tr -d '\n')"
 # помещаем дерево в контейнер, добавляем заголовок и выводим в файл
 {
@@ -73,4 +71,4 @@ exclusions="-I \".git\" $(sed 's/^/ -I "/;s/$/"/' .gitignore | tr -d '\n')"
 } >DIRECTORY_TREE.md
 ```
 
-Сохраняем файл `DIRECTORY_TREE.md` в корне репозитория и отправляем изменения на сервер.
+Запускаем скрипт в корне репозитория и сохраняем полученный файл.
diff --git a/jekyll_site/ru/index.md b/jekyll_site/ru/index.md
index 06f5d61..5f6f1ef 100644
--- a/jekyll_site/ru/index.md
+++ b/jekyll_site/ru/index.md
@@ -11,15 +11,15 @@ title_translated: Code with comments
 {%- assign articles = "" | split: "" %}
 {%- assign articles = articles | push: "Дерево каталогов со ссылками" %}
 {%- capture article_brief %}
-Напишем скрипт Bash для построения дерева каталогов для репозитория в файле Markdown. Будем использовать
-только средства Bash и программу `ls`. Полученный файл будем использовать в вёб-интерфейсе для навигации
-по объектам репозитория.
+Напишем скрипт Bash для построения дерева каталогов для репозитория в файле Markdown.
+Будем использовать только средства Bash и базовое ПО Linux — `ls`, `sed`, `tr` и `echo`
+— без дополнительных программ. Полученный файл `DIRECTORY_TREE.md` будем использовать
+в вёб-интерфейсе для навигации по объектам репозитория.
 
-Создаём рекурсивную функцию и с её помощью обходим файлы и каталоги репозитория. Для каждого
-каталога выполняем программу `ls` и получаем отсортированный список входящих в него файлов
-и каталогов: сначала идут каталоги, потом файлы, сначала заглавные буквы, потом строчные,
-исключаем неотслеживаемые файлы, которых нет в репозитории — получаем дерево каталогов
-в отсортированном виде.
+Создаём рекурсивную функцию и с её помощью обходим все файлы и каталоги репозитория,
+за исключением списка из `.gitignore`. Выводим элементы дерева в виде ссылок ``,
+сворачиваем папки с одним вложенным элементом в одну строку, помещаем дерево в контейнер `
`
+и добавляем заголовок — в результате получаем краткий и лаконичный файл Markdown со ссылками.
 {%- endcapture %}
 {%- assign articles = articles | push: article_brief %}
 {%- assign articles = articles | push: "Генератор паролей" %}