astro-blog-kit 0.1.2 → 0.1.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/bin/cli.js +1 -1
- package/cli.ts +1 -1
- package/package.json +1 -1
- package/templates/blog-index.astro.template +1 -1
package/bin/cli.js
CHANGED
|
@@ -7,7 +7,7 @@ import path from "path";
|
|
|
7
7
|
import { fileURLToPath } from "url";
|
|
8
8
|
var __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
9
9
|
function copyTemplate(templateName, destPath, replacements) {
|
|
10
|
-
const templatePath = path.join(__dirname, "templates", templateName);
|
|
10
|
+
const templatePath = path.join(__dirname, "..", "templates", templateName);
|
|
11
11
|
let content = fs.readFileSync(templatePath, "utf-8");
|
|
12
12
|
for (const [key, value] of Object.entries(replacements)) {
|
|
13
13
|
content = content.replaceAll(`__${key}__`, value);
|
package/cli.ts
CHANGED
|
@@ -18,7 +18,7 @@ function copyTemplate(
|
|
|
18
18
|
destPath: string,
|
|
19
19
|
replacements: Record<string, string>
|
|
20
20
|
) {
|
|
21
|
-
const templatePath = path.join(__dirname, "templates", templateName);
|
|
21
|
+
const templatePath = path.join(__dirname, "..", "templates", templateName);
|
|
22
22
|
let content = fs.readFileSync(templatePath, "utf-8");
|
|
23
23
|
|
|
24
24
|
for (const [key, value] of Object.entries(replacements)) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { BlogList } from "astro-blog-kit/components";
|
|
3
3
|
import { createWPClient } from "astro-blog-kit/utils";
|
|
4
|
-
import config from "
|
|
4
|
+
import config from "../../../blog.config";
|
|
5
5
|
|
|
6
6
|
const wp = createWPClient(config.wpUrl);
|
|
7
7
|
const { posts, totalPages } = await wp.getPosts({ perPage: config.postsPerPage ?? 5 });
|