erudit 3.0.0-dev.11 → 3.0.0-dev.13
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/app/components/SiteMain.vue +1 -1
- package/app/components/aside/major/panes/nav/Nav.vue +11 -6
- package/app/components/aside/major/panes/nav/NavBook.vue +19 -11
- package/app/components/aside/major/panes/nav/fnav/FNavFlags.vue +1 -1
- package/app/components/aside/minor/Contribute.vue +2 -2
- package/app/components/aside/minor/content/AsideMinorContent.vue +1 -1
- package/app/components/aside/minor/topic/AsideMinorTopic.vue +1 -1
- package/app/components/aside/minor/topic/TopicContributors.vue +2 -2
- package/app/components/aside/minor/topic/TopicToc.vue +1 -6
- package/app/components/aside/minor/topic/TopicTocItem.vue +3 -1
- package/app/components/main/utils/Breadcrumb.vue +1 -1
- package/app/components/main/utils/ContentReferences.vue +1 -1
- package/app/components/main/utils/reference/ReferenceGroup.vue +1 -1
- package/app/components/main/utils/reference/ReferenceItem.vue +5 -3
- package/app/components/main/utils/reference/ReferenceSource.vue +6 -4
- package/app/components/preview/PreviewScreen.vue +2 -2
- package/app/components/preview/display/PageLink.vue +1 -1
- package/app/composables/bitranContent.ts +2 -3
- package/app/composables/contentPage.ts +8 -7
- package/app/composables/formatText.ts +21 -8
- package/app/composables/phrases.ts +0 -16
- package/app/plugins/prerender.server.ts +22 -0
- package/app/scripts/preview/build.ts +1 -5
- package/app/scripts/preview/data/pageLink.ts +1 -0
- package/app/styles/normalize.scss +0 -14
- package/globals/content.ts +5 -0
- package/module/imports.ts +1 -0
- package/nuxt.config.ts +10 -5
- package/package.json +8 -8
- package/server/api/aside/major/nav/bookIds.ts +2 -2
- package/server/api/aside/minor/path.ts +19 -11
- package/server/api/bitran/content/[...location].ts +4 -2
- package/server/api/bitran/toc/[...location].ts +4 -2
- package/server/api/content/data.ts +5 -2
- package/server/api/prerender.ts +120 -0
- package/server/api/preview/page/[...parts].ts +30 -4
- package/server/api/preview/unique/{[location].ts → [...location].ts} +4 -3
- package/server/plugin/bitran/content.ts +3 -16
- package/server/plugin/bitran/elements/include.ts +40 -36
- package/server/plugin/bitran/location.ts +24 -10
- package/server/plugin/bitran/toc.ts +7 -2
- package/server/plugin/bitran/transpiler.ts +10 -1
- package/server/plugin/build/jobs/content/generic.ts +5 -6
- package/server/plugin/build/jobs/content/parse.ts +5 -1
- package/server/plugin/build/jobs/content/type/group.ts +2 -2
- package/server/plugin/build/jobs/content/type/topic.ts +2 -2
- package/server/plugin/build/jobs/nav.ts +28 -15
- package/server/plugin/content/context.ts +5 -2
- package/server/plugin/db/entities/Content.ts +0 -4
- package/server/plugin/db/setup.ts +1 -1
- package/server/plugin/importer.ts +5 -1
- package/server/plugin/nav/node.ts +2 -1
- package/server/plugin/nav/utils.ts +66 -24
- package/server/plugin/repository/content.ts +26 -23
- package/server/plugin/repository/contentId.ts +40 -0
- package/server/plugin/repository/frontNav.ts +6 -9
- package/server/plugin/repository/topic.ts +4 -1
- package/shared/aside/minor.ts +2 -2
- package/shared/bitran/contentId.ts +12 -44
- package/shared/content/bookId.ts +12 -0
- package/shared/frontNav.ts +1 -1
- package/test/contentId.test.ts +10 -10
package/shared/frontNav.ts
CHANGED
package/test/contentId.test.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
toAbsoluteContentPath,
|
|
3
3
|
resolveContentPath,
|
|
4
4
|
} from '@erudit/shared/bitran/contentId';
|
|
5
5
|
|
|
@@ -54,23 +54,23 @@ describe('resolveContentPath', () => {
|
|
|
54
54
|
});
|
|
55
55
|
});
|
|
56
56
|
|
|
57
|
-
describe('
|
|
57
|
+
describe('toAbsoluteContentPath', () => {
|
|
58
58
|
const bookIds = ['combinatorics', 'group/book'];
|
|
59
59
|
|
|
60
60
|
it('should not use context on absolute paths', () => {
|
|
61
|
-
expect(
|
|
62
|
-
'foo/baz',
|
|
63
|
-
);
|
|
61
|
+
expect(
|
|
62
|
+
toAbsoluteContentPath('/foo/bar/../baz', 'qux/vaz', bookIds),
|
|
63
|
+
).toBe('foo/baz');
|
|
64
64
|
});
|
|
65
65
|
|
|
66
66
|
it('should fallback to absolute path if not inside book', () => {
|
|
67
|
-
expect(
|
|
68
|
-
'foo/bar',
|
|
69
|
-
);
|
|
67
|
+
expect(
|
|
68
|
+
toAbsoluteContentPath('~/foo/bar', 'unknown-book', bookIds),
|
|
69
|
+
).toBe('foo/bar');
|
|
70
70
|
});
|
|
71
71
|
|
|
72
72
|
it('should correctly handle book-relative paths', () => {
|
|
73
|
-
expect(
|
|
73
|
+
expect(toAbsoluteContentPath('~/foo/bar', 'group/book', bookIds)).toBe(
|
|
74
74
|
'group/book/foo/bar',
|
|
75
75
|
);
|
|
76
76
|
});
|
|
@@ -83,7 +83,7 @@ describe('toAbsoluteContentId', () => {
|
|
|
83
83
|
];
|
|
84
84
|
|
|
85
85
|
for (const [contentId, context, expected] of testCases) {
|
|
86
|
-
expect(
|
|
86
|
+
expect(toAbsoluteContentPath(contentId!, context!, bookIds)).toBe(
|
|
87
87
|
expected,
|
|
88
88
|
);
|
|
89
89
|
}
|