@tenjuu99/blog 0.2.1 → 0.2.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenjuu99/blog",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "blog template",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -2,8 +2,10 @@ import { IncomingMessage, ServerResponse } from 'http'
2
2
  import fs from 'node:fs/promises'
3
3
  import { styleText } from 'node:util'
4
4
 
5
- const config = (await import('../../lib/config.js')).default
6
- const dir = (await import('../../lib/dir.js'))
5
+ const rootDir = process.cwd()
6
+ const config = (await import(rootDir + '/lib/config.js')).default
7
+ const dir = (await import(rootDir + '/lib/dir.js'))
8
+ const helper = (await import(rootDir + '/lib/helper.js'))
7
9
 
8
10
  export const path = '/editor'
9
11
 
@@ -1,8 +1,9 @@
1
1
  import { IncomingMessage, ServerResponse } from 'http'
2
2
  import fs from 'node:fs'
3
3
 
4
- const config = (await import('../../lib/config.js')).default
5
- const pageDir = (await import('../../lib/dir.js')).pageDir
4
+ const rootDir = process.cwd()
5
+ const config = (await import(rootDir + '/lib/config.js')).default
6
+ const pageDir = (await import(rootDir + '/lib/dir.js')).pageDir
6
7
 
7
8
  export const path = '/get_editor_target'
8
9
 
@@ -1,8 +1,9 @@
1
1
  import { IncomingMessage, ServerResponse } from 'http'
2
2
  import { styleText } from 'node:util'
3
3
 
4
- const render = (await import('../../lib/render.js')).default
5
- const makePageData = (await import('../../lib/pageData.js')).default
4
+ const rootDir = process.cwd()
5
+ const render = (await import(rootDir + '/lib/render.js')).default
6
+ const makePageData = (await import(rootDir + '/lib/pageData.js')).default
6
7
 
7
8
  export const path = '/preview'
8
9
 
@@ -43,15 +43,15 @@
43
43
  {/if}
44
44
  {{MARKDOWN}}
45
45
  </article>
46
+
47
+ {include('template/prevNext.html')}
48
+ </main>
46
49
  {if editor}
47
50
  <div class="container">
48
51
  <a href="/editor?md={{name}}.{{__filetype}}">編集する</a>
49
52
  </div>
50
53
  {/if}
51
54
 
52
- {include('template/prevNext.html')}
53
- </main>
54
-
55
55
  {include('template/footer.html')}
56
56
  </body>
57
57
  </html>