@lexho111/plainblog 0.0.12 → 0.1.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/Blog.js CHANGED
@@ -45,7 +45,6 @@ export default class Blog {
45
45
  const __dirname = path.dirname(__filename);
46
46
  this.scripts = "";
47
47
  try {
48
- console.log("load scripts")
49
48
  this.scripts = fs.readFileSync(
50
49
  path.join(__dirname, "scripts.min.js"),
51
50
  "utf-8"
@@ -86,14 +85,6 @@ export default class Blog {
86
85
 
87
86
  /** initializes database */
88
87
  async init() {
89
- try {
90
- this.styles = fs.readFileSync(
91
- new URL("./styles.min.css", import.meta.url),
92
- "utf-8"
93
- );
94
- } catch (err) {
95
- console.error("Failed to load styles.min.css:", err);
96
- }
97
88
  if (this.#isExternalAPI) {
98
89
  console.log("external API");
99
90
  await this.loadFromAPI();
@@ -174,7 +165,7 @@ export default class Blog {
174
165
  } else if (req.method === "GET" && req.url === "/") {
175
166
  // load articles
176
167
 
177
- this.loadScripts(); this.loadStyles();
168
+ //this.loadScripts(); this.loadStyles();
178
169
 
179
170
  const html = await this.toHTML(); // render this blog to HTML
180
171
  res.writeHead(200, { "Content-Type": "text/html; charset=UTF-8" });
package/README.md CHANGED
@@ -33,7 +33,7 @@ import Blog from "@lexho111/plainblog";
33
33
 
34
34
  const blog = new Blog();
35
35
  blog.database.type = "postgres";
36
- blog.database.user = "user";
36
+ blog.database.username = "user";
37
37
  blog.database.password = "password";
38
38
  blog.database.host = "localhost";
39
39
  blog.setStyle("body { font-family: Arial, sans-serif; } h1 { color: #333; }");
@@ -67,9 +67,9 @@ blog.setStyle("body { font-family: Arial, sans-serif; } h1 { color: #333; }");
67
67
  const article = new Article("hello", "hello world!");
68
68
  blog.addArticle(article);
69
69
 
70
- blog.save("blog.json");
70
+ blog.save("myblog.json");
71
71
 
72
- # load data from 'myblog.json'
72
+ // load data from 'myblog.json'
73
73
  await blog.load("myblog.json");
74
74
  ```
75
75
 
package/blog.db CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lexho111/plainblog",
3
- "version": "0.0.12",
3
+ "version": "0.1.0",
4
4
  "description": "A tool for creating and serving a minimalist, single-page blog.",
5
5
  "main": "index.js",
6
6
  "type": "module",
Binary file
Binary file
Binary file