strapi-layout-plugin 1.0.2 → 1.0.4
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/server/bootstrap.js +43 -0
- package/server/components/index.js +10 -0
- package/server/components/shared/seo.json +30 -0
- package/server/components/velox/footer-column.json +20 -0
- package/server/components/velox/footer.json +41 -0
- package/server/components/velox/header.json +22 -0
- package/server/components/velox/link.json +28 -0
- package/server/components/velox/social-link.json +21 -0
- package/server/index.js +2 -0
package/package.json
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
module.exports = async ({ strapi }) => {
|
|
7
|
+
try {
|
|
8
|
+
const pluginComponentsDir = path.join(__dirname, 'components');
|
|
9
|
+
const appComponentsDir = path.join(strapi.dirs.app.src, 'components');
|
|
10
|
+
|
|
11
|
+
// Create velox and shared dirs if they don't exist
|
|
12
|
+
const veloxDir = path.join(appComponentsDir, 'velox');
|
|
13
|
+
const sharedDir = path.join(appComponentsDir, 'shared');
|
|
14
|
+
|
|
15
|
+
if (!fs.existsSync(appComponentsDir)) fs.mkdirSync(appComponentsDir, { recursive: true });
|
|
16
|
+
if (!fs.existsSync(veloxDir)) fs.mkdirSync(veloxDir, { recursive: true });
|
|
17
|
+
if (!fs.existsSync(sharedDir)) fs.mkdirSync(sharedDir, { recursive: true });
|
|
18
|
+
|
|
19
|
+
// Files to copy
|
|
20
|
+
const filesToCopy = [
|
|
21
|
+
{ src: path.join(pluginComponentsDir, 'velox', 'header.json'), dest: path.join(veloxDir, 'header.json') },
|
|
22
|
+
{ src: path.join(pluginComponentsDir, 'velox', 'footer.json'), dest: path.join(veloxDir, 'footer.json') },
|
|
23
|
+
{ src: path.join(pluginComponentsDir, 'velox', 'link.json'), dest: path.join(veloxDir, 'link.json') },
|
|
24
|
+
{ src: path.join(pluginComponentsDir, 'velox', 'social-link.json'), dest: path.join(veloxDir, 'social-link.json') },
|
|
25
|
+
{ src: path.join(pluginComponentsDir, 'velox', 'footer-column.json'), dest: path.join(veloxDir, 'footer-column.json') },
|
|
26
|
+
{ src: path.join(pluginComponentsDir, 'shared', 'seo.json'), dest: path.join(sharedDir, 'seo.json') }
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
let copied = false;
|
|
30
|
+
filesToCopy.forEach(({ src, dest }) => {
|
|
31
|
+
if (!fs.existsSync(dest) && fs.existsSync(src)) {
|
|
32
|
+
fs.copyFileSync(src, dest);
|
|
33
|
+
copied = true;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
if (copied) {
|
|
38
|
+
strapi.log.info('[strapi-layout-plugin] Seeded layout components into src/components. Please restart Strapi if components do not show up.');
|
|
39
|
+
}
|
|
40
|
+
} catch (error) {
|
|
41
|
+
strapi.log.error('[strapi-layout-plugin] Failed to auto-seed components:', error);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
'velox.header': require('./velox/header.json'),
|
|
5
|
+
'velox.footer': require('./velox/footer.json'),
|
|
6
|
+
'velox.link': require('./velox/link.json'),
|
|
7
|
+
'velox.social-link': require('./velox/social-link.json'),
|
|
8
|
+
'velox.footer-column': require('./velox/footer-column.json'),
|
|
9
|
+
'shared.seo': require('./shared/seo.json'),
|
|
10
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"collectionName": "components_shared_seos",
|
|
3
|
+
"info": {
|
|
4
|
+
"displayName": "Seo",
|
|
5
|
+
"icon": "search",
|
|
6
|
+
"description": "Defines SEO metadata including meta title, description, and social share image to optimize page visibility and ranking in search engines."
|
|
7
|
+
},
|
|
8
|
+
"options": {},
|
|
9
|
+
"attributes": {
|
|
10
|
+
"metaTitle": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"required": true,
|
|
13
|
+
"maxLength": 60
|
|
14
|
+
},
|
|
15
|
+
"metaDescription": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"maxLength": 160
|
|
18
|
+
},
|
|
19
|
+
"metaImage": {
|
|
20
|
+
"type": "media",
|
|
21
|
+
"multiple": false,
|
|
22
|
+
"required": false,
|
|
23
|
+
"allowedTypes": [
|
|
24
|
+
"images",
|
|
25
|
+
"files",
|
|
26
|
+
"videos"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"collectionName": "components_velox_footer_columns",
|
|
3
|
+
"info": {
|
|
4
|
+
"displayName": "Footer Column",
|
|
5
|
+
"icon": "list",
|
|
6
|
+
"description": ""
|
|
7
|
+
},
|
|
8
|
+
"options": {},
|
|
9
|
+
"attributes": {
|
|
10
|
+
"title": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"required": true
|
|
13
|
+
},
|
|
14
|
+
"links": {
|
|
15
|
+
"type": "component",
|
|
16
|
+
"repeatable": true,
|
|
17
|
+
"component": "velox.link"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"collectionName": "components_velox_footers",
|
|
3
|
+
"info": {
|
|
4
|
+
"displayName": "Footer",
|
|
5
|
+
"icon": "bold",
|
|
6
|
+
"description": ""
|
|
7
|
+
},
|
|
8
|
+
"options": {},
|
|
9
|
+
"attributes": {
|
|
10
|
+
"title": {
|
|
11
|
+
"type": "string"
|
|
12
|
+
},
|
|
13
|
+
"logoUrl": {
|
|
14
|
+
"type": "string"
|
|
15
|
+
},
|
|
16
|
+
"description": {
|
|
17
|
+
"type": "text"
|
|
18
|
+
},
|
|
19
|
+
"newsletterTitle": {
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"copyright": {
|
|
23
|
+
"type": "string"
|
|
24
|
+
},
|
|
25
|
+
"socialLinks": {
|
|
26
|
+
"type": "component",
|
|
27
|
+
"repeatable": true,
|
|
28
|
+
"component": "velox.social-link"
|
|
29
|
+
},
|
|
30
|
+
"bottomLinks": {
|
|
31
|
+
"type": "component",
|
|
32
|
+
"repeatable": true,
|
|
33
|
+
"component": "velox.link"
|
|
34
|
+
},
|
|
35
|
+
"columns": {
|
|
36
|
+
"type": "component",
|
|
37
|
+
"repeatable": true,
|
|
38
|
+
"component": "velox.footer-column"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"collectionName": "components_velox_headers",
|
|
3
|
+
"info": {
|
|
4
|
+
"displayName": "Header",
|
|
5
|
+
"icon": "bold",
|
|
6
|
+
"description": ""
|
|
7
|
+
},
|
|
8
|
+
"options": {},
|
|
9
|
+
"attributes": {
|
|
10
|
+
"title": {
|
|
11
|
+
"type": "string"
|
|
12
|
+
},
|
|
13
|
+
"logoUrl": {
|
|
14
|
+
"type": "string"
|
|
15
|
+
},
|
|
16
|
+
"links": {
|
|
17
|
+
"type": "component",
|
|
18
|
+
"repeatable": true,
|
|
19
|
+
"component": "velox.link"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"collectionName": "components_velox_links",
|
|
3
|
+
"info": {
|
|
4
|
+
"displayName": "Link",
|
|
5
|
+
"description": "This component is used to create reusable links across the website. It supports link text, URL (href), internal/external identification, and target options such as opening in the same or new tab."
|
|
6
|
+
},
|
|
7
|
+
"options": {},
|
|
8
|
+
"attributes": {
|
|
9
|
+
"text": {
|
|
10
|
+
"type": "string"
|
|
11
|
+
},
|
|
12
|
+
"href": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"required": true
|
|
15
|
+
},
|
|
16
|
+
"isInternal": {
|
|
17
|
+
"type": "boolean"
|
|
18
|
+
},
|
|
19
|
+
"target": {
|
|
20
|
+
"type": "enumeration",
|
|
21
|
+
"enum": [
|
|
22
|
+
"_self",
|
|
23
|
+
"_blank"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"config": {}
|
|
28
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"collectionName": "components_velox_social_links",
|
|
3
|
+
"info": {
|
|
4
|
+
"displayName": "Social Link",
|
|
5
|
+
"icon": "twitter",
|
|
6
|
+
"description": ""
|
|
7
|
+
},
|
|
8
|
+
"options": {},
|
|
9
|
+
"attributes": {
|
|
10
|
+
"platform": {
|
|
11
|
+
"type": "enumeration",
|
|
12
|
+
"enum": ["Facebook", "Twitter", "Instagram", "Linkedin", "Youtube", "Github", "Other"],
|
|
13
|
+
"default": "Other",
|
|
14
|
+
"required": true
|
|
15
|
+
},
|
|
16
|
+
"url": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"required": true
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
package/server/index.js
CHANGED
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
const controllers = require('./controllers');
|
|
4
4
|
const routes = require('./routes');
|
|
5
5
|
const contentTypes = require('./content-types');
|
|
6
|
+
const bootstrap = require('./bootstrap');
|
|
6
7
|
|
|
7
8
|
module.exports = {
|
|
8
9
|
controllers,
|
|
9
10
|
routes,
|
|
10
11
|
contentTypes,
|
|
12
|
+
bootstrap,
|
|
11
13
|
};
|