erudit 3.0.0-dev.13 → 3.0.0-dev.14
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.
|
@@ -16,7 +16,7 @@ const paneVisible = defineModel<boolean>('pane');
|
|
|
16
16
|
const issueLink = computed(() => {
|
|
17
17
|
const ghRepositorty = eruditConfig.repository;
|
|
18
18
|
return ghRepositorty
|
|
19
|
-
? `https://github.com/${ghRepositorty.name}/issues
|
|
19
|
+
? `https://github.com/${ghRepositorty.name}/issues/new/choose`
|
|
20
20
|
: null;
|
|
21
21
|
});
|
|
22
22
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "erudit",
|
|
3
|
-
"version": "3.0.0-dev.
|
|
3
|
+
"version": "3.0.0-dev.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "🤓 CMS for perfect educational sites.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"erudit": "bin/erudit.mjs"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"@erudit-js/cog": "3.0.0-dev.
|
|
19
|
-
"@erudit-js/cli": "3.0.0-dev.
|
|
20
|
-
"@erudit-js/bitran-elements": "3.0.0-dev.
|
|
18
|
+
"@erudit-js/cog": "3.0.0-dev.14",
|
|
19
|
+
"@erudit-js/cli": "3.0.0-dev.14",
|
|
20
|
+
"@erudit-js/bitran-elements": "3.0.0-dev.14"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@bitran-js/core": "1.0.0-dev.13",
|
|
@@ -7,10 +7,7 @@ import {
|
|
|
7
7
|
getPreviousNext,
|
|
8
8
|
} from '@server/repository/content';
|
|
9
9
|
import { getTopicPartsLinks } from '@server/repository/topic';
|
|
10
|
-
import {
|
|
11
|
-
getFullContentId,
|
|
12
|
-
getShortContentId,
|
|
13
|
-
} from '@server/repository/contentId';
|
|
10
|
+
import { getFullContentId } from '@server/repository/contentId';
|
|
14
11
|
|
|
15
12
|
export default defineEventHandler(async (event) => {
|
|
16
13
|
const query = getQuery<{ path: string }>(event);
|
|
@@ -72,7 +69,7 @@ async function createContentData(
|
|
|
72
69
|
path: string,
|
|
73
70
|
): Promise<AsideMinorContent> {
|
|
74
71
|
const rawContentId = path.split('/').slice(1).join('/');
|
|
75
|
-
const contentId =
|
|
72
|
+
const contentId = getFullContentId(rawContentId);
|
|
76
73
|
const previousNext = await getPreviousNext(contentId);
|
|
77
74
|
const contributors = await getContentContributors(contentId);
|
|
78
75
|
|
|
@@ -140,7 +140,12 @@ async function createBitranContent(
|
|
|
140
140
|
mergeAliases(context.aliases, node.parseData);
|
|
141
141
|
break;
|
|
142
142
|
case node instanceof IncludeNode:
|
|
143
|
-
await resolveInclude(node, context);
|
|
143
|
+
const includeNode = await resolveInclude(node, context);
|
|
144
|
+
await walkDown(includeNode, async (child) => {
|
|
145
|
+
if (child instanceof ElementNode) {
|
|
146
|
+
await makePreRender(child);
|
|
147
|
+
}
|
|
148
|
+
});
|
|
144
149
|
break;
|
|
145
150
|
case node instanceof BlockErrorNode:
|
|
146
151
|
case node instanceof InlinerErrorNode:
|
|
@@ -149,16 +154,6 @@ async function createBitranContent(
|
|
|
149
154
|
}
|
|
150
155
|
|
|
151
156
|
await makePreRender(node);
|
|
152
|
-
|
|
153
|
-
if (node instanceof IncludeNode) {
|
|
154
|
-
for (const block of node.parseData.blocks?.children || []) {
|
|
155
|
-
await walkDown(block, async (child) => {
|
|
156
|
-
if (child instanceof ElementNode) {
|
|
157
|
-
await makePreRender(child);
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
157
|
},
|
|
163
158
|
});
|
|
164
159
|
|
|
@@ -8,6 +8,7 @@ import { getContentContext } from '@server/content/context';
|
|
|
8
8
|
import { DbContributor } from '@server/db/entities/Contributor';
|
|
9
9
|
import { getIdsUp, getPreviousNextNav } from '@server/nav/utils';
|
|
10
10
|
import {
|
|
11
|
+
getFullContentId,
|
|
11
12
|
getShortContentId,
|
|
12
13
|
resolveClientContentId,
|
|
13
14
|
} from '@server/repository/contentId';
|
|
@@ -238,3 +239,11 @@ export async function getContentContributors(contentId: string) {
|
|
|
238
239
|
|
|
239
240
|
return contentContributors.length ? contentContributors : undefined;
|
|
240
241
|
}
|
|
242
|
+
|
|
243
|
+
export async function getContentFsPath(contentId: string) {
|
|
244
|
+
const fullContentId = getFullContentId(contentId);
|
|
245
|
+
const dbContent = await ERUDIT_SERVER.DB.manager.findOne(DbContent, {
|
|
246
|
+
select: ['type'],
|
|
247
|
+
where: { contentId: fullContentId },
|
|
248
|
+
});
|
|
249
|
+
}
|