Skip to content

Commit

Permalink
Suggestions for MkDocs and Lume
Browse files Browse the repository at this point in the history
  • Loading branch information
rycoll committed Sep 4, 2024
1 parent 6970bbd commit 9ebf807
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
29 changes: 29 additions & 0 deletions src/ssgs/lume.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import Ssg from './ssg.js';

export default class Lume extends Ssg {
constructor() {
super('lume');
}

/**
* Generates a list of build suggestions.
*
* @param filePaths {string[]} List of input file paths.
* @param options {{ config?: Record<string, any>; source?: string; readFile?: (path: string) => Promise<string | undefined>; }}
* @returns {Promise<import('../types.js').BuildCommands>}
*/
async generateBuildCommands(filePaths, options) {
const commands = await super.generateBuildCommands(filePaths, options);

commands.build.push({
value: 'deno task lume',
attribution: 'default for Lume sites'
});
commands.output.unshift({
value: '_site',
attribution: 'most common for Lume sites',
});

return commands;
}
}
29 changes: 29 additions & 0 deletions src/ssgs/mkdocs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import Ssg from './ssg.js';

export default class MkDocs extends Ssg {
constructor() {
super('mkdocs');
}

/**
* Generates a list of build suggestions.
*
* @param filePaths {string[]} List of input file paths.
* @param options {{ config?: Record<string, any>; source?: string; readFile?: (path: string) => Promise<string | undefined>; }}
* @returns {Promise<import('../types').BuildCommands>}
*/
async generateBuildCommands(filePaths, options) {
const commands = await super.generateBuildCommands(filePaths, options);

commands.build.push({
value: 'npx mkdocs build',
attribution: 'default for MkDocs sites'
});
commands.output.unshift({
value: 'site',
attribution: 'most common for MkDocs sites',
});

return commands;
}
}
6 changes: 4 additions & 2 deletions src/ssgs/ssgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import Static from './static.js';
import Astro from './astro.js';
import NuxtJs from './nuxt-js.js';
import Gatsby from './gatsby.js';
import MkDocs from './mkdocs.js';
import Lume from './lume.js';

/** @type {Record<import('@cloudcannon/configuration-types').SsgKey, Ssg>} */
export const ssgs = {
Expand All @@ -19,8 +21,8 @@ export const ssgs = {
astro: new Astro(),
sveltekit: new Sveltekit(),
bridgetown: new Bridgetown(),
lume: new Ssg('lume'),
mkdocs: new Ssg('mkdocs'),
lume: new Lume(),
mkdocs: new MkDocs(),
docusaurus: new Ssg('docusaurus'),
gatsby: new Gatsby(),
hexo: new Ssg('hexo'),
Expand Down

0 comments on commit 9ebf807

Please sign in to comment.