astro-accelerator 7.1.16 → 7.1.18

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": "7.1.16",
2
+ "version": "7.1.18",
3
3
  "author": "Steve Fenton",
4
4
  "name": "astro-accelerator",
5
5
  "description": "A super-lightweight, accessible, SEO-friendly starter project for Astro",
@@ -38,7 +38,7 @@
38
38
  "@astrojs/markdown-remark": "^7.2.4",
39
39
  "@astrojs/mdx": "^7.0.8",
40
40
  "@img/sharp-linux-x64": "^0.35.4",
41
- "astro": "^7.2.7",
41
+ "astro": "^7.2.9",
42
42
  "astro-accelerator-utils": "^0.3.107",
43
43
  "csv": "^6.6.3",
44
44
  "hast-util-from-selector": "^3.0.1",
@@ -50,9 +50,9 @@
50
50
  },
51
51
  "devDependencies": {
52
52
  "@playwright/test": "^1.62.1",
53
- "cspell": "^10.1.1",
53
+ "cspell": "^10.2.0",
54
54
  "glob": "^13.0.6",
55
- "linkinator": "^8.0.4"
55
+ "linkinator": "^8.1.0"
56
56
  },
57
57
  "files": [
58
58
  "pnpm-workspace.yaml",
@@ -734,10 +734,14 @@ table {
734
734
  font-size: var(--font-size-meta);
735
735
  margin: 0 0 var(--paragraph-margin) 0;
736
736
 
737
+ a {
738
+ text-decoration: none;
739
+ }
740
+
737
741
  & > .author-info {
738
742
 
739
- & > *:nth-child(n + 3)::before {
740
- content: '|';
743
+ & > *:nth-child(n + 2):not(:last-child)::after {
744
+ content: '•';
741
745
  padding: 0 0.3rem;
742
746
  opacity: 0.5;
743
747
  }
@@ -747,6 +751,13 @@ table {
747
751
  height: 1rem;
748
752
  margin: 0 0.3rem 0 0;
749
753
  width: 1rem;
754
+ transform: translateY(-0.1em);
755
+ }
756
+ }
757
+
758
+ & .originally-published {
759
+ @media (max-width: 860px) {
760
+ display: block;
750
761
  }
751
762
  }
752
763
  }
@@ -734,10 +734,14 @@ table {
734
734
  font-size: var(--font-size-meta);
735
735
  margin: 0 0 var(--paragraph-margin) 0;
736
736
 
737
+ a {
738
+ text-decoration: none;
739
+ }
740
+
737
741
  & > .author-info {
738
742
 
739
- & > *:nth-child(n + 3)::before {
740
- content: '|';
743
+ & > *:nth-child(n + 2):not(:last-child)::after {
744
+ content: '•';
741
745
  padding: 0 0.3rem;
742
746
  opacity: 0.5;
743
747
  }
@@ -747,6 +751,13 @@ table {
747
751
  height: 1rem;
748
752
  margin: 0 0.3rem 0 0;
749
753
  width: 1rem;
754
+ transform: translateY(-0.1em);
755
+ }
756
+ }
757
+
758
+ & .originally-published {
759
+ @media (max-width: 860px) {
760
+ display: block;
750
761
  }
751
762
  }
752
763
  }
@@ -734,10 +734,14 @@ table {
734
734
  font-size: var(--font-size-meta);
735
735
  margin: 0 0 var(--paragraph-margin) 0;
736
736
 
737
+ a {
738
+ text-decoration: none;
739
+ }
740
+
737
741
  & > .author-info {
738
742
 
739
- & > *:nth-child(n + 3)::before {
740
- content: '|';
743
+ & > *:nth-child(n + 2):not(:last-child)::after {
744
+ content: '•';
741
745
  padding: 0 0.3rem;
742
746
  opacity: 0.5;
743
747
  }
@@ -747,6 +751,13 @@ table {
747
751
  height: 1rem;
748
752
  margin: 0 0.3rem 0 0;
749
753
  width: 1rem;
754
+ transform: translateY(-0.1em);
755
+ }
756
+ }
757
+
758
+ & .originally-published {
759
+ @media (max-width: 860px) {
760
+ display: block;
750
761
  }
751
762
  }
752
763
  }
@@ -29,6 +29,11 @@ const authorImage = authorList?.image?.src
29
29
  ? getImageInfo(authorList.image.src, 'author-image', SITE.images.authorSize)
30
30
  : null;
31
31
 
32
+ const canonical = frontmatter.meta?.find(
33
+ (meta) => meta.name.toLowerCase() === 'canonical',
34
+ )?.content;
35
+ const canonicalDomain = canonical ? new URL(canonical).hostname : undefined;
36
+
32
37
  stats.stop();
33
38
  ---
34
39
  {authorList.writers.length > 0 &&
@@ -58,7 +63,11 @@ stats.stop();
58
63
  <br /><time datetime={ frontmatter.modDate.toString() } itemprop="dateModified">
59
64
  { _(Translations.post.last_modified) + ' ' + accelerator.dateFormatter.formatDate(frontmatter.modDate, lang) }
60
65
  </time>
61
- }{authorList.mainAuthor &&
66
+ }
67
+ {canonical &&
68
+ <br /><span set:html={ _(Translations.post.originally_published).replace('{link}', `<a href="${canonical}">${canonicalDomain}</a>`) }></span>
69
+ }
70
+ {authorList.mainAuthor &&
62
71
  <p>{ authorList.mainAuthor.frontmatter.description }</p>
63
72
  }
64
73
  </div>
@@ -1,16 +1,16 @@
1
1
  ---
2
2
  // warning: This file is overwritten by Astro Accelerator
3
3
 
4
- import { Accelerator } from 'astro-accelerator-utils';
5
- import type { Frontmatter } from 'astro-accelerator-utils/types/Frontmatter';
6
- import { SITE } from '@config';
7
- import { Translations, Lang } from '@util/Languages';
8
- import { getImageInfo } from '@util/custom-markdown.mjs';
9
- import ReadingTime from '@components/ReadingTime.astro';
4
+ import { Accelerator } from "astro-accelerator-utils";
5
+ import type { Frontmatter } from "astro-accelerator-utils/types/Frontmatter";
6
+ import { SITE } from "@config";
7
+ import { Translations, Lang } from "@util/Languages";
8
+ import { getImageInfo } from "@util/custom-markdown.mjs";
9
+ import ReadingTime from "@components/ReadingTime.astro";
10
10
 
11
11
  const accelerator = new Accelerator(SITE);
12
12
  const stats = new accelerator.statistics(
13
- 'accelerator/components/AuthorsMini.astro'
13
+ "accelerator/components/AuthorsMini.astro",
14
14
  );
15
15
  stats.start();
16
16
 
@@ -31,9 +31,14 @@ const dateToShow =
31
31
 
32
32
  // Get image info
33
33
  const authorImage = authorList?.image?.src
34
- ? getImageInfo(authorList.image.src, 'author-image', SITE.images.authorSize)
34
+ ? getImageInfo(authorList.image.src, "author-image", SITE.images.authorSize)
35
35
  : null;
36
36
 
37
+ const canonical = frontmatter.meta?.find(
38
+ (meta) => meta.name.toLowerCase() === "canonical",
39
+ )?.content;
40
+ const canonicalDomain = canonical ? new URL(canonical).hostname : undefined;
41
+
37
42
  stats.stop();
38
43
  ---
39
44
 
@@ -56,8 +61,8 @@ stats.stop();
56
61
  <a
57
62
  href={
58
63
  accelerator.urlFormatter.formatAddress(
59
- authorList.mainAuthor.url
60
- ) + '1/'
64
+ authorList.mainAuthor.url,
65
+ ) + "1/"
61
66
  }
62
67
  class="author-name">
63
68
  {authorList.mainAuthor.frontmatter.title}
@@ -67,7 +72,7 @@ stats.stop();
67
72
  <a
68
73
  href={
69
74
  accelerator.urlFormatter.formatAddress(writer.url) +
70
- '1/'
75
+ "1/"
71
76
  }
72
77
  class="contributor-name">
73
78
  {writer.frontmatter.title}
@@ -78,10 +83,21 @@ stats.stop();
78
83
  datetime={dateToShow.toString()}
79
84
  set:html={accelerator.dateFormatter.formatShortDate(
80
85
  dateToShow,
81
- lang
86
+ lang,
82
87
  )}
83
88
  />
84
89
  <ReadingTime lang={lang} frontmatter={frontmatter} />
90
+ {canonical && (
91
+ <span
92
+ class="originally-published"
93
+ set:html={_(
94
+ Translations.post.originally_published,
95
+ ).replace(
96
+ "{link}",
97
+ `<a href="${canonical}">${canonicalDomain}</a>`,
98
+ )}
99
+ />
100
+ )}
85
101
  </div>
86
102
  </div>
87
103
  )
@@ -63,6 +63,9 @@
63
63
  "written_by": {
64
64
  "en": "Written by"
65
65
  },
66
+ "originally_published": {
67
+ "en": "Originally published at {link}"
68
+ },
66
69
  "last_modified": {
67
70
  "en": "Revised"
68
71
  },
File without changes
File without changes
File without changes