From d8574009886dd13120936c6ccc9fa2b0028ec980 Mon Sep 17 00:00:00 2001 From: Telegram Bot Date: Wed, 29 Apr 2026 00:59:54 +0300 Subject: [PATCH] Sveltia: S3 string widget + disqus field + archetypes templates --- archetypes/notes.md | 6 ++++++ archetypes/post.md | 17 +++++++++++++++++ static/admin/config.yml | 40 ++++++++++++++++++++++++++++++++-------- 3 files changed, 55 insertions(+), 8 deletions(-) create mode 100644 archetypes/notes.md create mode 100644 archetypes/post.md diff --git a/archetypes/notes.md b/archetypes/notes.md new file mode 100644 index 0000000..cfc9722 --- /dev/null +++ b/archetypes/notes.md @@ -0,0 +1,6 @@ ++++ +title = '{{ replace .Name "-" " " | title }}' +slug = '{{ .Name }}' +date = "{{ .Date | dateFormat "2006-01-02T00:00:00" }}" +description = '' ++++ diff --git a/archetypes/post.md b/archetypes/post.md new file mode 100644 index 0000000..847f25a --- /dev/null +++ b/archetypes/post.md @@ -0,0 +1,17 @@ ++++ +title = '{{ replace .Name "-" " " | title }}' +slug = '{{ .Name }}' +image = "https://s3.regru.cloud/sleeptrip-dev/images/{{ .Name }}_1.jpg" +date = "{{ .Date | dateFormat "2006-01-02T00:00:00" }}" +description = '' +disqus_identifier = 0 ++++ +Текст поездки. + +![{{ .Name }}](https://s3.regru.cloud/sleeptrip-dev/images/{{ .Name }}_2.jpg) + +![{{ .Name }}](https://s3.regru.cloud/sleeptrip-dev/images/{{ .Name }}_3.jpg) + +{{< rawhtml >}} +{{< back-to-top >}} +{{< /rawhtml >}} diff --git a/static/admin/config.yml b/static/admin/config.yml index e5ae283..35cc6ba 100644 --- a/static/admin/config.yml +++ b/static/admin/config.yml @@ -22,8 +22,16 @@ collections: extension: md summary: '{{title}} — {{date}}' fields: - - { label: Заголовок, name: title, widget: string } - - { label: Slug (URL), name: slug, widget: string, hint: 'Латиница, без пробелов. Пример: paris-2025' } + - label: Заголовок + name: title + widget: string + hint: 'Например: Коломна или Дюкинский заказник' + + - label: Slug (URL) + name: slug + widget: string + hint: 'Латиница без пробелов. Пример: Kolomna или Dukyn2504' + - label: Дата name: date widget: datetime @@ -31,13 +39,29 @@ collections: date_format: 'DD.MM.YYYY' time_format: 'HH:mm' default: '' - - { label: Описание (анонс), name: description, widget: string } - - label: Обложка + + - label: Описание (анонс) + name: description + widget: string + hint: 'Короткая фраза. Пример: скалы, рассвет, однодневная поездка' + + - label: Обложка (S3 URL) name: image - widget: image + widget: string required: false - hint: 'Загрузи фото или оставь пустым' - - { label: Контент, name: body, widget: markdown } + hint: 'https://s3.regru.cloud/sleeptrip-dev/images/ИМЯ_1.jpg' + pattern: ['^https?://', 'Должен быть полный URL'] + + - label: Disqus ID + name: disqus_identifier + widget: number + value_type: int + hint: 'Следующий свободный: 134. Каждый пост — уникальный номер.' + min: 1 + + - label: Контент + name: body + widget: markdown - name: notes label: 📝 Заметки @@ -49,7 +73,7 @@ collections: summary: '{{title}} — {{date}}' fields: - { label: Заголовок, name: title, widget: string } - - { label: Slug (URL), name: slug, widget: string, hint: 'Латиница, без пробелов.' } + - { label: Slug (URL), name: slug, widget: string, hint: 'Латиница без пробелов' } - label: Дата name: date widget: datetime