@anywayseo/gatsby-plugin 2.6.1 → 2.7.0
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 +1 -1
- package/utils/create-pages/mdx/index.js +2 -2
- package/utils/create-pages/slug.d.ts +4 -2
- package/utils/create-pages/slug.js +28 -4
- package/utils/create-pages/strapi/index.js +3 -3
- package/utils/strapi-source/schema/collections/partner.d.ts +1 -0
- package/utils/strapi-source/schema/collections/partner.js +10 -0
- package/utils/strapi-source/schema/components/content.d.ts +1 -1
- package/utils/strapi-source/schema/components/content.js +18 -2
- package/utils/strapi-source/schema/index.js +2 -1
- package/utils/strapi-source/strapi-content/index.js +6 -0
package/package.json
CHANGED
|
@@ -52,7 +52,7 @@ function createMdxPages(_a, root_1) {
|
|
|
52
52
|
const slug = frontmatter === null || frontmatter === void 0 ? void 0 : frontmatter.slug;
|
|
53
53
|
const contentFilePath = internal.contentFilePath;
|
|
54
54
|
if (slug && contentFilePath) {
|
|
55
|
-
const existingPage = strapiPages.find((strapiPage) => (0, slug_1.
|
|
55
|
+
const existingPage = strapiPages.find((strapiPage) => (0, slug_1.isEqualSlug)(strapiPage === null || strapiPage === void 0 ? void 0 : strapiPage.slug, slug));
|
|
56
56
|
if (!!existingPage) {
|
|
57
57
|
reporter.warn(`Skipping MDX page creation: "${slug}" already exists`);
|
|
58
58
|
return;
|
|
@@ -60,7 +60,7 @@ function createMdxPages(_a, root_1) {
|
|
|
60
60
|
const mdxPageTemplate = (0, path_1.resolve)(root, `./src/templates/mdx-page.jsx`);
|
|
61
61
|
const component = `${mdxPageTemplate}?__contentFilePath=${contentFilePath}`;
|
|
62
62
|
actions.createPage({
|
|
63
|
-
path:
|
|
63
|
+
path: (0, slug_1.buildPath)(slug),
|
|
64
64
|
component,
|
|
65
65
|
context: { slug },
|
|
66
66
|
});
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
export declare function
|
|
1
|
+
export declare function buildPath(slug?: string | null, locale?: string | null, defaultLocale?: string | null): string;
|
|
2
|
+
export declare function isEqualSlug(a?: string | null, b?: string | null): boolean;
|
|
3
|
+
export declare function isEmptyPage(title?: string | null, slug?: string | null): boolean;
|
|
4
|
+
export declare function isDummyPage(slug?: string | null): boolean;
|
|
@@ -1,8 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
3
|
+
exports.buildPath = buildPath;
|
|
4
|
+
exports.isEqualSlug = isEqualSlug;
|
|
5
|
+
exports.isEmptyPage = isEmptyPage;
|
|
6
|
+
exports.isDummyPage = isDummyPage;
|
|
7
|
+
const INDEX_PAGE_SLUG = 'index';
|
|
8
|
+
const DUMMY_PAGE_SLUG = 'dummy';
|
|
6
9
|
function normalizeSlug(slug) {
|
|
7
|
-
|
|
10
|
+
if (!slug || slug === INDEX_PAGE_SLUG) {
|
|
11
|
+
return '';
|
|
12
|
+
}
|
|
13
|
+
return slug.toLowerCase();
|
|
14
|
+
}
|
|
15
|
+
function normalizeLocale(locale) {
|
|
16
|
+
return (locale !== null && locale !== void 0 ? locale : '').toLowerCase();
|
|
17
|
+
}
|
|
18
|
+
function buildPath(slug, locale, defaultLocale) {
|
|
19
|
+
const normalizedLocale = normalizeLocale(locale);
|
|
20
|
+
const normalizedDefaultLocale = normalizeLocale(defaultLocale);
|
|
21
|
+
const localePrefix = normalizedLocale === normalizedDefaultLocale ? '/' : `/${normalizedLocale}/`;
|
|
22
|
+
return `${localePrefix}${normalizeSlug(slug)}`;
|
|
23
|
+
}
|
|
24
|
+
function isEqualSlug(a, b) {
|
|
25
|
+
return normalizeSlug(a) === normalizeSlug(b);
|
|
26
|
+
}
|
|
27
|
+
function isEmptyPage(title, slug) {
|
|
28
|
+
return !title && !slug;
|
|
29
|
+
}
|
|
30
|
+
function isDummyPage(slug) {
|
|
31
|
+
return normalizeSlug(slug) === DUMMY_PAGE_SLUG;
|
|
8
32
|
}
|
|
@@ -44,17 +44,17 @@ function createStrapiPages(_a, root_1) {
|
|
|
44
44
|
reporter.info(`Found ${strapiPages.length} Strapi pages`);
|
|
45
45
|
let pageCount = 0;
|
|
46
46
|
strapiPages.forEach(({ id, slug, title, locale }) => {
|
|
47
|
-
if (
|
|
47
|
+
if ((0, slug_1.isDummyPage)(slug)) {
|
|
48
48
|
reporter.warn('Skipping page creation: dummy page detected');
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
if (
|
|
51
|
+
if ((0, slug_1.isEmptyPage)(title, slug)) {
|
|
52
52
|
reporter.warn('Skipping page creation: empty page detected');
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
55
|
const strapiPageTemplate = (0, path_1.resolve)(root, `./src/templates/strapi-page.tsx`);
|
|
56
56
|
actions.createPage({
|
|
57
|
-
path:
|
|
57
|
+
path: (0, slug_1.buildPath)(slug, locale, defaultLocale),
|
|
58
58
|
component: strapiPageTemplate,
|
|
59
59
|
context: { id },
|
|
60
60
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const partner = "\n # === PARTNER DEFINITION ===\n type Partner {\n name: String!\n refLink: String\n }\n ";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const content = "\n # === COMPONENT DEFINITIONS ===\n union ContentComponent =\n STRAPI__COMPONENT_CONTENT_CONTACTS_PAGE\n | STRAPI__COMPONENT_CONTENT_COOKIE_POLICY_PAGE \n | STRAPI__COMPONENT_CONTENT_FAQ\n | STRAPI__COMPONENT_CONTENT_FEATURES\n | STRAPI__COMPONENT_CONTENT_GAME_CARDS\n | STRAPI__COMPONENT_CONTENT_GAME_CARD_TABS\n | STRAPI__COMPONENT_CONTENT_GAME_DEMO\n | STRAPI__COMPONENT_CONTENT_GAME_INFO\n | STRAPI__COMPONENT_CONTENT_HOW_TO\n | STRAPI__COMPONENT_CONTENT_LIST\n | STRAPI__COMPONENT_CONTENT_MEDIA\n | STRAPI__COMPONENT_CONTENT_PRIVACY_POLICY_PAGE\n | STRAPI__COMPONENT_CONTENT_PROS_CONS\n | STRAPI__COMPONENT_CONTENT_RICH_TEXT\n | STRAPI__COMPONENT_CONTENT_TABLE\n | STRAPI__COMPONENT_CONTENT_TERMS_CONDITIONS_PAGE\n | STRAPI__COMPONENT_CONTENT_TIP\n\n # === CONTACTS ===\n type STRAPI__COMPONENT_CONTENT_CONTACTS_PAGE @dontInfer {\n id: ID\n }\n\n # === COOKIE_POLICY ===\n type STRAPI__COMPONENT_CONTENT_COOKIE_POLICY_PAGE @dontInfer {\n id: ID\n }\n\n # === FAQ ===\n type STRAPI__COMPONENT_CONTENT_FAQ @dontInfer {\n items: [FaqItem!]\n }\n\n # === FEATURES ===\n type STRAPI__COMPONENT_CONTENT_FEATURES @dontInfer {\n items: [FeaturesItem!]\n }\n\n # === GAME CARDS ===\n type STRAPI__COMPONENT_CONTENT_GAME_CARDS @dontInfer {\n items: [GameCard!]\n order: String!\n randomSeed: Int\n cardHeight: String\n }\n\n # === GAME CARD TABS ===\n type STRAPI__COMPONENT_CONTENT_GAME_CARD_TABS @dontInfer {\n items: [GameCardTab!]\n }\n\n # === GAME_DEMO ===\n type STRAPI__COMPONENT_CONTENT_GAME_DEMO @dontInfer {\n name: String!\n src: String
|
|
1
|
+
export declare const content = "\n # === COMPONENT DEFINITIONS ===\n union ContentComponent =\n STRAPI__COMPONENT_CONTENT_ACTION_BUTTON\n | STRAPI__COMPONENT_CONTENT_CONTACTS_PAGE\n | STRAPI__COMPONENT_CONTENT_COOKIE_POLICY_PAGE \n | STRAPI__COMPONENT_CONTENT_FAQ\n | STRAPI__COMPONENT_CONTENT_FEATURES\n | STRAPI__COMPONENT_CONTENT_GAME_CARDS\n | STRAPI__COMPONENT_CONTENT_GAME_CARD_TABS\n | STRAPI__COMPONENT_CONTENT_GAME_DEMO\n | STRAPI__COMPONENT_CONTENT_GAME_INFO\n | STRAPI__COMPONENT_CONTENT_HOW_TO\n | STRAPI__COMPONENT_CONTENT_INFORMER\n | STRAPI__COMPONENT_CONTENT_LIST\n | STRAPI__COMPONENT_CONTENT_MEDIA\n | STRAPI__COMPONENT_CONTENT_PRIVACY_POLICY_PAGE\n | STRAPI__COMPONENT_CONTENT_PROS_CONS\n | STRAPI__COMPONENT_CONTENT_RICH_TEXT\n | STRAPI__COMPONENT_CONTENT_TABLE\n | STRAPI__COMPONENT_CONTENT_TERMS_CONDITIONS_PAGE\n | STRAPI__COMPONENT_CONTENT_TIP\n\n # === ACTION_BUTTON ===\n type STRAPI__COMPONENT_CONTENT_ACTION_BUTTON @dontInfer {\n label: String!\n url: String!\n }\n\n # === CONTACTS ===\n type STRAPI__COMPONENT_CONTENT_CONTACTS_PAGE @dontInfer {\n id: ID\n }\n\n # === COOKIE_POLICY ===\n type STRAPI__COMPONENT_CONTENT_COOKIE_POLICY_PAGE @dontInfer {\n id: ID\n }\n\n # === FAQ ===\n type STRAPI__COMPONENT_CONTENT_FAQ @dontInfer {\n items: [FaqItem!]\n }\n\n # === FEATURES ===\n type STRAPI__COMPONENT_CONTENT_FEATURES @dontInfer {\n items: [FeaturesItem!]\n }\n\n # === GAME CARDS ===\n type STRAPI__COMPONENT_CONTENT_GAME_CARDS @dontInfer {\n items: [GameCard!]\n order: String!\n randomSeed: Int\n cardHeight: String\n }\n\n # === GAME CARD TABS ===\n type STRAPI__COMPONENT_CONTENT_GAME_CARD_TABS @dontInfer {\n items: [GameCardTab!]\n }\n\n # === GAME_DEMO ===\n type STRAPI__COMPONENT_CONTENT_GAME_DEMO @dontInfer {\n name: String!\n src: String\n href: String\n previewImage: Image!\n partner: Partner\n }\n\n # === GAME_INFO ===\n type STRAPI__COMPONENT_CONTENT_GAME_INFO @dontInfer {\n general: GameInfoGeneral\n features: GameInfoFeatures\n currency: CurrencyList\n }\n\n # === INFORMER ===\n type STRAPI__COMPONENT_CONTENT_INFORMER @dontInfer {\n type: String!\n text: String!\n author: Author\n }\n\n # === HOW_TO ===\n type STRAPI__COMPONENT_CONTENT_HOW_TO @dontInfer {\n steps: [HowToStep!]\n }\n\n # === LIST ===\n type STRAPI__COMPONENT_CONTENT_LIST @dontInfer {\n bullet: String\n content: JsonValue\n }\n\n # === MEDIA ===\n type STRAPI__COMPONENT_CONTENT_MEDIA @dontInfer {\n file: Image\n }\n\n # === PRIVACY_POLICY ===\n type STRAPI__COMPONENT_CONTENT_PRIVACY_POLICY_PAGE @dontInfer {\n contactsSlug: String\n }\n\n # === PROS_CONS ===\n type STRAPI__COMPONENT_CONTENT_PROS_CONS @dontInfer {\n pros: [ProsConsItem!]\n cons: [ProsConsItem!]\n }\n\n # === RICH_TEXT ===\n type STRAPI__COMPONENT_CONTENT_RICH_TEXT @dontInfer {\n content: RichTextContent\n }\n\n # === TABLE ===\n type STRAPI__COMPONENT_CONTENT_TABLE @dontInfer {\n columnNumber: Int!\n content: JsonValue\n caption: String\n striped: Boolean\n bordered: Boolean\n scrollable: Boolean\n }\n\n # === TERMS_CONDITIONS ===\n type STRAPI__COMPONENT_CONTENT_TERMS_CONDITIONS_PAGE @dontInfer {\n privacyPolicySlug: String\n }\n\n # === TIP ===\n type STRAPI__COMPONENT_CONTENT_TIP @dontInfer {\n tip: String!\n author: Author\n }\n ";
|
|
@@ -4,7 +4,8 @@ exports.content = void 0;
|
|
|
4
4
|
exports.content = `
|
|
5
5
|
# === COMPONENT DEFINITIONS ===
|
|
6
6
|
union ContentComponent =
|
|
7
|
-
|
|
7
|
+
STRAPI__COMPONENT_CONTENT_ACTION_BUTTON
|
|
8
|
+
| STRAPI__COMPONENT_CONTENT_CONTACTS_PAGE
|
|
8
9
|
| STRAPI__COMPONENT_CONTENT_COOKIE_POLICY_PAGE
|
|
9
10
|
| STRAPI__COMPONENT_CONTENT_FAQ
|
|
10
11
|
| STRAPI__COMPONENT_CONTENT_FEATURES
|
|
@@ -13,6 +14,7 @@ exports.content = `
|
|
|
13
14
|
| STRAPI__COMPONENT_CONTENT_GAME_DEMO
|
|
14
15
|
| STRAPI__COMPONENT_CONTENT_GAME_INFO
|
|
15
16
|
| STRAPI__COMPONENT_CONTENT_HOW_TO
|
|
17
|
+
| STRAPI__COMPONENT_CONTENT_INFORMER
|
|
16
18
|
| STRAPI__COMPONENT_CONTENT_LIST
|
|
17
19
|
| STRAPI__COMPONENT_CONTENT_MEDIA
|
|
18
20
|
| STRAPI__COMPONENT_CONTENT_PRIVACY_POLICY_PAGE
|
|
@@ -22,6 +24,12 @@ exports.content = `
|
|
|
22
24
|
| STRAPI__COMPONENT_CONTENT_TERMS_CONDITIONS_PAGE
|
|
23
25
|
| STRAPI__COMPONENT_CONTENT_TIP
|
|
24
26
|
|
|
27
|
+
# === ACTION_BUTTON ===
|
|
28
|
+
type STRAPI__COMPONENT_CONTENT_ACTION_BUTTON @dontInfer {
|
|
29
|
+
label: String!
|
|
30
|
+
url: String!
|
|
31
|
+
}
|
|
32
|
+
|
|
25
33
|
# === CONTACTS ===
|
|
26
34
|
type STRAPI__COMPONENT_CONTENT_CONTACTS_PAGE @dontInfer {
|
|
27
35
|
id: ID
|
|
@@ -58,9 +66,10 @@ exports.content = `
|
|
|
58
66
|
# === GAME_DEMO ===
|
|
59
67
|
type STRAPI__COMPONENT_CONTENT_GAME_DEMO @dontInfer {
|
|
60
68
|
name: String!
|
|
61
|
-
src: String
|
|
69
|
+
src: String
|
|
62
70
|
href: String
|
|
63
71
|
previewImage: Image!
|
|
72
|
+
partner: Partner
|
|
64
73
|
}
|
|
65
74
|
|
|
66
75
|
# === GAME_INFO ===
|
|
@@ -70,6 +79,13 @@ exports.content = `
|
|
|
70
79
|
currency: CurrencyList
|
|
71
80
|
}
|
|
72
81
|
|
|
82
|
+
# === INFORMER ===
|
|
83
|
+
type STRAPI__COMPONENT_CONTENT_INFORMER @dontInfer {
|
|
84
|
+
type: String!
|
|
85
|
+
text: String!
|
|
86
|
+
author: Author
|
|
87
|
+
}
|
|
88
|
+
|
|
73
89
|
# === HOW_TO ===
|
|
74
90
|
type STRAPI__COMPONENT_CONTENT_HOW_TO @dontInfer {
|
|
75
91
|
steps: [HowToStep!]
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.typeDefs = void 0;
|
|
4
4
|
const author_1 = require("./collections/author");
|
|
5
5
|
const page_1 = require("./collections/page");
|
|
6
|
+
const partner_1 = require("./collections/partner");
|
|
6
7
|
const base_1 = require("./components/base");
|
|
7
8
|
const content_1 = require("./components/content");
|
|
8
9
|
const shared_1 = require("./components/shared");
|
|
@@ -10,4 +11,4 @@ const primitives_1 = require("./primitives");
|
|
|
10
11
|
const localization_1 = require("./single/localization");
|
|
11
12
|
const navigation_1 = require("./single/navigation");
|
|
12
13
|
const site_1 = require("./single/site");
|
|
13
|
-
exports.typeDefs = [author_1.author, page_1.page, base_1.base, content_1.content, shared_1.shared, primitives_1.primitives, localization_1.localization, navigation_1.navigation, site_1.site].join('\n');
|
|
14
|
+
exports.typeDefs = [author_1.author, page_1.page, partner_1.partner, base_1.base, content_1.content, shared_1.shared, primitives_1.primitives, localization_1.localization, navigation_1.navigation, site_1.site].join('\n');
|
|
@@ -52,6 +52,9 @@ function sourceStrapiContentNode(args, strapiClient, config) {
|
|
|
52
52
|
},
|
|
53
53
|
content: {
|
|
54
54
|
on: {
|
|
55
|
+
'content.action-button': {
|
|
56
|
+
populate: '*',
|
|
57
|
+
},
|
|
55
58
|
'content.contacts-page': {
|
|
56
59
|
populate: '*',
|
|
57
60
|
},
|
|
@@ -109,6 +112,9 @@ function sourceStrapiContentNode(args, strapiClient, config) {
|
|
|
109
112
|
},
|
|
110
113
|
},
|
|
111
114
|
},
|
|
115
|
+
'content.informer': {
|
|
116
|
+
populate: '*',
|
|
117
|
+
},
|
|
112
118
|
'content.list': {
|
|
113
119
|
populate: '*',
|
|
114
120
|
},
|