@cogita/theme-knowledge 0.3.0 → 0.3.1
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/dist/components/Relations.js +5 -5
- package/dist/layouts/Home.js +15 -15
- package/dist/layouts/Search.js +8 -8
- package/dist/layouts/Tag.js +9 -9
- package/dist/utils.js +2 -2
- package/package.json +5 -5
|
@@ -20,7 +20,7 @@ function RelationList(param) {
|
|
|
20
20
|
children: item.title
|
|
21
21
|
}),
|
|
22
22
|
/*#__PURE__*/ jsx("span", {
|
|
23
|
-
children: 'document' === item.kind ? t('knowledge.relations.document',
|
|
23
|
+
children: 'document' === item.kind ? t('knowledge.relations.document', 'Document') : t('knowledge.relations.post', 'Article')
|
|
24
24
|
})
|
|
25
25
|
]
|
|
26
26
|
}, `${title}-${item.route}`))
|
|
@@ -38,7 +38,7 @@ const Relations_Relations = ()=>{
|
|
|
38
38
|
if (0 === relation.outbound.length && 0 === relation.inbound.length) return null;
|
|
39
39
|
return /*#__PURE__*/ jsxs("aside", {
|
|
40
40
|
className: "knowledge-relations",
|
|
41
|
-
"aria-label": t('knowledge.relations.ariaLabel',
|
|
41
|
+
"aria-label": t('knowledge.relations.ariaLabel', 'Content relations'),
|
|
42
42
|
children: [
|
|
43
43
|
/*#__PURE__*/ jsxs("div", {
|
|
44
44
|
className: "knowledge-relations-heading",
|
|
@@ -47,7 +47,7 @@ const Relations_Relations = ()=>{
|
|
|
47
47
|
children: "Knowledge graph"
|
|
48
48
|
}),
|
|
49
49
|
/*#__PURE__*/ jsx("strong", {
|
|
50
|
-
children: t('knowledge.relations.continue',
|
|
50
|
+
children: t('knowledge.relations.continue', 'Continue exploring')
|
|
51
51
|
})
|
|
52
52
|
]
|
|
53
53
|
}),
|
|
@@ -55,12 +55,12 @@ const Relations_Relations = ()=>{
|
|
|
55
55
|
className: "knowledge-relations-groups",
|
|
56
56
|
children: [
|
|
57
57
|
/*#__PURE__*/ jsx(RelationList, {
|
|
58
|
-
title: t('knowledge.relations.outbound',
|
|
58
|
+
title: t('knowledge.relations.outbound', 'Links from this page'),
|
|
59
59
|
items: outbound,
|
|
60
60
|
base: base
|
|
61
61
|
}),
|
|
62
62
|
/*#__PURE__*/ jsx(RelationList, {
|
|
63
|
-
title: t('knowledge.relations.inbound',
|
|
63
|
+
title: t('knowledge.relations.inbound', 'Backlinks'),
|
|
64
64
|
items: inbound,
|
|
65
65
|
base: base
|
|
66
66
|
})
|
package/dist/layouts/Home.js
CHANGED
|
@@ -38,15 +38,15 @@ const HomeLayout = ()=>{
|
|
|
38
38
|
}),
|
|
39
39
|
/*#__PURE__*/ jsxs("nav", {
|
|
40
40
|
className: "knowledge-actions",
|
|
41
|
-
"aria-label": t('knowledge.home.navigation',
|
|
41
|
+
"aria-label": t('knowledge.home.navigation', 'Knowledge base navigation'),
|
|
42
42
|
children: [
|
|
43
43
|
/*#__PURE__*/ jsx("a", {
|
|
44
44
|
href: normalizeHrefInRuntime(getHref(base, '/search')),
|
|
45
|
-
children: t('knowledge.home.search',
|
|
45
|
+
children: t('knowledge.home.search', 'Search knowledge')
|
|
46
46
|
}),
|
|
47
47
|
/*#__PURE__*/ jsx("a", {
|
|
48
48
|
href: normalizeHrefInRuntime(getHref(base, `/${tagsConfig.routePrefix}`)),
|
|
49
|
-
children: t('knowledge.home.tags',
|
|
49
|
+
children: t('knowledge.home.tags', 'Browse tags')
|
|
50
50
|
})
|
|
51
51
|
]
|
|
52
52
|
})
|
|
@@ -54,7 +54,7 @@ const HomeLayout = ()=>{
|
|
|
54
54
|
}),
|
|
55
55
|
/*#__PURE__*/ jsxs("div", {
|
|
56
56
|
className: "knowledge-stats",
|
|
57
|
-
"aria-label": t('knowledge.home.stats',
|
|
57
|
+
"aria-label": t('knowledge.home.stats', 'Knowledge base statistics'),
|
|
58
58
|
children: [
|
|
59
59
|
/*#__PURE__*/ jsxs("div", {
|
|
60
60
|
children: [
|
|
@@ -62,7 +62,7 @@ const HomeLayout = ()=>{
|
|
|
62
62
|
children: searchDocuments.length
|
|
63
63
|
}),
|
|
64
64
|
/*#__PURE__*/ jsx("span", {
|
|
65
|
-
children: t('knowledge.home.contentEntries',
|
|
65
|
+
children: t('knowledge.home.contentEntries', 'Content entries')
|
|
66
66
|
})
|
|
67
67
|
]
|
|
68
68
|
}),
|
|
@@ -72,7 +72,7 @@ const HomeLayout = ()=>{
|
|
|
72
72
|
children: allTags.length
|
|
73
73
|
}),
|
|
74
74
|
/*#__PURE__*/ jsx("span", {
|
|
75
|
-
children: t('knowledge.home.topicTags',
|
|
75
|
+
children: t('knowledge.home.topicTags', 'Topic tags')
|
|
76
76
|
})
|
|
77
77
|
]
|
|
78
78
|
}),
|
|
@@ -82,7 +82,7 @@ const HomeLayout = ()=>{
|
|
|
82
82
|
children: relationCount
|
|
83
83
|
}),
|
|
84
84
|
/*#__PURE__*/ jsx("span", {
|
|
85
|
-
children: t('knowledge.home.contentLinks',
|
|
85
|
+
children: t('knowledge.home.contentLinks', 'Content links')
|
|
86
86
|
})
|
|
87
87
|
]
|
|
88
88
|
})
|
|
@@ -108,13 +108,13 @@ const HomeLayout = ()=>{
|
|
|
108
108
|
}),
|
|
109
109
|
/*#__PURE__*/ jsx("h2", {
|
|
110
110
|
id: "knowledge-recent-title",
|
|
111
|
-
children: t('knowledge.home.recentTitle',
|
|
111
|
+
children: t('knowledge.home.recentTitle', 'Recently updated')
|
|
112
112
|
})
|
|
113
113
|
]
|
|
114
114
|
}),
|
|
115
115
|
/*#__PURE__*/ jsx("a", {
|
|
116
116
|
href: normalizeHrefInRuntime(getHref(base, '/search')),
|
|
117
|
-
children: t('knowledge.home.viewAll', "
|
|
117
|
+
children: t('knowledge.home.viewAll', "View all \u2192")
|
|
118
118
|
})
|
|
119
119
|
]
|
|
120
120
|
}),
|
|
@@ -126,13 +126,13 @@ const HomeLayout = ()=>{
|
|
|
126
126
|
children: [
|
|
127
127
|
/*#__PURE__*/ jsx("span", {
|
|
128
128
|
className: "knowledge-entry-kind",
|
|
129
|
-
children: 'document' === entry.kind ? t('knowledge.home.document',
|
|
129
|
+
children: 'document' === entry.kind ? t('knowledge.home.document', 'Document') : t('knowledge.home.post', 'Article')
|
|
130
130
|
}),
|
|
131
131
|
/*#__PURE__*/ jsx("strong", {
|
|
132
132
|
children: entry.title
|
|
133
133
|
}),
|
|
134
134
|
/*#__PURE__*/ jsx("p", {
|
|
135
|
-
children: entry.description || entry.excerpt || t('knowledge.home.openEntry',
|
|
135
|
+
children: entry.description || entry.excerpt || t('knowledge.home.openEntry', 'Open entry to continue reading.')
|
|
136
136
|
}),
|
|
137
137
|
/*#__PURE__*/ jsx("small", {
|
|
138
138
|
children: entry.updateDate.slice(0, 10)
|
|
@@ -158,7 +158,7 @@ const HomeLayout = ()=>{
|
|
|
158
158
|
children: "Explore"
|
|
159
159
|
}),
|
|
160
160
|
/*#__PURE__*/ jsx("h2", {
|
|
161
|
-
children: t('knowledge.home.explore',
|
|
161
|
+
children: t('knowledge.home.explore', 'Explore by topic')
|
|
162
162
|
})
|
|
163
163
|
]
|
|
164
164
|
}),
|
|
@@ -189,16 +189,16 @@ const HomeLayout = ()=>{
|
|
|
189
189
|
children: t('knowledge.home.findAnything', 'Find anything')
|
|
190
190
|
}),
|
|
191
191
|
/*#__PURE__*/ jsx("h2", {
|
|
192
|
-
children: t('knowledge.home.findStart',
|
|
192
|
+
children: t('knowledge.home.findStart', 'Start with one keyword.')
|
|
193
193
|
}),
|
|
194
194
|
/*#__PURE__*/ jsx("p", {
|
|
195
|
-
children: t('knowledge.home.searchCount',
|
|
195
|
+
children: t('knowledge.home.searchCount', '{{count}} content entries indexed.', {
|
|
196
196
|
count: searchDocuments.length
|
|
197
197
|
})
|
|
198
198
|
}),
|
|
199
199
|
/*#__PURE__*/ jsx("a", {
|
|
200
200
|
href: normalizeHrefInRuntime(getHref(base, `/${searchConfig.routePrefix}`)),
|
|
201
|
-
children: t('knowledge.home.openSearch', "
|
|
201
|
+
children: t('knowledge.home.openSearch', "Open search \u2192")
|
|
202
202
|
})
|
|
203
203
|
]
|
|
204
204
|
})
|
package/dist/layouts/Search.js
CHANGED
|
@@ -48,19 +48,19 @@ const SearchLayout = ()=>{
|
|
|
48
48
|
]
|
|
49
49
|
}),
|
|
50
50
|
/*#__PURE__*/ jsx("h1", {
|
|
51
|
-
children: t('knowledge.search.title',
|
|
51
|
+
children: t('knowledge.search.title', 'Find the next relevant idea.')
|
|
52
52
|
}),
|
|
53
53
|
/*#__PURE__*/ jsx("p", {
|
|
54
|
-
children: t("knowledge.search.description",
|
|
54
|
+
children: t("knowledge.search.description", 'Search articles, documents, tags, and full-text content.')
|
|
55
55
|
}),
|
|
56
56
|
/*#__PURE__*/ jsx("input", {
|
|
57
57
|
type: "search",
|
|
58
58
|
value: query,
|
|
59
59
|
onChange: (event)=>setQuery(event.target.value),
|
|
60
|
-
placeholder: t('knowledge.search.placeholder',
|
|
60
|
+
placeholder: t('knowledge.search.placeholder', 'Enter at least {{count}} characters', {
|
|
61
61
|
count: searchConfig.minQueryLength
|
|
62
62
|
}),
|
|
63
|
-
"aria-label": t('knowledge.search.ariaLabel',
|
|
63
|
+
"aria-label": t('knowledge.search.ariaLabel', 'Search knowledge base')
|
|
64
64
|
})
|
|
65
65
|
]
|
|
66
66
|
}),
|
|
@@ -70,13 +70,13 @@ const SearchLayout = ()=>{
|
|
|
70
70
|
children: [
|
|
71
71
|
!meetsMinimumLength && /*#__PURE__*/ jsx("p", {
|
|
72
72
|
className: "knowledge-empty",
|
|
73
|
-
children: normalizedQuery ? t('knowledge.search.minLength',
|
|
73
|
+
children: normalizedQuery ? t('knowledge.search.minLength', 'Enter at least {{count}} characters.', {
|
|
74
74
|
count: searchConfig.minQueryLength
|
|
75
|
-
}) : t('knowledge.search.empty',
|
|
75
|
+
}) : t('knowledge.search.empty', 'Enter a keyword to explore.')
|
|
76
76
|
}),
|
|
77
77
|
meetsMinimumLength && 0 === results.length && /*#__PURE__*/ jsx("p", {
|
|
78
78
|
className: "knowledge-empty",
|
|
79
|
-
children: t('knowledge.search.noResults',
|
|
79
|
+
children: t('knowledge.search.noResults', 'No matching content found.')
|
|
80
80
|
}),
|
|
81
81
|
results.map((param)=>{
|
|
82
82
|
let { entry } = param;
|
|
@@ -85,7 +85,7 @@ const SearchLayout = ()=>{
|
|
|
85
85
|
className: "knowledge-search-result",
|
|
86
86
|
children: [
|
|
87
87
|
/*#__PURE__*/ jsx("span", {
|
|
88
|
-
children: 'document' === entry.kind ? t('knowledge.search.document',
|
|
88
|
+
children: 'document' === entry.kind ? t('knowledge.search.document', 'Document') : t('knowledge.search.post', 'Article')
|
|
89
89
|
}),
|
|
90
90
|
/*#__PURE__*/ jsx("h2", {
|
|
91
91
|
children: /*#__PURE__*/ jsx("a", {
|
package/dist/layouts/Tag.js
CHANGED
|
@@ -26,10 +26,10 @@ const TagLayout = ()=>{
|
|
|
26
26
|
]
|
|
27
27
|
}),
|
|
28
28
|
/*#__PURE__*/ jsx("h1", {
|
|
29
|
-
children: t('knowledge.tag.title',
|
|
29
|
+
children: t('knowledge.tag.title', 'Explore by topic')
|
|
30
30
|
}),
|
|
31
31
|
/*#__PURE__*/ jsx("p", {
|
|
32
|
-
children: t("knowledge.tag.description",
|
|
32
|
+
children: t("knowledge.tag.description", 'Tags gather scattered articles and documents into reusable knowledge entry points.')
|
|
33
33
|
})
|
|
34
34
|
]
|
|
35
35
|
}),
|
|
@@ -42,7 +42,7 @@ const TagLayout = ()=>{
|
|
|
42
42
|
children: item.name
|
|
43
43
|
}),
|
|
44
44
|
/*#__PURE__*/ jsx("span", {
|
|
45
|
-
children: t('knowledge.tag.contentCount',
|
|
45
|
+
children: t('knowledge.tag.contentCount', '{{count}} content items', {
|
|
46
46
|
count: item.count
|
|
47
47
|
})
|
|
48
48
|
})
|
|
@@ -56,10 +56,10 @@ const TagLayout = ()=>{
|
|
|
56
56
|
children: [
|
|
57
57
|
/*#__PURE__*/ jsx("a", {
|
|
58
58
|
href: normalizeHrefInRuntime(getHref(base, `/${prefix}`)),
|
|
59
|
-
children: t('knowledge.tag.back', "\u2190
|
|
59
|
+
children: t('knowledge.tag.back', "\u2190 Back to all topics")
|
|
60
60
|
}),
|
|
61
61
|
/*#__PURE__*/ jsx("h1", {
|
|
62
|
-
children: t('knowledge.tag.notFound',
|
|
62
|
+
children: t('knowledge.tag.notFound', 'Topic not found')
|
|
63
63
|
})
|
|
64
64
|
]
|
|
65
65
|
});
|
|
@@ -72,7 +72,7 @@ const TagLayout = ()=>{
|
|
|
72
72
|
children: [
|
|
73
73
|
/*#__PURE__*/ jsx("a", {
|
|
74
74
|
href: normalizeHrefInRuntime(getHref(base, `/${prefix}`)),
|
|
75
|
-
children: t('knowledge.tag.back', "\u2190
|
|
75
|
+
children: t('knowledge.tag.back', "\u2190 Back to all topics")
|
|
76
76
|
}),
|
|
77
77
|
/*#__PURE__*/ jsx("p", {
|
|
78
78
|
className: "knowledge-eyebrow",
|
|
@@ -85,7 +85,7 @@ const TagLayout = ()=>{
|
|
|
85
85
|
]
|
|
86
86
|
}),
|
|
87
87
|
/*#__PURE__*/ jsx("p", {
|
|
88
|
-
children: t('knowledge.tag.around',
|
|
88
|
+
children: t('knowledge.tag.around', '{{count}} content items revolve around this topic.', {
|
|
89
89
|
count: tag.count
|
|
90
90
|
})
|
|
91
91
|
})
|
|
@@ -100,7 +100,7 @@ const TagLayout = ()=>{
|
|
|
100
100
|
children: entry.title
|
|
101
101
|
}),
|
|
102
102
|
/*#__PURE__*/ jsx("span", {
|
|
103
|
-
children: entry.description || t('knowledge.tag.open',
|
|
103
|
+
children: entry.description || t('knowledge.tag.open', 'Open entry to continue reading.')
|
|
104
104
|
})
|
|
105
105
|
]
|
|
106
106
|
}, entry.route))
|
|
@@ -109,7 +109,7 @@ const TagLayout = ()=>{
|
|
|
109
109
|
className: "knowledge-related-tags",
|
|
110
110
|
children: [
|
|
111
111
|
/*#__PURE__*/ jsx("h2", {
|
|
112
|
-
children: t('knowledge.tag.related',
|
|
112
|
+
children: t('knowledge.tag.related', 'Related topics')
|
|
113
113
|
}),
|
|
114
114
|
/*#__PURE__*/ jsx("div", {
|
|
115
115
|
children: relatedTags.map((item)=>/*#__PURE__*/ jsxs("a", {
|
package/dist/utils.js
CHANGED
|
@@ -14,8 +14,8 @@ function getKnowledgeCopy(pageData) {
|
|
|
14
14
|
var _pageData_siteData, _pageData_siteData1;
|
|
15
15
|
return {
|
|
16
16
|
title: (null == pageData ? void 0 : null == (_pageData_siteData = pageData.siteData) ? void 0 : _pageData_siteData.title) || 'Cogita Knowledge Base',
|
|
17
|
-
description: (null == pageData ? void 0 : null == (_pageData_siteData1 = pageData.siteData) ? void 0 : _pageData_siteData1.description) ||
|
|
18
|
-
lead: t('knowledge.home.lead',
|
|
17
|
+
description: (null == pageData ? void 0 : null == (_pageData_siteData1 = pageData.siteData) ? void 0 : _pageData_siteData1.description) || 'Organize articles, documents, and their connections into an explorable knowledge space.',
|
|
18
|
+
lead: t('knowledge.home.lead', 'Use one content index to connect articles and documents, so every reading can lead to the next relevant idea.')
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
export { getBase, getHref, getKnowledgeCopy, getPageRoute };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cogita/theme-knowledge",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Cogita 的知识库主题,组合统一内容索引、搜索、标签和内容关系。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cogita",
|
|
@@ -57,16 +57,16 @@
|
|
|
57
57
|
"react-dom": "^19.1.1",
|
|
58
58
|
"rsbuild-plugin-publint": "^0.3.3",
|
|
59
59
|
"typescript": "^5.0.4",
|
|
60
|
-
"@cogita/
|
|
61
|
-
"@cogita/
|
|
60
|
+
"@cogita/shared": "0.13.0",
|
|
61
|
+
"@cogita/config": "0.0.0"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@cogita/plugin-content-check": "0.2.5",
|
|
65
65
|
"@cogita/plugin-content-relations": "0.2.1",
|
|
66
|
-
"@cogita/plugin-i18n": "0.
|
|
67
|
-
"@cogita/plugin-posts-frontmatter": "0.1.6",
|
|
66
|
+
"@cogita/plugin-i18n": "0.3.0",
|
|
68
67
|
"@cogita/plugin-search": "0.2.7",
|
|
69
68
|
"@cogita/plugin-tags": "1.0.7",
|
|
69
|
+
"@cogita/plugin-posts-frontmatter": "0.1.6",
|
|
70
70
|
"@cogita/shared": "0.13.0"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|