astro-accelerator 5.10.39 → 5.10.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.10.39",
2
+ "version": "5.10.41",
3
3
  "author": "Steve Fenton",
4
4
  "name": "astro-accelerator",
5
5
  "description": "A super-lightweight, accessible, SEO-friendly starter project for Astro",
@@ -36,11 +36,11 @@
36
36
  "dependencies": {
37
37
  "@astrojs/mdx": "^4.3.13",
38
38
  "@img/sharp-linux-x64": "^0.34.5",
39
- "astro": "^5.17.0",
39
+ "astro": "^5.17.2",
40
40
  "astro-accelerator-utils": "^0.3.69",
41
- "cspell": "^9.6.2",
41
+ "cspell": "^9.6.4",
42
42
  "csv": "^6.4.1",
43
- "glob": "^13.0.0",
43
+ "glob": "^13.0.3",
44
44
  "hast-util-from-selector": "^3.0.1",
45
45
  "html-to-text": "^9.0.5",
46
46
  "keyword-extractor": "^0.0.28",
@@ -50,7 +50,7 @@
50
50
  "sharp": "^0.34.5"
51
51
  },
52
52
  "devDependencies": {
53
- "@playwright/test": "^1.58.0"
53
+ "@playwright/test": "^1.58.2"
54
54
  },
55
55
  "files": [
56
56
  ".npmrc",
@@ -92,7 +92,8 @@ textarea {
92
92
  font-family: var(--code-font);
93
93
  }
94
94
 
95
- button, .button {
95
+ button,
96
+ .button {
96
97
  background-color: transparent;
97
98
  border: 1px solid var(--fore);
98
99
  border-radius: var(--block-radius);
@@ -104,8 +105,10 @@ button, .button {
104
105
  text-decoration: none;
105
106
  }
106
107
 
107
- button:hover, .button:hover,
108
- button:focus, .button:focus {
108
+ button:hover,
109
+ .button:hover,
110
+ button:focus,
111
+ .button:focus {
109
112
  background-color: var(--fore);
110
113
  color: var(--aft);
111
114
  }
@@ -144,7 +147,7 @@ blockquote {
144
147
  border-radius: var(--block-radius);
145
148
  }
146
149
 
147
- blockquote > *:first-child:before {
150
+ blockquote>*:first-child:before {
148
151
  content: '“';
149
152
  color: var(--icon-block);
150
153
  display: inline;
@@ -156,8 +159,8 @@ blockquote > *:first-child:before {
156
159
  right: 0.2em;
157
160
  }
158
161
 
159
- blockquote > *,
160
- blockquote > p {
162
+ blockquote>*,
163
+ blockquote>p {
161
164
  margin-inline: var(--paragraph-margin);
162
165
  }
163
166
 
@@ -255,7 +258,7 @@ figure {
255
258
  border-radius: var(--block-radius);
256
259
  }
257
260
 
258
- figure > p {
261
+ figure>p {
259
262
  margin: 0;
260
263
  }
261
264
 
@@ -462,7 +465,7 @@ a.navigation-icon:focus {
462
465
  font-size: var(--font-size-meta);
463
466
  }
464
467
 
465
- .site-nav > ul {
468
+ .site-nav>ul {
466
469
  border-bottom: 1px solid var(--fore-link);
467
470
  }
468
471
 
@@ -470,11 +473,11 @@ a.navigation-icon:focus {
470
473
  list-style: none;
471
474
  }
472
475
 
473
- .site-nav > ul > li {
476
+ .site-nav>ul>li {
474
477
  border-top: 1px solid var(--fore-link);
475
478
  }
476
479
 
477
- .site-nav > ul > li li {
480
+ .site-nav>ul>li li {
478
481
  border-top: 1px solid color-mix(in srgb, var(--fore-link) 50%, transparent);
479
482
  }
480
483
 
@@ -555,7 +558,7 @@ details.sub-nav details {
555
558
  text-wrap: balance;
556
559
  }
557
560
 
558
- .content-group > nav {
561
+ .content-group>nav {
559
562
  grid-area: menu;
560
563
  padding: var(--block-gap) 0;
561
564
  }
@@ -566,6 +569,7 @@ details.sub-nav details {
566
569
  }
567
570
 
568
571
  .page-content {
572
+
569
573
  h2,
570
574
  h3,
571
575
  h4,
@@ -575,7 +579,7 @@ details.sub-nav details {
575
579
  }
576
580
  }
577
581
 
578
- .page-content > h2:nth-child(1) {
582
+ .page-content>h2:nth-child(1) {
579
583
  margin-top: 0;
580
584
  }
581
585
 
@@ -655,7 +659,7 @@ details.sub-nav details {
655
659
  z-index: 1;
656
660
  }
657
661
 
658
- .overlay > * {
662
+ .overlay>* {
659
663
  max-width: 40rem;
660
664
  margin: 0 auto;
661
665
  }
@@ -778,7 +782,7 @@ details.sub-nav details {
778
782
  transform: var(--transform-selected);
779
783
  }
780
784
 
781
- .post-list .list-item[data-image='true'] > article {
785
+ .post-list .list-item[data-image='true']>article {
782
786
  display: grid;
783
787
  grid-template-columns: 2fr 1fr;
784
788
  grid-template-areas: 'content img';
@@ -871,7 +875,7 @@ details.sub-nav details {
871
875
  margin: var(--block-gap) 0 var(--block-gap-l) 0;
872
876
  }
873
877
 
874
- .post-paging > * {
878
+ .post-paging>* {
875
879
  flex: 1;
876
880
  text-align: center;
877
881
  }
@@ -939,7 +943,7 @@ details.sub-nav details {
939
943
  }
940
944
  }
941
945
 
942
- .post-meta > .author-info {
946
+ .post-meta>.author-info {
943
947
  display: flex;
944
948
  flex-wrap: wrap;
945
949
  align-items: center;
@@ -954,13 +958,13 @@ details.sub-nav details {
954
958
  margin: 0 0 var(--paragraph-margin) 0;
955
959
  }
956
960
 
957
- .post-meta.mini > .author-info > *:nth-child(n + 3)::before {
961
+ .post-meta.mini>.author-info>*:nth-child(n + 3)::before {
958
962
  content: '|';
959
963
  padding: 0 0.3rem;
960
964
  opacity: 0.5;
961
965
  }
962
966
 
963
- .post-meta.mini > .author-info > .author-image {
967
+ .post-meta.mini>.author-info>.author-image {
964
968
  height: 1rem;
965
969
  width: 1rem;
966
970
  margin: 0 0.3rem 0 0;
@@ -1013,7 +1017,7 @@ details.sub-nav details {
1013
1017
  }
1014
1018
  }
1015
1019
 
1016
- .author-page > img {
1020
+ .author-page>img {
1017
1021
  align-self: self-start;
1018
1022
 
1019
1023
  @media (max-width: 860px) {
@@ -1099,7 +1103,7 @@ details.sub-nav details {
1099
1103
  grid-template-rows: 1fr auto;
1100
1104
  }
1101
1105
 
1102
- .yt-video > * {
1106
+ .yt-video>* {
1103
1107
  align-items: center;
1104
1108
  display: flex;
1105
1109
  height: 100%;
@@ -1237,7 +1241,7 @@ figure:focus .magnify-button {
1237
1241
  }
1238
1242
  }
1239
1243
 
1240
- .simple-grid > * > * {
1244
+ .simple-grid>*>* {
1241
1245
  width: 100%;
1242
1246
  }
1243
1247
 
@@ -1277,6 +1281,7 @@ figure:focus .magnify-button {
1277
1281
  }
1278
1282
 
1279
1283
  @media (max-width: 680px) {
1284
+
1280
1285
  .note,
1281
1286
  .inset,
1282
1287
  .inset-small,
@@ -1353,7 +1358,8 @@ figure:focus .magnify-button {
1353
1358
  /* Events timeline */
1354
1359
 
1355
1360
  .timeline {
1356
- position: relative;
1361
+ --timeline-gap: 1rem;
1362
+ position: relative;
1357
1363
  }
1358
1364
 
1359
1365
  .timeline h2,
@@ -1366,14 +1372,14 @@ figure:focus .magnify-button {
1366
1372
  background-color: var(--icon-block);
1367
1373
  bottom: 0;
1368
1374
  content: '';
1369
- left: 2rem;
1375
+ left: var(--timeline-gap);
1370
1376
  position: absolute;
1371
1377
  top: calc(var(--block-gap) * -1);
1372
1378
  width: 0.4rem;
1373
1379
  }
1374
1380
 
1375
1381
  .timeline-event {
1376
- padding-inline-start: 4rem;
1382
+ padding-inline-start: calc(var(--timeline-gap) * 2.5);
1377
1383
  position: relative;
1378
1384
  margin-block-end: var(--block-gap);
1379
1385
  }
@@ -1385,28 +1391,27 @@ figure:focus .magnify-button {
1385
1391
  box-shadow: var(--box-shadow-unselected);
1386
1392
  content: '';
1387
1393
  height: 1rem;
1388
- left: 1.5rem;
1394
+ left: calc(var(--timeline-gap) - 0.5rem);
1389
1395
  position: absolute;
1390
- top: 1.5em;
1396
+ top: 1.4em;
1391
1397
  width: 1rem;
1392
1398
  z-index: 1;
1393
1399
  }
1394
1400
 
1395
- .timeline-event > div {
1401
+ .timeline-event>div {
1396
1402
  background: var(--aft-block);
1397
1403
  border-radius: var(--block-radius);
1398
1404
  box-shadow: var(--box-shadow-unselected);
1399
1405
  color: var(--fore-block);
1400
1406
  padding: 1.5rem;
1401
1407
  text-align: left;
1402
- width: 100%;
1403
1408
  }
1404
1409
 
1405
- .timeline-event.event-today > div {
1410
+ .timeline-event.event-today>div {
1406
1411
  box-shadow: var(--box-glow);
1407
1412
  }
1408
1413
 
1409
- .timeline-event.event-past > div {
1414
+ .timeline-event.event-past>div {
1410
1415
  background: var(--aft);
1411
1416
  box-shadow: none;
1412
1417
  color: var(--fore);
@@ -1434,6 +1439,7 @@ figure:focus .magnify-button {
1434
1439
  /* Animation */
1435
1440
 
1436
1441
  @media (prefers-reduced-motion: no-preference) {
1442
+
1437
1443
  .magnify-icon,
1438
1444
  .copy-button,
1439
1445
  .anim-show-parent .list-item img,
@@ -1441,4 +1447,4 @@ figure:focus .magnify-button {
1441
1447
  transition: all 0.2s ease-in;
1442
1448
  scale: calc(0.75 + (var(--shown, 1) * 0.25));
1443
1449
  }
1444
- }
1450
+ }
@@ -7,7 +7,7 @@ interface Props {
7
7
  endDate?: string;
8
8
  title: string;
9
9
  location: string;
10
- description: string;
10
+ description?: string;
11
11
  linkHref: string;
12
12
  linkText: string;
13
13
  }
@@ -23,33 +23,42 @@ threeMonthsAgo.setMonth(threeMonthsAgo.getMonth() - 3);
23
23
 
24
24
  const isOld = eventDate < threeMonthsAgo;
25
25
 
26
- const displayDate = isOld
27
- ? accelerator.dateFormatter.formatDateWithoutDay(date, SITE.default.locale)
28
- : accelerator.dateFormatter.formatShortDate(date, SITE.default.locale);
26
+ const formatDate = (d) => {
27
+ try {
28
+ return isOld
29
+ ? accelerator.dateFormatter.formatDateWithoutDay(
30
+ d,
31
+ SITE.default.locale,
32
+ )
33
+ : accelerator.dateFormatter.formatShortDate(d, SITE.default.locale);
34
+ } catch (e) {
35
+ return new Date(d).toLocaleDateString(SITE.default.locale);
36
+ }
37
+ };
38
+
39
+ const displayDate = formatDate(date);
29
40
  ---
30
41
 
31
42
  <div class="timeline-event">
32
43
  <div>
33
- <time datetime={date}>{displayDate}</time>{
44
+ <time datetime={date.toString()}>{displayDate}</time>{
34
45
  !isOld && endDate && (
35
46
  <Fragment>
36
47
  &dash;
37
- <time datetime={endDate}>
38
- {accelerator.dateFormatter.formatShortDate(
39
- endDate,
40
- SITE.default.locale,
41
- )}
48
+ <time datetime={endDate.toString()}>
49
+ {formatDate(endDate)}
42
50
  </time>
43
51
  </Fragment>
44
52
  )
45
53
  }
46
54
  <h3>{title}</h3>
47
55
  <span class="timeline-location">{location}</span>
48
- <p>{description}</p>
56
+ {description && <p>{description}</p>}
57
+ <slot />
49
58
  {
50
59
  linkHref && (
51
60
  <a href={linkHref} class="button">
52
- {linkText}
61
+ {linkText || "Link"}
53
62
  </a>
54
63
  )
55
64
  }