docula 0.0.5 → 0.0.6

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 (86) hide show
  1. package/dist/config.d.ts +21 -0
  2. package/dist/config.d.ts.map +1 -0
  3. package/dist/config.js +75 -0
  4. package/dist/config.js.map +1 -0
  5. package/dist/docula-plugin.d.ts +9 -0
  6. package/dist/docula-plugin.d.ts.map +1 -0
  7. package/dist/docula-plugin.js +2 -0
  8. package/dist/docula-plugin.js.map +1 -0
  9. package/dist/docula.d.ts +17 -0
  10. package/dist/docula.d.ts.map +1 -0
  11. package/dist/docula.js +97 -0
  12. package/dist/docula.js.map +1 -0
  13. package/dist/eleventy/filters.d.ts +2 -0
  14. package/dist/eleventy/filters.d.ts.map +1 -0
  15. package/dist/eleventy/filters.js +10 -0
  16. package/dist/eleventy/filters.js.map +1 -0
  17. package/dist/eleventy/shortcodes.d.ts +4 -0
  18. package/dist/eleventy/shortcodes.d.ts.map +1 -0
  19. package/dist/eleventy/shortcodes.js +18 -0
  20. package/dist/eleventy/shortcodes.js.map +1 -0
  21. package/dist/eleventy.d.ts +23 -0
  22. package/dist/eleventy.d.ts.map +1 -0
  23. package/dist/eleventy.js +69 -0
  24. package/dist/eleventy.js.map +1 -0
  25. package/dist/index.d.ts +9 -0
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/index.js +39 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/logger.d.ts +4 -0
  30. package/dist/logger.d.ts.map +1 -0
  31. package/dist/logger.js +20 -0
  32. package/dist/logger.js.map +1 -0
  33. package/dist/plugins/github.d.ts +16 -0
  34. package/dist/plugins/github.d.ts.map +1 -0
  35. package/dist/plugins/github.js +68 -0
  36. package/dist/plugins/github.js.map +1 -0
  37. package/dist/plugins/index.d.ts +16 -0
  38. package/dist/plugins/index.d.ts.map +1 -0
  39. package/dist/plugins/index.js +14 -0
  40. package/dist/plugins/index.js.map +1 -0
  41. package/dist/plugins/npm.d.ts +14 -0
  42. package/dist/plugins/npm.d.ts.map +1 -0
  43. package/dist/plugins/npm.js +36 -0
  44. package/dist/plugins/npm.js.map +1 -0
  45. package/dist/plugins/pagefind.d.ts +10 -0
  46. package/dist/plugins/pagefind.d.ts.map +1 -0
  47. package/dist/plugins/pagefind.js +22 -0
  48. package/dist/plugins/pagefind.js.map +1 -0
  49. package/dist/plugins/robots.d.ts +14 -0
  50. package/dist/plugins/robots.d.ts.map +1 -0
  51. package/dist/plugins/robots.js +34 -0
  52. package/dist/plugins/robots.js.map +1 -0
  53. package/dist/plugins/sitemap.d.ts +11 -0
  54. package/dist/plugins/sitemap.d.ts.map +1 -0
  55. package/dist/plugins/sitemap.js +26 -0
  56. package/dist/plugins/sitemap.js.map +1 -0
  57. package/dist/schemas.d.ts +21 -0
  58. package/dist/schemas.d.ts.map +1 -0
  59. package/dist/schemas.js +24 -0
  60. package/dist/schemas.js.map +1 -0
  61. package/dist/tools/__mocks__/inquirer-prompt.d.ts +18 -0
  62. package/dist/tools/__mocks__/inquirer-prompt.d.ts.map +1 -0
  63. package/dist/tools/__mocks__/inquirer-prompt.js +17 -0
  64. package/dist/tools/__mocks__/inquirer-prompt.js.map +1 -0
  65. package/dist/tools/__mocks__/path.d.ts +4 -0
  66. package/dist/tools/__mocks__/path.d.ts.map +1 -0
  67. package/dist/tools/__mocks__/path.js +5 -0
  68. package/dist/tools/__mocks__/path.js.map +1 -0
  69. package/dist/tools/inquirer-prompt.d.ts +7 -0
  70. package/dist/tools/inquirer-prompt.d.ts.map +1 -0
  71. package/dist/tools/inquirer-prompt.js +62 -0
  72. package/dist/tools/inquirer-prompt.js.map +1 -0
  73. package/dist/tools/path.d.ts +3 -0
  74. package/dist/tools/path.d.ts.map +1 -0
  75. package/dist/tools/path.js +5 -0
  76. package/dist/tools/path.js.map +1 -0
  77. package/dist/tools/tools.d.ts +3 -0
  78. package/dist/tools/tools.d.ts.map +1 -0
  79. package/dist/tools/tools.js +10 -0
  80. package/dist/tools/tools.js.map +1 -0
  81. package/dist/types/config.d.ts +8 -0
  82. package/dist/types/config.d.ts.map +1 -0
  83. package/dist/types/config.js +2 -0
  84. package/dist/types/config.js.map +1 -0
  85. package/init/index.njk +2 -2
  86. package/package.json +2 -2
@@ -0,0 +1,14 @@
1
+ import { GithubPlugin } from './github.js';
2
+ import { NpmPlugin } from './npm.js';
3
+ import { RobotsPlugin } from './robots.js';
4
+ import { SitemapPlugin } from './sitemap.js';
5
+ import { PagefindPlugin } from './pagefind.js';
6
+ const plugins = {
7
+ github: GithubPlugin,
8
+ npm: NpmPlugin,
9
+ robots: RobotsPlugin,
10
+ sitemap: SitemapPlugin,
11
+ pagefind: PagefindPlugin,
12
+ };
13
+ export default plugins;
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAC,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAiB,SAAS,EAAC,MAAM,UAAU,CAAC;AACnD,OAAO,EAAoB,YAAY,EAAC,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAE7C,MAAM,OAAO,GAAG;IACf,MAAM,EAAE,YAAY;IACpB,GAAG,EAAE,SAAS;IACd,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,aAAa;IACtB,QAAQ,EAAE,cAAc;CACxB,CAAC;AAMF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { DoculaPlugin, Options, Schema, Runtime } from '../docula-plugin.js';
2
+ import type { Config } from '../config.js';
3
+ export type NpmConfig = {
4
+ moduleName: string;
5
+ };
6
+ export declare class NpmPlugin implements DoculaPlugin {
7
+ static schema: Schema;
8
+ readonly options: Options;
9
+ runtime: Runtime;
10
+ constructor(config: Config);
11
+ execute(): Promise<void>;
12
+ getMonthlyDownloads(): Promise<any>;
13
+ }
14
+ //# sourceMappingURL=npm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"npm.d.ts","sourceRoot":"","sources":["../../src/plugins/npm.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC,MAAM,MAAM,SAAS,GAAG;IACvB,UAAU,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,qBAAa,SAAU,YAAW,YAAY;IAC7C,MAAM,CAAC,MAAM,EAAE,MAAM,CAMnB;IAEF,QAAQ,CAAC,OAAO,EAAE,OAAO,CAKvB;IAEF,OAAO,EAAE,OAAO,CAAY;gBAEhB,MAAM,EAAE,MAAM;IAMpB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAQxB,mBAAmB,IAAI,OAAO,CAAC,GAAG,CAAC;CAKzC"}
@@ -0,0 +1,36 @@
1
+ import axios from 'axios';
2
+ import fs from 'fs-extra';
3
+ export class NpmPlugin {
4
+ constructor(config) {
5
+ this.options = {
6
+ dataPath: '_data',
7
+ moduleName: '',
8
+ outputFile: 'npm.json',
9
+ sitePath: '',
10
+ };
11
+ this.runtime = 'before';
12
+ this.options.sitePath = config.originPath;
13
+ const { moduleName } = config.pluginConfig.npm;
14
+ this.options.moduleName = moduleName;
15
+ }
16
+ async execute() {
17
+ const data = await this.getMonthlyDownloads();
18
+ const path = `${this.options.sitePath}/${this.options.dataPath}`;
19
+ const filePath = `${this.options.sitePath}/${this.options.dataPath}/${this.options.outputFile}`;
20
+ await fs.ensureDir(path);
21
+ await fs.writeFile(filePath, JSON.stringify(data, null, 2));
22
+ }
23
+ async getMonthlyDownloads() {
24
+ const url = `https://api.npmjs.org/downloads/point/last-month/${this.options.moduleName}`;
25
+ const result = await axios.get(url);
26
+ return result.data;
27
+ }
28
+ }
29
+ NpmPlugin.schema = {
30
+ type: 'object',
31
+ required: ['moduleName'],
32
+ properties: {
33
+ moduleName: { type: 'string' },
34
+ },
35
+ };
36
+ //# sourceMappingURL=npm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"npm.js","sourceRoot":"","sources":["../../src/plugins/npm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,UAAU,CAAC;AAQ1B,MAAM,OAAO,SAAS;IAkBrB,YAAY,MAAc;QATjB,YAAO,GAAY;YAC3B,QAAQ,EAAE,OAAO;YACjB,UAAU,EAAE,EAAE;YACd,UAAU,EAAE,UAAU;YACtB,QAAQ,EAAE,EAAE;SACZ,CAAC;QAEF,YAAO,GAAY,QAAQ,CAAC;QAG3B,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC;QAC1C,MAAM,EAAC,UAAU,EAAC,GAAG,MAAM,CAAC,YAAY,CAAC,GAAgB,CAAC;QAC1D,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,UAAU,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,OAAO;QACZ,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC9C,MAAM,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACjE,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QAChG,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACzB,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,mBAAmB;QACxB,MAAM,GAAG,GAAG,oDAAoD,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QAC1F,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACpC,OAAO,MAAM,CAAC,IAAI,CAAC;IACpB,CAAC;;AAnCM,gBAAM,GAAW;IACvB,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,YAAY,CAAC;IACxB,UAAU,EAAE;QACX,UAAU,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;KAC5B;CACD,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { DoculaPlugin, Options, Schema, Runtime } from '../docula-plugin.js';
2
+ import type { Config } from '../config.js';
3
+ export declare class PagefindPlugin implements DoculaPlugin {
4
+ static schema: Schema;
5
+ readonly options: Options;
6
+ runtime: Runtime;
7
+ constructor(config: Config);
8
+ execute(): Promise<void>;
9
+ }
10
+ //# sourceMappingURL=pagefind.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagefind.d.ts","sourceRoot":"","sources":["../../src/plugins/pagefind.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC,qBAAa,cAAe,YAAW,YAAY;IAClD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;IAE3B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAEvB;IAEF,OAAO,EAAE,OAAO,CAAW;gBAEf,MAAM,EAAE,MAAM;IAIpB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAW9B"}
@@ -0,0 +1,22 @@
1
+ import { exec } from 'node:child_process';
2
+ export class PagefindPlugin {
3
+ constructor(config) {
4
+ this.options = {
5
+ outputPath: '',
6
+ };
7
+ this.runtime = 'after';
8
+ this.options.outputPath = config.outputPath;
9
+ }
10
+ async execute() {
11
+ await new Promise((resolve, reject) => {
12
+ exec(`npx pagefind --source ${this.options.outputPath}`, (error, stdout) => {
13
+ if (error) {
14
+ reject(error);
15
+ }
16
+ resolve(stdout);
17
+ });
18
+ });
19
+ }
20
+ }
21
+ PagefindPlugin.schema = {};
22
+ //# sourceMappingURL=pagefind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagefind.js","sourceRoot":"","sources":["../../src/plugins/pagefind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,oBAAoB,CAAC;AAIxC,MAAM,OAAO,cAAc;IAS1B,YAAY,MAAc;QANjB,YAAO,GAAY;YAC3B,UAAU,EAAE,EAAE;SACd,CAAC;QAEF,YAAO,GAAY,OAAO,CAAC;QAG1B,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,OAAO;QACZ,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,IAAI,CAAC,yBAAyB,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,KAAU,EAAE,MAAW,EAAE,EAAE;gBACpF,IAAI,KAAK,EAAE;oBACV,MAAM,CAAC,KAAK,CAAC,CAAC;iBACd;gBAED,OAAO,CAAC,MAAM,CAAC,CAAC;YACjB,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC;;AAtBM,qBAAM,GAAW,EAAE,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { DoculaPlugin, Options, Runtime, Schema } from '../docula-plugin.js';
2
+ import type { Config } from '../config.js';
3
+ export type RobotsConfig = {
4
+ allowedUrl: string;
5
+ disallowedUrl: string;
6
+ };
7
+ export declare class RobotsPlugin implements DoculaPlugin {
8
+ static schema: Schema;
9
+ readonly options: Options;
10
+ runtime: Runtime;
11
+ constructor(config: Config);
12
+ execute(): Promise<void>;
13
+ }
14
+ //# sourceMappingURL=robots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"robots.d.ts","sourceRoot":"","sources":["../../src/plugins/robots.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC,MAAM,MAAM,YAAY,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,qBAAa,YAAa,YAAW,YAAY;IAChD,MAAM,CAAC,MAAM,EAAE,MAAM,CAMnB;IAEF,QAAQ,CAAC,OAAO,EAAE,OAAO,CAGvB;IAEF,OAAO,EAAE,OAAO,CAAW;gBAEf,MAAM,EAAE,MAAM;IAYpB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAS9B"}
@@ -0,0 +1,34 @@
1
+ import fs from 'fs-extra';
2
+ export class RobotsPlugin {
3
+ constructor(config) {
4
+ this.options = {
5
+ sitemapPath: 'sitemap.xml',
6
+ outputFile: 'robots.txt',
7
+ };
8
+ this.runtime = 'after';
9
+ this.options.outputPath = config.outputPath;
10
+ const { allowedUrl, disallowedUrl } = config.pluginConfig.robots || {};
11
+ if (allowedUrl) {
12
+ this.options.allowedUrl = allowedUrl;
13
+ }
14
+ if (disallowedUrl) {
15
+ this.options.disallowedUrl = disallowedUrl;
16
+ }
17
+ }
18
+ async execute() {
19
+ const isAllowed = this.options.allowedUrl ? `Allow: ${this.options.allowedUrl}` : '';
20
+ const isDisallowed = this.options.disallowedUrl ? `Disallow: ${this.options.disallowedUrl}` : '';
21
+ const data = `User-agent: * \n${isAllowed} \n${isDisallowed} \nSitemap: ${this.options.sitemapPath}`;
22
+ const filePath = `${this.options.outputPath}/${this.options.outputFile}`;
23
+ await fs.ensureDir(this.options.outputPath);
24
+ await fs.writeFile(filePath, data);
25
+ }
26
+ }
27
+ RobotsPlugin.schema = {
28
+ type: 'object',
29
+ properties: {
30
+ allowedUrl: { type: 'string' },
31
+ disallowedUrl: { type: 'string' },
32
+ },
33
+ };
34
+ //# sourceMappingURL=robots.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"robots.js","sourceRoot":"","sources":["../../src/plugins/robots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAS1B,MAAM,OAAO,YAAY;IAgBxB,YAAY,MAAc;QAPjB,YAAO,GAAY;YAC3B,WAAW,EAAE,aAAa;YAC1B,UAAU,EAAE,YAAY;SACxB,CAAC;QAEF,YAAO,GAAY,OAAO,CAAC;QAG1B,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QAC5C,MAAM,EAAC,UAAU,EAAE,aAAa,EAAC,GAAG,MAAM,CAAC,YAAY,CAAC,MAAiC,IAAI,EAAE,CAAC;QAChG,IAAI,UAAU,EAAE;YACf,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,UAAU,CAAC;SACrC;QAED,IAAI,aAAa,EAAE;YAClB,IAAI,CAAC,OAAO,CAAC,aAAa,GAAG,aAAa,CAAC;SAC3C;IACF,CAAC;IAED,KAAK,CAAC,OAAO;QACZ,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrF,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAEjG,MAAM,IAAI,GAAG,mBAAmB,SAAS,MAAM,YAAY,eAAe,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QACrG,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACzE,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC5C,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC;;AAnCM,mBAAM,GAAW;IACvB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACX,UAAU,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;QAC5B,aAAa,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;KAC/B;CACD,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { DoculaPlugin, Options, Schema, Runtime } from '../docula-plugin.js';
2
+ import type { Config } from '../config.js';
3
+ export declare class SitemapPlugin implements DoculaPlugin {
4
+ static schema: Schema;
5
+ readonly options: Options;
6
+ runtime: Runtime;
7
+ private readonly eleventy;
8
+ constructor(config: Config);
9
+ execute(): Promise<void>;
10
+ }
11
+ //# sourceMappingURL=sitemap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sitemap.d.ts","sourceRoot":"","sources":["../../src/plugins/sitemap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAGzC,qBAAa,aAAc,YAAW,YAAY;IACjD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;IAE3B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAIvB;IAEF,OAAO,EAAE,OAAO,CAAW;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAW;gBAExB,MAAM,EAAE,MAAM;IAQpB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAS9B"}
@@ -0,0 +1,26 @@
1
+ import fs from 'fs-extra';
2
+ import { Eleventy } from '../eleventy.js';
3
+ export class SitemapPlugin {
4
+ constructor(config) {
5
+ this.options = {
6
+ siteUrl: '',
7
+ outputFile: 'sitemap.xml',
8
+ outputPath: '',
9
+ };
10
+ this.runtime = 'after';
11
+ this.eleventy = new Eleventy(config);
12
+ this.options.outputPath = config.outputPath;
13
+ const { siteUrl } = config;
14
+ this.options.siteUrl = siteUrl;
15
+ }
16
+ async execute() {
17
+ const jsonContent = await this.eleventy.toJSON();
18
+ const content = `<?xml version="1.0" encoding="utf-8"?>
19
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
20
+ ${jsonContent.map(item => (`<url><loc>${this.options.siteUrl}${item.url}</loc></url>`)).join('')}
21
+ </urlset>`;
22
+ fs.writeFileSync(`${this.options.outputPath}/${this.options.outputFile}`, content);
23
+ }
24
+ }
25
+ SitemapPlugin.schema = {};
26
+ //# sourceMappingURL=sitemap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sitemap.js","sourceRoot":"","sources":["../../src/plugins/sitemap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAG1B,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAExC,MAAM,OAAO,aAAa;IAYzB,YAAY,MAAc;QATjB,YAAO,GAAY;YAC3B,OAAO,EAAE,EAAE;YACX,UAAU,EAAE,aAAa;YACzB,UAAU,EAAE,EAAE;SACd,CAAC;QAEF,YAAO,GAAY,OAAO,CAAC;QAI1B,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QAC5C,MAAM,EAAC,OAAO,EAAC,GAAG,MAAM,CAAC;QAEzB,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,OAAO;QACZ,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACjD,MAAM,OAAO,GAAG;;QAEV,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,aAAa,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;cACxF,CAAC;QAEb,EAAE,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;IACpF,CAAC;;AA3BM,oBAAM,GAAW,EAAE,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { type Plugins } from './types/config.js';
2
+ type Property = Record<string, string | string[]>;
3
+ type PluginsType = {
4
+ type: string;
5
+ items: {
6
+ type: string;
7
+ enum: Plugins;
8
+ };
9
+ };
10
+ export type ConfigSchema = {
11
+ type: 'object';
12
+ additionalProperties: boolean;
13
+ properties: {
14
+ [key: string]: Property | PluginsType;
15
+ plugins: PluginsType;
16
+ };
17
+ required: string[];
18
+ };
19
+ export declare const jsonConfigSchema: ConfigSchema;
20
+ export {};
21
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,KAAK,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAE/C,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;AAElD,KAAK,WAAW,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,OAAO,CAAC;KACd,CAAC;CACF,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,oBAAoB,EAAE,OAAO,CAAC;IAC9B,UAAU,EAAE;QACX,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAC;QACtC,OAAO,EAAE,WAAW,CAAC;KACrB,CAAC;IACF,QAAQ,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,YAqB9B,CAAC"}
@@ -0,0 +1,24 @@
1
+ import DoculaPlugins from './plugins/index.js';
2
+ export const jsonConfigSchema = {
3
+ type: 'object',
4
+ additionalProperties: false,
5
+ properties: {
6
+ originPath: { type: 'string' },
7
+ outputPath: { type: 'string' },
8
+ dataPath: { type: 'string' },
9
+ templatePath: { type: 'string' },
10
+ searchEngine: { type: 'string', enum: ['algolia'] },
11
+ plugins: {
12
+ type: 'array',
13
+ items: {
14
+ type: 'string',
15
+ enum: Object.keys(DoculaPlugins),
16
+ },
17
+ },
18
+ imagesPath: { type: 'string' },
19
+ assetsPath: { type: 'string' },
20
+ siteUrl: { type: 'string' },
21
+ },
22
+ required: [],
23
+ };
24
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAuB/C,MAAM,CAAC,MAAM,gBAAgB,GAAiB;IAC7C,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACX,UAAU,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;QAC5B,UAAU,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;QAC5B,QAAQ,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;QAC1B,YAAY,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;QAC9B,YAAY,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,EAAC;QACjD,OAAO,EAAE;YACR,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,aAAa,CAAY;aAC3C;SACD;QACD,UAAU,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;QAC5B,UAAU,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;QAC5B,OAAO,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;KACzB;IACD,QAAQ,EAAE,EAAE;CACZ,CAAC"}
@@ -0,0 +1,18 @@
1
+ /// <reference types="jest" />
2
+ export declare const getGithubInfo: jest.Mock<{
3
+ author: string;
4
+ repo: string;
5
+ }, [], any>;
6
+ export declare const validateUrl: jest.Mock<boolean, [], any>;
7
+ export declare const getSiteUrl: jest.Mock<string, [], any>;
8
+ export declare const getUserPlugins: jest.Mock<{
9
+ plugins: string[];
10
+ }, [], any>;
11
+ export declare const parsePluginsData: jest.Mock<{
12
+ plugins: string[];
13
+ github: {
14
+ author: string;
15
+ repo: string;
16
+ };
17
+ }, [plugins: string[]], any>;
18
+ //# sourceMappingURL=inquirer-prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inquirer-prompt.d.ts","sourceRoot":"","sources":["../../../src/tools/__mocks__/inquirer-prompt.ts"],"names":[],"mappings":";AAAA,eAAO,MAAM,aAAa;;;WAGvB,CAAC;AAEJ,eAAO,MAAM,WAAW,6BAAsB,CAAC;AAE/C,eAAO,MAAM,UAAU,4BAA2C,CAAC;AAEnE,eAAO,MAAM,cAAc;;WAExB,CAAC;AAEJ,eAAO,MAAM,gBAAgB;;;;;;4BAM1B,CAAC"}
@@ -0,0 +1,17 @@
1
+ export const getGithubInfo = jest.fn(() => ({
2
+ author: 'jaredwray',
3
+ repo: 'docula',
4
+ }));
5
+ export const validateUrl = jest.fn(() => true);
6
+ export const getSiteUrl = jest.fn(() => 'https://www.example.com');
7
+ export const getUserPlugins = jest.fn(() => ({
8
+ plugins: ['robots.txt', 'npm'],
9
+ }));
10
+ export const parsePluginsData = jest.fn((plugins) => ({
11
+ plugins: ['github'],
12
+ github: {
13
+ author: 'jaredwray',
14
+ repo: 'docula',
15
+ },
16
+ }));
17
+ //# sourceMappingURL=inquirer-prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inquirer-prompt.js","sourceRoot":"","sources":["../../../src/tools/__mocks__/inquirer-prompt.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IAC3C,MAAM,EAAE,WAAW;IACnB,IAAI,EAAE,QAAQ;CACd,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;AAE/C,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,yBAAyB,CAAC,CAAC;AAEnE,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IAC5C,OAAO,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC;CAC9B,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,OAAiB,EAAE,EAAE,CAAC,CAAC;IAC/D,OAAO,EAAE,CAAC,QAAQ,CAAC;IACnB,MAAM,EAAE;QACP,MAAM,EAAE,WAAW;QACnB,IAAI,EAAE,QAAQ;KACd;CACD,CAAC,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ /// <reference types="jest" />
2
+ export declare const getFileName: jest.Mock<string, [], any>;
3
+ export declare const getConfigPath: jest.Mock<string, [], any>;
4
+ //# sourceMappingURL=path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../src/tools/__mocks__/path.ts"],"names":[],"mappings":";AAGA,eAAO,MAAM,WAAW,4BAA2B,CAAC;AAEpD,eAAO,MAAM,aAAa,4BAA+D,CAAC"}
@@ -0,0 +1,5 @@
1
+ // eslint-disable-next-line unicorn/prefer-module
2
+ export const getFileName = jest.fn(() => __dirname);
3
+ // eslint-disable-next-line n/prefer-global/process
4
+ export const getConfigPath = jest.fn(() => `${process.cwd()}/test/data/site/config.json`);
5
+ //# sourceMappingURL=path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.js","sourceRoot":"","sources":["../../../src/tools/__mocks__/path.ts"],"names":[],"mappings":"AAEA,iDAAiD;AACjD,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;AACpD,mDAAmD;AACnD,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,6BAA6B,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const getGithubInfo: () => Promise<Record<string, string>>;
2
+ export declare const validateUrl: (value: string) => boolean | string;
3
+ export declare const getSiteUrl: () => Promise<Record<string, string>>;
4
+ export declare const parsePlugins: (plugins: string[]) => string[];
5
+ export declare const getUserPlugins: () => Promise<string[]>;
6
+ export declare const parsePluginsData: (plugins: string[]) => Promise<Record<string, unknown>>;
7
+ //# sourceMappingURL=inquirer-prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inquirer-prompt.d.ts","sourceRoot":"","sources":["../../src/tools/inquirer-prompt.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,QAAa,QAAQ,OAAO,MAAM,EAAE,MAAM,CAAC,CAapE,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,MAAM,KAAG,OAAO,GAAG,MAMrD,CAAC;AAEF,eAAO,MAAM,UAAU,QAAa,QAAQ,OAAO,MAAM,EAAE,MAAM,CAAC,CAUjE,CAAC;AAEF,eAAO,MAAM,YAAY,YAAa,MAAM,EAAE,KAAG,MAAM,EAMrD,CAAC;AAEH,eAAO,MAAM,cAAc,QAAa,QAAQ,MAAM,EAAE,CAUvD,CAAC;AAEF,eAAO,MAAM,gBAAgB,YAAmB,MAAM,EAAE,KAAG,QAAQ,OAAO,MAAM,EAAE,OAAO,CAAC,CAWzF,CAAC"}
@@ -0,0 +1,62 @@
1
+ import inquirer from 'inquirer';
2
+ import { urlRegex } from './tools.js';
3
+ export const getGithubInfo = async () => {
4
+ const data = await inquirer.prompt([
5
+ {
6
+ type: 'input',
7
+ name: 'author',
8
+ message: 'What is your GitHub username?',
9
+ }, {
10
+ type: 'input',
11
+ name: 'repo',
12
+ message: 'What is your GitHub repository\'s name?',
13
+ },
14
+ ]);
15
+ return data;
16
+ };
17
+ export const validateUrl = (value) => {
18
+ if (value.length > 0 && urlRegex.test(value)) {
19
+ return true;
20
+ }
21
+ return 'Please enter a complete URL.';
22
+ };
23
+ export const getSiteUrl = async () => {
24
+ const siteAnswer = await inquirer.prompt([
25
+ {
26
+ type: 'input',
27
+ name: 'url',
28
+ message: 'What is the URL of your site?',
29
+ validate: validateUrl,
30
+ },
31
+ ]);
32
+ return siteAnswer.url;
33
+ };
34
+ export const parsePlugins = (plugins) => plugins.map((plugin) => {
35
+ if (plugin.endsWith('.txt') || plugin.endsWith('.xml')) {
36
+ return plugin.split('.')[0];
37
+ }
38
+ return plugin;
39
+ });
40
+ export const getUserPlugins = async () => {
41
+ const userPlugins = await inquirer.prompt([
42
+ {
43
+ type: 'checkbox',
44
+ name: 'plugins',
45
+ message: 'Select the plugins you want to use',
46
+ choices: [{ name: 'github' }, { name: 'robots.txt' }, { name: 'sitemap.xml' }],
47
+ },
48
+ ]);
49
+ return userPlugins.plugins;
50
+ };
51
+ export const parsePluginsData = async (plugins) => {
52
+ const parsedPlugins = parsePlugins(plugins);
53
+ let githubInfo;
54
+ if (parsedPlugins.includes('github')) {
55
+ githubInfo = await getGithubInfo();
56
+ }
57
+ return {
58
+ plugins: [...parsedPlugins, 'pagefind'],
59
+ ...(githubInfo && { github: githubInfo }),
60
+ };
61
+ };
62
+ //# sourceMappingURL=inquirer-prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inquirer-prompt.js","sourceRoot":"","sources":["../../src/tools/inquirer-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,IAAqC,EAAE;IACxE,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;QAClC;YACC,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,+BAA+B;SACxC,EAAE;YACF,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,yCAAyC;SAClD;KACD,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACb,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAa,EAAoB,EAAE;IAC9D,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;QAC7C,OAAO,IAAI,CAAC;KACZ;IAED,OAAO,8BAA8B,CAAC;AACvC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,IAAqC,EAAE;IACrE,MAAM,UAAU,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;QACxC;YACC,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,KAAK;YACX,OAAO,EAAE,+BAA+B;YACxC,QAAQ,EAAE,WAAW;SACrB;KACD,CAAC,CAAC;IACH,OAAO,UAAU,CAAC,GAAG,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAiB,EAAY,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAc,EAAE,EAAE;IAC3F,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACvD,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;KAC5B;IAED,OAAO,MAAM,CAAC;AACf,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,IAAuB,EAAE;IAC3D,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;QACzC;YACC,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,oCAAoC;YAC7C,OAAO,EAAE,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAC,EAAE,EAAC,IAAI,EAAE,YAAY,EAAC,EAAE,EAAC,IAAI,EAAE,aAAa,EAAC,CAAC;SACxE;KACD,CAAC,CAAC;IACH,OAAO,WAAW,CAAC,OAAO,CAAC;AAC5B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,OAAiB,EAAoC,EAAE;IAC7F,MAAM,aAAa,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IAC5C,IAAI,UAA8C,CAAC;IACnD,IAAI,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;QACrC,UAAU,GAAG,MAAM,aAAa,EAAE,CAAC;KACnC;IAED,OAAO;QACN,OAAO,EAAE,CAAC,GAAG,aAAa,EAAE,UAAU,CAAC;QACvC,GAAG,CAAC,UAAU,IAAI,EAAC,MAAM,EAAE,UAAU,EAAC,CAAC;KACvC,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const getFileName: () => string;
2
+ export declare const getConfigPath: () => string;
3
+ //# sourceMappingURL=path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/tools/path.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,cAAuC,CAAC;AAEhE,eAAO,MAAM,aAAa,cAA4C,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { fileURLToPath } from 'node:url';
2
+ export const getFileName = () => fileURLToPath(import.meta.url);
3
+ // eslint-disable-next-line n/prefer-global/process
4
+ export const getConfigPath = () => `${process.cwd()}/site/config.json`;
5
+ //# sourceMappingURL=path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.js","sourceRoot":"","sources":["../../src/tools/path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AAEvC,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChE,mDAAmD;AACnD,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,mBAAmB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const reportError: (error: unknown) => void;
2
+ export declare const urlRegex: RegExp;
3
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/tools/tools.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,UAAW,OAAO,KAAG,IAO5C,CAAC;AAEF,eAAO,MAAM,QAAQ,QAA6E,CAAC"}
@@ -0,0 +1,10 @@
1
+ import logger from '../logger.js';
2
+ export const reportError = (error) => {
3
+ let message = String(error);
4
+ if (error instanceof Error) {
5
+ message = error.message;
6
+ }
7
+ logger.error(message);
8
+ };
9
+ export const urlRegex = /^(http(s)?:\/\/.)[-\w@:%.+~#=]{2,256}\.[a-z]{2,6}\b([-\w@:%+.~#?&/=]*)$/g;
10
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/tools/tools.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAc,EAAQ,EAAE;IACnD,IAAI,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5B,IAAI,KAAK,YAAY,KAAK,EAAE;QAC3B,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;KACxB;IAED,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,0EAA0E,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type DoculaPlugins from '../plugins/index.js';
2
+ import { type PluginConfig, type PluginInstance } from '../plugins/index.js';
3
+ export { type PluginConfig, type PluginInstance } from '../plugins/index.js';
4
+ export type PluginName = keyof typeof DoculaPlugins;
5
+ export type PluginInstances = Record<string, PluginInstance>;
6
+ export type Plugins = PluginName[];
7
+ export type PluginConfigs = Record<PluginName, PluginConfig>;
8
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAC,KAAK,YAAY,EAAE,KAAK,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAE3E,OAAO,EAAC,KAAK,YAAY,EAAE,KAAK,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAE3E,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,aAAa,CAAC;AAEpD,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAE7D,MAAM,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;AAEnC,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":""}
package/init/index.njk CHANGED
@@ -14,7 +14,7 @@
14
14
  </div>
15
15
  <section class="home-container">
16
16
  {% if github %}
17
- {% if github.contributors %}
17
+ {% if (github.contributors) and (github.contributors.length) %}
18
18
  <div class="content-container">
19
19
  <h2 class="home-title">Contributors</h2>
20
20
  <div class="facepile-container">
@@ -29,7 +29,7 @@
29
29
  </div>
30
30
  {% endif %}
31
31
 
32
- {% if github.releases %}
32
+ {% if (github.releases) and (github.releases.length) %}
33
33
  <div class="content-container">
34
34
  <h2 class="home-title">Latest's Releases</h2>
35
35
  {% set releasesLength = github.releases | length %}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docula",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "Open Source Static Site Generator",
5
5
  "exports": "./dist/docula.js",
6
6
  "types": "./dist/docula.d.ts",
@@ -65,7 +65,7 @@
65
65
  "download-stats": "^0.3.4",
66
66
  "eleventy-plugin-toc": "^1.1.5",
67
67
  "fs-extra": "^11.1.0",
68
- "inquirer": "^8.2.3",
68
+ "inquirer": "^9.1.4",
69
69
  "instantsearch.js": "^4.50.2",
70
70
  "luxon": "^3.2.1",
71
71
  "markdown-it": "^13.0.1",