Skip to content

Commit 49d7818

Browse files
committed
[Fix] Wordpress plugin zip
1 parent 70ead15 commit 49d7818

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Below is available a description of `options` values.
110110

111111
## 📖 Installation (Wordpress)
112112

113-
1. Download wordpress plugin from [mirror](https://cdn.jsdelivr.net/npm/@ptkdev/svelte-webcomponent-boilerplate@latest/dist/svelte-webcomponent-boilerplate-wordpress-plugin.zip) and install it.
113+
1. Download wordpress plugin from [mirror](https://cdn.jsdelivr.net/npm/@ptkdev/svelte-webcomponent-boilerplate@latest/dist/wordpress/svelte-webcomponent-boilerplate-wordpress-plugin.zip) and install it.
114114
1. Add code to your html widget, example: `Appearance` --> `Widget` --> insert `HTML Widget` and paste html code:
115115

116116
```html

app/webcomponent/styles/webcomponent.scss

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@
99
*/
1010

1111
#webcomponent {
12-
font-family: "Roboto";
12+
font-family: "Roboto", "Trebuchet MS";
1313
text-align: center;
1414
color: #999;
1515
text-transform: uppercase;
1616
font-size: 36px;
1717
font-weight: bold;
18-
padding-top: 200px;
19-
position: fixed;
18+
position: relative;
2019
width: 100%;
2120
bottom: 45%;
2221
display: block;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"start": "sirv dist",
2828
"dev": "ts-node scripts/configs.ts && ts-node scripts/debug.ts --enable && rm -rf dist && rollup -c -w",
2929
"build": "ts-node scripts/configs.ts && rm -rf dist && rollup -c",
30-
"release": "ts-node scripts/configs.ts && ts-node scripts/debug.ts --disable && npm run build && ts-node --skip-project scripts/license.ts && ts-node scripts/wordpress.ts",
30+
"release": "ts-node scripts/configs.ts && ts-node scripts/debug.ts --disable && npm run build && ts-node --skip-project scripts/license.ts && ts-node scripts/wordpress.ts",
3131
"test": "jest app",
3232
"docs": "git submodule update --recursive && markserv ./README.md",
3333
"lint": "npm run lint-prettify && eslint . --cache --ext .ts,.js",

public/index.html

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
<link rel="icon" type="image/png" href="favicon.png" />
1010
<link rel="preconnect" href="https://fonts.gstatic.com" />
11-
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@700&display=swap" rel="stylesheet" />
1211

1312
<script defer src="webcomponent.js"></script>
1413
</head>

scripts/wordpress.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,14 @@ fs.writeFileSync(`${__dirname}/../dist/readme.txt`, html, "utf8");
2525
html = nunjucks.render(`${__dirname}/../wordpress/svelte_webcomponent_boilerplate.php`, { package: pkg });
2626
fs.writeFileSync(`${__dirname}/../dist/svelte_webcomponent_boilerplate.php`, html, "utf8");
2727

28-
shell.mkdir("-p", `${__dirname}/../build/${pkg.name.replace("@ptkdev/", "")}-wordpress-plugin/`);
29-
shell.cp("-R", `${__dirname}/../dist/*`, `${__dirname}/../build/${pkg.name.replace("@ptkdev/", "")}-wordpress-plugin/`);
28+
shell.mkdir("-p", `${__dirname}/../build/${pkg.name.replace("@ptkdev/", "")}/`);
29+
shell.mkdir("-p", `${__dirname}/../dist/wordpress/`);
30+
shell.cp("-R", `${__dirname}/../dist/*`, `${__dirname}/../build/${pkg.name.replace("@ptkdev/", "")}/`);
3031

31-
shell.exec(`zip -r -j dist/${pkg.name.replace("@ptkdev/", "")}-wordpress-plugin.zip ${__dirname}/../build/${pkg.name.replace("@ptkdev/", "")}-wordpress-plugin/`);
32+
shell.exec(
33+
`cd build && zip -r ../dist/wordpress/${pkg.name.replace("@ptkdev/", "")}-wordpress-plugin.zip .`,
34+
);
3235

3336
shell.rm("-r", `${__dirname}/../build`);
37+
shell.rm("-r", `${__dirname}/../dist/svelte_webcomponent_boilerplate.php`);
38+
shell.rm("-r", `${__dirname}/../dist/readme.txt`);

0 commit comments

Comments
 (0)