@lexho111/plainblog 0.2.6 → 0.2.7

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.
Files changed (3) hide show
  1. package/Blog.js +12 -6
  2. package/Formatter.js +1 -0
  3. package/package.json +1 -1
package/Blog.js CHANGED
@@ -113,9 +113,12 @@ export default class Blog {
113
113
  res.end();
114
114
  } else {
115
115
  res.writeHead(401, { "Content-Type": "text/html" });
116
- res.end(`<style>${this.styles}</style><h1>Unauthorized</h1><p>Please enter the password.<form method="POST">
117
- <input type="password" name="password" placeholder="Password" />
118
- <button style="margin: 2px;">Login</button></form>`);
116
+ res.end(`<html><head><meta name="viewport" content="width=device-width, initial-scale=1.0"><style>${this.styles}</style></head>
117
+ <body>
118
+ <h1>Unauthorized</h1><p>Please enter the password.<form method="POST">
119
+ <input type="password" name="password" placeholder="Password" />
120
+ <button style="margin: 2px;">Login</button></form>
121
+ </body></html>`);
119
122
  }
120
123
  }
121
124
 
@@ -214,9 +217,12 @@ export default class Blog {
214
217
  if (req.url === "/login") {
215
218
  if (req.method === "GET") {
216
219
  res.writeHead(200, { "Content-Type": "text/html" });
217
- res.end(`<style>${this.styles}</style><h1>Login</h1><form method="POST">
218
- <input type="password" name="password" placeholder="Password" />
219
- <button style="margin: 2px;">Login</button></form>`);
220
+ res.end(`<html><head><meta name="viewport" content="width=device-width, initial-scale=1.0"><style>${this.styles}</style></head>
221
+ <body>
222
+ <h1>Login</h1><form method="POST">
223
+ <input type="password" name="password" placeholder="Password" />
224
+ <button style="margin: 2px;">Login</button></form>
225
+ </body></html>`);
220
226
  return;
221
227
  } else if (req.method === "POST") {
222
228
  await this.handleLogin(req, res);
package/Formatter.js CHANGED
@@ -21,6 +21,7 @@ export function formatHTML(data, script, style) {
21
21
  <html lang="de">
22
22
  <head>
23
23
  <meta charset="UTF-8">
24
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
24
25
  <title>${data.title}</title>
25
26
  <style>${style}</style>
26
27
  </head>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lexho111/plainblog",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "A tool for creating and serving a minimalist, single-page blog.",
5
5
  "main": "index.js",
6
6
  "type": "module",