@riebeckite/plugin-recent-posts 0.0.5 → 0.0.6

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/README.md CHANGED
@@ -77,4 +77,4 @@ target.
77
77
 
78
78
  ## See also
79
79
 
80
- - [Plugin guide](../../docs/plugins_en.md)
80
+ - [Plugin guide](../../../docs/en/plugin-system.md)
@@ -2,27 +2,34 @@
2
2
  import { jsx, jsxs } from "hono/jsx/jsx-runtime";
3
3
  function RecentPosts(props) {
4
4
  if (props.posts.length === 0) return null;
5
- return /* @__PURE__ */ jsxs("section", { class: "recent-posts rr-recent-posts", "aria-labelledby": "recent-posts-title", children: [
6
- /* @__PURE__ */ jsxs("div", { class: "recent-posts__header", children: [
7
- /* @__PURE__ */ jsx("p", { class: "recent-posts__eyebrow", children: "RECENT POSTS" }),
8
- /* @__PURE__ */ jsx("h2", { class: "recent-posts__title", id: "recent-posts-title", children: "最近投稿された記事" })
9
- ] }),
10
- /* @__PURE__ */ jsx("ol", { class: "recent-posts__list", children: props.posts.map((post) => {
11
- const formattedDate = formatPostedDate(post.postedAt);
12
- return /* @__PURE__ */ jsx("li", { class: "recent-posts__item", children: /* @__PURE__ */ jsxs("a", { class: "recent-posts__link", href: post.permalink, children: [
13
- /* @__PURE__ */ jsx(
14
- "time",
15
- {
16
- class: "recent-posts__date",
17
- dateTime: formattedDate.isoDate,
18
- title: formattedDate.fullDate,
19
- children: formattedDate.displayDate
20
- }
21
- ),
22
- /* @__PURE__ */ jsx("span", { class: "recent-posts__post-title", children: post.title })
23
- ] }) }, post.slug);
24
- }) })
25
- ] });
5
+ return /* @__PURE__ */ jsxs(
6
+ "section",
7
+ {
8
+ class: "recent-posts rr-recent-posts",
9
+ "aria-labelledby": "recent-posts-title",
10
+ children: [
11
+ /* @__PURE__ */ jsxs("div", { class: "recent-posts__header", children: [
12
+ /* @__PURE__ */ jsx("p", { class: "recent-posts__eyebrow", children: "RECENT POSTS" }),
13
+ /* @__PURE__ */ jsx("h2", { class: "recent-posts__title", id: "recent-posts-title", children: "最近投稿された記事" })
14
+ ] }),
15
+ /* @__PURE__ */ jsx("ol", { class: "recent-posts__list", children: props.posts.map((post) => {
16
+ const formattedDate = formatPostedDate(post.postedAt);
17
+ return /* @__PURE__ */ jsx("li", { class: "recent-posts__item", children: /* @__PURE__ */ jsxs("a", { class: "recent-posts__link", href: post.permalink, children: [
18
+ /* @__PURE__ */ jsx(
19
+ "time",
20
+ {
21
+ class: "recent-posts__date",
22
+ dateTime: formattedDate.isoDate,
23
+ title: formattedDate.fullDate,
24
+ children: formattedDate.displayDate
25
+ }
26
+ ),
27
+ /* @__PURE__ */ jsx("span", { class: "recent-posts__post-title", children: post.title })
28
+ ] }) }, post.slug);
29
+ }) })
30
+ ]
31
+ }
32
+ );
26
33
  }
27
34
  function formatPostedDate(date) {
28
35
  const isoDate = date.toISOString();
package/dist/index.js CHANGED
@@ -5,27 +5,34 @@ import { definePlugin } from "@riebeckite/core";
5
5
  import { jsx, jsxs } from "hono/jsx/jsx-runtime";
6
6
  function RecentPosts(props) {
7
7
  if (props.posts.length === 0) return null;
8
- return /* @__PURE__ */ jsxs("section", { class: "recent-posts rr-recent-posts", "aria-labelledby": "recent-posts-title", children: [
9
- /* @__PURE__ */ jsxs("div", { class: "recent-posts__header", children: [
10
- /* @__PURE__ */ jsx("p", { class: "recent-posts__eyebrow", children: "RECENT POSTS" }),
11
- /* @__PURE__ */ jsx("h2", { class: "recent-posts__title", id: "recent-posts-title", children: "最近投稿された記事" })
12
- ] }),
13
- /* @__PURE__ */ jsx("ol", { class: "recent-posts__list", children: props.posts.map((post) => {
14
- const formattedDate = formatPostedDate(post.postedAt);
15
- return /* @__PURE__ */ jsx("li", { class: "recent-posts__item", children: /* @__PURE__ */ jsxs("a", { class: "recent-posts__link", href: post.permalink, children: [
16
- /* @__PURE__ */ jsx(
17
- "time",
18
- {
19
- class: "recent-posts__date",
20
- dateTime: formattedDate.isoDate,
21
- title: formattedDate.fullDate,
22
- children: formattedDate.displayDate
23
- }
24
- ),
25
- /* @__PURE__ */ jsx("span", { class: "recent-posts__post-title", children: post.title })
26
- ] }) }, post.slug);
27
- }) })
28
- ] });
8
+ return /* @__PURE__ */ jsxs(
9
+ "section",
10
+ {
11
+ class: "recent-posts rr-recent-posts",
12
+ "aria-labelledby": "recent-posts-title",
13
+ children: [
14
+ /* @__PURE__ */ jsxs("div", { class: "recent-posts__header", children: [
15
+ /* @__PURE__ */ jsx("p", { class: "recent-posts__eyebrow", children: "RECENT POSTS" }),
16
+ /* @__PURE__ */ jsx("h2", { class: "recent-posts__title", id: "recent-posts-title", children: "最近投稿された記事" })
17
+ ] }),
18
+ /* @__PURE__ */ jsx("ol", { class: "recent-posts__list", children: props.posts.map((post) => {
19
+ const formattedDate = formatPostedDate(post.postedAt);
20
+ return /* @__PURE__ */ jsx("li", { class: "recent-posts__item", children: /* @__PURE__ */ jsxs("a", { class: "recent-posts__link", href: post.permalink, children: [
21
+ /* @__PURE__ */ jsx(
22
+ "time",
23
+ {
24
+ class: "recent-posts__date",
25
+ dateTime: formattedDate.isoDate,
26
+ title: formattedDate.fullDate,
27
+ children: formattedDate.displayDate
28
+ }
29
+ ),
30
+ /* @__PURE__ */ jsx("span", { class: "recent-posts__post-title", children: post.title })
31
+ ] }) }, post.slug);
32
+ }) })
33
+ ]
34
+ }
35
+ );
29
36
  }
30
37
  function formatPostedDate(date) {
31
38
  const isoDate = date.toISOString();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riebeckite/plugin-recent-posts",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -22,7 +22,10 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "hono": "^4.12.25",
25
- "@riebeckite/core": "0.0.5"
25
+ "@riebeckite/core": "0.0.6"
26
+ },
27
+ "devDependencies": {
28
+ "tsx": "^4.22.4"
26
29
  },
27
30
  "publishConfig": {
28
31
  "access": "public"
@@ -57,6 +60,7 @@
57
60
  "./style.css"
58
61
  ],
59
62
  "scripts": {
60
- "build": "node ../../../scripts/build_package.mjs"
63
+ "build": "node ../../../scripts/build_package.mjs",
64
+ "test": "node --import tsx --test \"test/*.test.ts\""
61
65
  }
62
66
  }
package/style.css CHANGED
@@ -1,83 +1,83 @@
1
- @layer components {
2
- .recent-posts {
3
- margin-top: 4rem;
4
- padding-top: 1.5rem;
5
- border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
6
- }
7
-
8
- .recent-posts__header {
9
- display: grid;
10
- gap: 0.25rem;
11
- margin-bottom: 1.25rem;
12
- }
13
-
14
- .recent-posts__eyebrow {
15
- margin: 0;
16
- font-size: 0.75rem;
17
- font-weight: 700;
18
- letter-spacing: 0.12em;
19
- color: color-mix(in srgb, currentColor 54%, transparent);
20
- }
21
-
22
- .recent-posts__title {
23
- margin: 0;
24
- font-size: clamp(1.5rem, 4vw, 2rem);
25
- line-height: 1.2;
26
- letter-spacing: -0.02em;
27
- }
28
-
29
- .recent-posts__list {
30
- display: grid;
31
- margin: 0;
32
- padding: 0;
33
- border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent);
34
- list-style: none;
35
- }
36
-
37
- .recent-posts__item {
38
- margin: 0;
39
- padding: 0;
40
- border-bottom: 1px solid color-mix(in srgb, currentColor 14%, transparent);
41
- }
42
-
43
- .recent-posts__link {
44
- display: grid;
45
- gap: 0.375rem;
46
- padding: 1rem 0;
47
- color: inherit;
48
- text-decoration: none;
49
- transition:
50
- color 160ms ease,
51
- padding-inline 160ms ease;
52
- }
53
-
54
- .recent-posts__link:hover,
55
- .recent-posts__link:focus-visible {
56
- color: var(--rb-color-accent);
57
- }
58
-
59
- .recent-posts__link:focus-visible {
60
- outline: 2px solid var(--rb-color-accent);
61
- outline-offset: 4px;
62
- }
63
-
64
- .recent-posts__date {
65
- font-size: 0.75rem;
66
- font-weight: 700;
67
- letter-spacing: 0.08em;
68
- color: color-mix(in srgb, currentColor 62%, transparent);
69
- }
70
-
71
- .recent-posts__post-title {
72
- font-size: 1rem;
73
- line-height: 1.5;
74
- }
75
-
76
- @media (min-width: 40rem) {
77
- .recent-posts__link {
78
- grid-template-columns: 8rem minmax(0, 1fr);
79
- align-items: baseline;
80
- gap: 1.5rem;
81
- }
82
- }
83
- }
1
+ @layer components {
2
+ .recent-posts {
3
+ margin-top: 4rem;
4
+ padding-top: 1.5rem;
5
+ border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
6
+ }
7
+
8
+ .recent-posts__header {
9
+ display: grid;
10
+ gap: 0.25rem;
11
+ margin-bottom: 1.25rem;
12
+ }
13
+
14
+ .recent-posts__eyebrow {
15
+ margin: 0;
16
+ font-size: 0.75rem;
17
+ font-weight: 700;
18
+ letter-spacing: 0.12em;
19
+ color: color-mix(in srgb, currentColor 54%, transparent);
20
+ }
21
+
22
+ .recent-posts__title {
23
+ margin: 0;
24
+ font-size: clamp(1.5rem, 4vw, 2rem);
25
+ line-height: 1.2;
26
+ letter-spacing: -0.02em;
27
+ }
28
+
29
+ .recent-posts__list {
30
+ display: grid;
31
+ margin: 0;
32
+ padding: 0;
33
+ border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent);
34
+ list-style: none;
35
+ }
36
+
37
+ .recent-posts__item {
38
+ margin: 0;
39
+ padding: 0;
40
+ border-bottom: 1px solid color-mix(in srgb, currentColor 14%, transparent);
41
+ }
42
+
43
+ .recent-posts__link {
44
+ display: grid;
45
+ gap: 0.375rem;
46
+ padding: 1rem 0;
47
+ color: inherit;
48
+ text-decoration: none;
49
+ transition:
50
+ color 160ms ease,
51
+ padding-inline 160ms ease;
52
+ }
53
+
54
+ .recent-posts__link:hover,
55
+ .recent-posts__link:focus-visible {
56
+ color: var(--rb-color-accent);
57
+ }
58
+
59
+ .recent-posts__link:focus-visible {
60
+ outline: 2px solid var(--rb-color-accent);
61
+ outline-offset: 4px;
62
+ }
63
+
64
+ .recent-posts__date {
65
+ font-size: 0.75rem;
66
+ font-weight: 700;
67
+ letter-spacing: 0.08em;
68
+ color: color-mix(in srgb, currentColor 62%, transparent);
69
+ }
70
+
71
+ .recent-posts__post-title {
72
+ font-size: 1rem;
73
+ line-height: 1.5;
74
+ }
75
+
76
+ @media (min-width: 40rem) {
77
+ .recent-posts__link {
78
+ grid-template-columns: 8rem minmax(0, 1fr);
79
+ align-items: baseline;
80
+ gap: 1.5rem;
81
+ }
82
+ }
83
+ }