Skip to content

Commit ac50c3a

Browse files
nopearscursoragent
andcommitted
Add poem creation dates and remove Обман.
Surface dates in lists and poem pages, and sort standalone poems by newest first. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 1c42e5a commit ac50c3a

7 files changed

Lines changed: 80 additions & 30 deletions

File tree

src/data/standalone.ts

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export const standalonePoems: Poem[] = [
44
{
55
slug: 'temnota',
66
title: 'В темноте',
7+
createdAt: '2022-09-29',
78
format: 'verse',
89
stanzas: [
910
[
@@ -29,6 +30,7 @@ export const standalonePoems: Poem[] = [
2930
{
3031
slug: 'boketto',
3132
title: 'Бокетто',
33+
createdAt: '2022-04-11',
3234
format: 'verse',
3335
stanzas: [
3436
[
@@ -55,6 +57,7 @@ export const standalonePoems: Poem[] = [
5557
{
5658
slug: 'mrak',
5759
title: 'Во мраке тихой темной ночи',
60+
createdAt: '2022-08-29',
5861
format: 'verse',
5962
stanzas: [
6063
[
@@ -80,6 +83,7 @@ export const standalonePoems: Poem[] = [
8083
{
8184
slug: 'night',
8285
title: 'Ночь',
86+
createdAt: '2022-08-14',
8387
format: 'verse',
8488
stanzas: [
8589
[
@@ -98,6 +102,7 @@ export const standalonePoems: Poem[] = [
98102
{
99103
slug: 'moon',
100104
title: 'Луна',
105+
createdAt: '2022-04-27',
101106
format: 'verse',
102107
stanzas: [
103108
[
@@ -123,6 +128,7 @@ export const standalonePoems: Poem[] = [
123128
{
124129
slug: 'stay',
125130
title: 'Постой',
131+
createdAt: '2022-04-28',
126132
format: 'verse',
127133
stanzas: [
128134
[
@@ -142,6 +148,7 @@ export const standalonePoems: Poem[] = [
142148
{
143149
slug: 'moment',
144150
title: '…',
151+
createdAt: '2022-09-12',
145152
format: 'verse',
146153
stanzas: [
147154
[
@@ -168,34 +175,10 @@ export const standalonePoems: Poem[] = [
168175
],
169176
],
170177
},
171-
{
172-
slug: 'obman',
173-
title: 'Обман',
174-
format: 'verse',
175-
stanzas: [
176-
[
177-
'Ты веришь только в ложь,',
178-
'Глаза не видят правды,',
179-
'Твой мозг уже плывет,',
180-
'Сознание тихо умирает.',
181-
],
182-
[
183-
'Но ты и дальше смотришь ящик,',
184-
'Все так же веря в бычий глаз.',
185-
'Теперь ты словно зомби,',
186-
'Что над собой утерял власть.',
187-
],
188-
[
189-
'И каждый аргумент',
190-
'Проходит вскользь твоих ушей,',
191-
'Ведь сознанием управляет',
192-
'Полумертвый кощей.',
193-
],
194-
],
195-
},
196178
{
197179
slug: 'pristan',
198180
title: 'На старой пристани',
181+
createdAt: '2022-04-20',
199182
format: 'verse',
200183
stanzas: [
201184
[
@@ -227,6 +210,7 @@ export const standalonePoems: Poem[] = [
227210
{
228211
slug: 'ty',
229212
title: 'Ты',
213+
createdAt: '2022-04-19',
230214
format: 'verse',
231215
stanzas: [
232216
[
@@ -246,6 +230,7 @@ export const standalonePoems: Poem[] = [
246230
{
247231
slug: 'soldat',
248232
title: 'Маленький солдат',
233+
createdAt: '2022-02-23',
249234
format: 'verse',
250235
stanzas: [
251236
[
@@ -319,6 +304,7 @@ export const standalonePoems: Poem[] = [
319304
{
320305
slug: 'marsh',
321306
title: 'Партызанскі марш',
307+
createdAt: '2022-08-04',
322308
format: 'verse',
323309
lang: 'be',
324310
stanzas: [
@@ -348,6 +334,7 @@ export const standalonePoems: Poem[] = [
348334
{
349335
slug: 'pyt',
350336
title: 'Ты адкажы мне на пытаньне',
337+
createdAt: '2022-02-25',
351338
format: 'verse',
352339
lang: 'be',
353340
stanzas: [
@@ -375,6 +362,7 @@ export const standalonePoems: Poem[] = [
375362
{
376363
slug: 'prison',
377364
title: 'Prison',
365+
createdAt: '2024-02-21',
378366
format: 'verse',
379367
lang: 'en',
380368
stanzas: [
@@ -395,6 +383,7 @@ export const standalonePoems: Poem[] = [
395383
{
396384
slug: 'doroga',
397385
title: 'Дорога',
386+
createdAt: '2025-10-08',
398387
format: 'verse',
399388
stanzas: [
400389
[
@@ -420,6 +409,7 @@ export const standalonePoems: Poem[] = [
420409
{
421410
slug: 'nol',
422411
title: '0°С',
412+
createdAt: '2025-06-10',
423413
format: 'verse',
424414
stanzas: [
425415
[
@@ -445,6 +435,7 @@ export const standalonePoems: Poem[] = [
445435
{
446436
slug: 'slovo',
447437
title: 'Слово',
438+
createdAt: '2023-01-21',
448439
format: 'verse',
449440
stanzas: [
450441
[

src/data/types.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export type PoemFormat = 'verse' | 'prose'
33
export interface Poem {
44
slug: string
55
title: string
6+
createdAt: string
67
format: PoemFormat
78
stanzas: string[][]
89
prose?: string
@@ -16,3 +17,12 @@ export interface Collection {
1617
description?: string
1718
poems: Poem[]
1819
}
20+
21+
export function formatPoemDate(iso: string): string {
22+
const [year, month, day] = iso.split('-').map(Number)
23+
return new Intl.DateTimeFormat('ru-RU', {
24+
day: 'numeric',
25+
month: 'long',
26+
year: 'numeric',
27+
}).format(new Date(year, month - 1, day))
28+
}

src/data/zerkalo.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export const zerkaloPoems: Poem[] = [
44
{
55
slug: 'passazhir',
66
title: 'Пассажир',
7+
createdAt: '2022-01-17',
78
format: 'verse',
89
stanzas: [
910
[
@@ -17,6 +18,7 @@ export const zerkaloPoems: Poem[] = [
1718
{
1819
slug: 'mil',
1920
title: 'Насильно мил, увы, не будешь',
21+
createdAt: '2022-01-12',
2022
format: 'verse',
2123
stanzas: [
2224
[
@@ -43,6 +45,7 @@ export const zerkaloPoems: Poem[] = [
4345
{
4446
slug: 'temnica',
4547
title: 'Темница',
48+
createdAt: '2022-01-03',
4649
format: 'verse',
4750
stanzas: [
4851
[
@@ -63,6 +66,7 @@ export const zerkaloPoems: Poem[] = [
6366
{
6467
slug: 'plyvia',
6568
title: '…',
69+
createdAt: '2022-01-03',
6670
format: 'verse',
6771
stanzas: [
6872
[
@@ -93,6 +97,7 @@ export const zerkaloPoems: Poem[] = [
9397
{
9498
slug: 'gorod',
9599
title: 'Город-фальшь',
100+
createdAt: '2022-02-05',
96101
format: 'verse',
97102
stanzas: [
98103
[
@@ -124,6 +129,7 @@ export const zerkaloPoems: Poem[] = [
124129
{
125130
slug: 'otshelnik',
126131
title: 'Отшельник',
132+
createdAt: '2021-12-27',
127133
format: 'verse',
128134
stanzas: [
129135
[
@@ -156,6 +162,7 @@ export const zerkaloPoems: Poem[] = [
156162
{
157163
slug: 'soul',
158164
title: 'Душа',
165+
createdAt: '2022-01-24',
159166
format: 'verse',
160167
stanzas: [
161168
[
@@ -175,6 +182,7 @@ export const zerkaloPoems: Poem[] = [
175182
{
176183
slug: 'rassvet',
177184
title: 'Рассвет',
185+
createdAt: '2022-02-23',
178186
format: 'verse',
179187
stanzas: [
180188
[
@@ -200,6 +208,7 @@ export const zerkaloPoems: Poem[] = [
200208
{
201209
slug: 'polet',
202210
title: 'В полёте',
211+
createdAt: '2022-01-03',
203212
format: 'verse',
204213
stanzas: [
205214
[
@@ -225,6 +234,7 @@ export const zerkaloPoems: Poem[] = [
225234
{
226235
slug: 'pustota',
227236
title: 'Пустота',
237+
createdAt: '2022-02-06',
228238
format: 'verse',
229239
stanzas: [
230240
[
@@ -254,6 +264,7 @@ export const zerkaloPoems: Poem[] = [
254264
{
255265
slug: 'monolog',
256266
title: 'Последний монолог',
267+
createdAt: '2022-08-20',
257268
format: 'prose',
258269
stanzas: [],
259270
prose:

src/styles/main.css

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,29 @@ ul {
218218
color: var(--mist-dim);
219219
}
220220

221+
.poem-link__meta {
222+
display: inline-flex;
223+
align-items: baseline;
224+
gap: 0.65rem;
225+
flex-shrink: 0;
226+
}
227+
228+
.poem-link__date {
229+
font-size: 0.72rem;
230+
letter-spacing: 0.04em;
231+
color: var(--mist-dim);
232+
white-space: nowrap;
233+
}
234+
235+
.poem-date {
236+
margin: 0 0 2.25rem;
237+
text-align: center;
238+
font-size: 0.78rem;
239+
letter-spacing: 0.12em;
240+
text-transform: uppercase;
241+
color: var(--mist-dim);
242+
}
243+
221244
.topbar {
222245
display: flex;
223246
align-items: center;
@@ -282,7 +305,7 @@ ul {
282305
}
283306

284307
.poem-title {
285-
margin-bottom: 2.25rem;
308+
margin-bottom: 0.75rem;
286309
font-family: var(--font-poem);
287310
font-size: clamp(2rem, 6vw, 3rem);
288311
font-style: italic;

src/views/CollectionView.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { computed } from 'vue'
33
import { RouterLink, useRouter } from 'vue-router'
44
import { getCollection } from '@/data/catalog'
5+
import { formatPoemDate } from '@/data/types'
56
67
const props = defineProps<{ id: string }>()
78
const router = useRouter()
@@ -38,7 +39,10 @@ if (!collection.value) {
3839
<span class="index">{{ String(index + 1).padStart(2, '0') }}</span>
3940
{{ poem.title }}
4041
</span>
41-
<span v-if="poem.format === 'prose'" class="poem-link__lang">послесловие</span>
42+
<span class="poem-link__meta">
43+
<span v-if="poem.format === 'prose'" class="poem-link__lang">послесловие</span>
44+
<span class="poem-link__date">{{ formatPoemDate(poem.createdAt) }}</span>
45+
</span>
4246
</RouterLink>
4347
</li>
4448
</ol>

src/views/HomeView.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
<script setup lang="ts">
22
import { RouterLink } from 'vue-router'
33
import { author, bookTitle, collections, standalonePoems } from '@/data/catalog'
4+
import { formatPoemDate } from '@/data/types'
5+
import { computed } from 'vue'
6+
7+
const poems = computed(() =>
8+
[...standalonePoems].sort((a, b) => b.createdAt.localeCompare(a.createdAt)),
9+
)
410
</script>
511

612
<template>
@@ -34,11 +40,14 @@ import { author, bookTitle, collections, standalonePoems } from '@/data/catalog'
3440
<section class="section" aria-labelledby="poems-label">
3541
<h2 id="poems-label" class="section-label">Стихотворения</h2>
3642
<ul class="poem-list">
37-
<li v-for="poem in standalonePoems" :key="poem.slug">
43+
<li v-for="poem in poems" :key="poem.slug">
3844
<RouterLink class="poem-link" :to="{ name: 'poem', params: { slug: poem.slug } }">
3945
<span class="poem-link__title">{{ poem.title }}</span>
40-
<span v-if="poem.lang === 'be'" class="poem-link__lang">бел</span>
41-
<span v-else-if="poem.lang === 'en'" class="poem-link__lang">en</span>
46+
<span class="poem-link__meta">
47+
<span v-if="poem.lang === 'be'" class="poem-link__lang">бел</span>
48+
<span v-else-if="poem.lang === 'en'" class="poem-link__lang">en</span>
49+
<span class="poem-link__date">{{ formatPoemDate(poem.createdAt) }}</span>
50+
</span>
4251
</RouterLink>
4352
</li>
4453
</ul>

src/views/PoemView.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { computed } from 'vue'
33
import { RouterLink, useRouter } from 'vue-router'
44
import { getCollection, getPoemInCollection, getStandalonePoem } from '@/data/catalog'
5+
import { formatPoemDate } from '@/data/types'
56
67
const props = defineProps<{
78
slug: string
@@ -54,6 +55,7 @@ if (!context.value) {
5455

5556
<article class="poem-shell">
5657
<h1 class="poem-title">{{ context.poem.title }}</h1>
58+
<p class="poem-date">{{ formatPoemDate(context.poem.createdAt) }}</p>
5759

5860
<div v-if="context.poem.format === 'prose'" class="prose">
5961
{{ context.poem.prose }}

0 commit comments

Comments
 (0)