From fce8e1d3284eec6c87dc407957e632c5f3ee3b46 Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Sun, 1 Feb 2026 18:08:34 +0300 Subject: =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=88=D0=B0=D0=B1=D0=BB=D0=BE=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/posts/2021-02-13-jsonnet.md | 61 +++++++++++------------- hugo.yaml | 2 + i18n/ru-RU.toml | 4 ++ themes/neonxp/assets/css/main.css | 1 - themes/neonxp/layouts/_partials/terms.html | 31 ++++-------- themes/neonxp/layouts/page.html | 75 +++++++++++++++++------------- 6 files changed, 85 insertions(+), 89 deletions(-) create mode 100644 i18n/ru-RU.toml diff --git a/content/posts/2021-02-13-jsonnet.md b/content/posts/2021-02-13-jsonnet.md index e4ea27e..9b03e5d 100644 --- a/content/posts/2021-02-13-jsonnet.md +++ b/content/posts/2021-02-13-jsonnet.md @@ -1,12 +1,12 @@ --- -categories: -- Без рубрики -date: '2021-02-13T22:08:19Z' +date: "2021-02-13T22:08:19Z" image: files/2021-02-13-jsonnet_logo.webp tags: -- go -- it -- разное + - go + - it + - разное +categories: + - Без рубрики title: Jsonnet --- @@ -40,8 +40,8 @@ https://jsonnet.org/learning/tutorial.html. Накидал простенький пример который формирует конфигурацию пайплайна для гипотетической CI системы: -```json -local map(arr, predicate) = // определяем функцию map +```jsonnet +local map(arr, predicate) = // определяем функцию map if std.length(arr) == 0 then [] else @@ -63,32 +63,23 @@ local commands = ['go build', 'go test']; // Общая часть ```json { - "pipeline": [ - { - "commands": [ - "go build", - "go test" - ], - "image": "golang:1.14-alpine", - "name": "go1.14" - }, - { - "commands": [ - "go build", - "go test" - ], - "image": "golang:1.15-alpine", - "name": "go1.15" - }, - { - "commands": [ - "go build", - "go test" - ], - "image": "golang:1.16-rc-alpine", - "name": "go1.16-RC" - } - ] + "pipeline": [ + { + "commands": ["go build", "go test"], + "image": "golang:1.14-alpine", + "name": "go1.14" + }, + { + "commands": ["go build", "go test"], + "image": "golang:1.15-alpine", + "name": "go1.15" + }, + { + "commands": ["go build", "go test"], + "image": "golang:1.16-rc-alpine", + "name": "go1.16-RC" + } + ] } ``` @@ -98,4 +89,4 @@ local commands = ['go build', 'go test']; // Общая часть Я оставил за скобками то, что этот шаблонизатора позволяет формировать не только JSON но и фактически любой другой текстовый формат. И даже из одного скрипта формировать несколько документов разного формата. При этом локальные переменные будут использоваться общие. Теоретически, если упороться, можно одним скриптом сформировать весь /etc на новом сервере. Почему бы и нет?:) -Не знаю смог ли передать ощущение своего восторга, но я охренеть как рад и жду выходных, чтобы с головой нырнуть в эту технологию, которая открывает столько новых интересных перспектив! \ No newline at end of file +Не знаю смог ли передать ощущение своего восторга, но я охренеть как рад и жду выходных, чтобы с головой нырнуть в эту технологию, которая открывает столько новых интересных перспектив! diff --git a/hugo.yaml b/hugo.yaml index a0fc763..411e52c 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -67,3 +67,5 @@ mediaTypes: application/atom+xml: suffixes: - xml + +enableRobotsTXT: true diff --git a/i18n/ru-RU.toml b/i18n/ru-RU.toml new file mode 100644 index 0000000..a6cae12 --- /dev/null +++ b/i18n/ru-RU.toml @@ -0,0 +1,4 @@ +[Tags] +other = "Теги" +[Categories] +other = "Категории" diff --git a/themes/neonxp/assets/css/main.css b/themes/neonxp/assets/css/main.css index 6778acd..8402203 100644 --- a/themes/neonxp/assets/css/main.css +++ b/themes/neonxp/assets/css/main.css @@ -150,7 +150,6 @@ ul.pagination li:first-child a { pre { border-radius: var(--border-radius); border: 0.1px solid var(--border); - box-shadow: var(--shadow); padding: 0.5rem; } diff --git a/themes/neonxp/layouts/_partials/terms.html b/themes/neonxp/layouts/_partials/terms.html index f826abb..ec607ca 100644 --- a/themes/neonxp/layouts/_partials/terms.html +++ b/themes/neonxp/layouts/_partials/terms.html @@ -1,27 +1,16 @@ -{{- /* -For a given taxonomy, renders a list of terms assigned to the page. - -@context {page} page The current page. -@context {string} taxonomy The taxonomy. - -@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} -*/}} - {{- $page := .page }} {{- $taxonomy := .taxonomy }} {{- with $page.GetTerms $taxonomy }} {{- if . }} -
- {{- $label := (index . 0).Parent.LinkTitle }} -
-

{{ $label }}:

- -
- {{- end }} -
+{{- $label := (index . 0).Parent.LinkTitle }} +
+

{{ i18n $label }}:

+ +
+{{- end }} {{- end }} \ No newline at end of file diff --git a/themes/neonxp/layouts/page.html b/themes/neonxp/layouts/page.html index 506b56a..6bc6380 100644 --- a/themes/neonxp/layouts/page.html +++ b/themes/neonxp/layouts/page.html @@ -1,37 +1,48 @@ {{ define "main" }} -
-
-

{{ .Title }}

- {{if .Date }} - {{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }} - {{ $dateHuman := .Date | time.Format ":date_long" }} - - {{end}} -
-
+
+

{{ .Title }}

+ {{if .Date }} + {{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }} + {{ $dateHuman := .Date | time.Format ":date_long" }} + + {{end}} +
{{ .Content }} -
+
{{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} - {{if .Param "comments"}} -

Комментарии

- {{ range $key, $comment := where .Site.Data.comments "url" "eq" .Page.Path }} -
- {{$comment.from}}: -

{{$comment.comment}}

-
- {{ else }} -
Комментариев пока нет.
- {{ end }} - -
- {{ $comment := (print "mailto:blog@neonxp.ru?subject=" .Page.Permalink | safeHTML) }} - Для отправки комментария достаточно отправить e-mail со своим комментарием - на адрес - blog@neonxp.ru, в теме нужно указать ссылку на - пост.
- Или просто нажать кнопку ниже. Всё очень просто :)
- Написать комментарий -
+ +{{if .Param "comments"}} +

Комментарии

+{{ range $key, $comment := where .Site.Data.comments "subject" "eq" .Page.Permalink }} +
+ {{$comment.from_name}}: +

+ {{if $comment.date }} + {{ $dateMachine := $comment.date | time.Format "2006-01-02T15:04:05-07:00" }} + {{ $dateHuman := $comment.date | time.Format ":date_long" }} + + {{end}} +

+
{{$comment.body | safeHTML}}
+ {{if $comment.body_signature}} +
+ Подпись +
{{$comment.body_signature| safeHTML}}
+
{{end}} - +
+{{ else }} +
Комментариев пока нет.
+{{ end }} + +
+ {{ $comment := (print "mailto:blog@neonxp.ru?subject=" .Page.Permalink | safeHTML) }} + Для отправки комментария достаточно отправить e-mail со своим комментарием + на адрес + blog@neonxp.ru, в теме нужно указать ссылку на + пост.
+ Или просто нажать кнопку ниже. Всё очень просто :)
+ Написать комментарий +
+{{end}} {{ end }} \ No newline at end of file -- cgit v1.2.3