-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b87c852
commit ec927ab
Showing
11 changed files
with
89 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"imports": { | ||
"lume/": "https://deno.land/x/[email protected]/", | ||
"lume/cms/": "https://cdn.jsdelivr.net/gh/lumeland/cms@0.5.10/" | ||
"lume/cms/": "https://cdn.jsdelivr.net/gh/lumeland/cms@v0.5.10/" | ||
}, | ||
"lock": false, | ||
"tasks": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { merge } from "lume/core/utils/object.ts"; | ||
import postcss from "lume/plugins/postcss.ts"; | ||
import pagefind from "lume/plugins/pagefind.ts"; | ||
import resolveUrls from "lume/plugins/resolve_urls.ts"; | ||
|
@@ -13,6 +14,7 @@ import phosphor, { | |
Options as IconOptions, | ||
} from "https://deno.land/x/[email protected]/phosphor.ts"; | ||
import { alert } from "npm:@mdit/[email protected]"; | ||
import multilanguage from "lume/plugins/multilanguage.ts"; | ||
|
||
import "lume/types.ts"; | ||
|
||
|
@@ -26,9 +28,20 @@ export interface Options { | |
* Options for the phosphor plugin. | ||
*/ | ||
icons?: IconOptions; | ||
|
||
/** | ||
* Language options for the multilanguage plugin. | ||
* The first language is the default language. | ||
*/ | ||
languages?: string[]; | ||
} | ||
export const defaults: Options = { | ||
languages: ["en"], | ||
}; | ||
|
||
export default function (userOptions?: Options) { | ||
const options = merge(defaults, userOptions); | ||
|
||
export default function (options: Options = {}) { | ||
return (site: Lume.Site) => { | ||
site.use(nav()) | ||
.use(title()) | ||
|
@@ -41,6 +54,11 @@ export default function (options: Options = {}) { | |
.use(date()) | ||
.use(favicon(options.favicon)) | ||
.use(basePath()) | ||
.data("languages", options.languages) | ||
.use(multilanguage({ | ||
languages: options.languages, | ||
defaultLanguage: options.languages[0], | ||
})) | ||
.use(phosphor({ | ||
...options.icons, | ||
name: "icon", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lang: gl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
id: index | ||
--- | ||
|
||
# Simple Wiki | ||
|
||
crea arquivos markdown para engadir páxinas. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
--- | ||
id: index | ||
--- | ||
|
||
# Simple Wiki | ||
|
||
Create markdown files to add pages. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
export const url = "/menu.json"; | ||
|
||
export default function ({ nav }: Lume.Data) { | ||
const menu = nav.menu("/", "", "order=asc basename=asc").children; | ||
export default function* ({ nav, languages }: Lume.Data) { | ||
for (const lang of languages) { | ||
const menu = | ||
nav.menu("/", `lang=${lang}`, "order=asc basename=asc").children; | ||
|
||
return JSON.stringify(menu, null, 2); | ||
yield { | ||
url: `/menu-${lang}.json`, | ||
content: JSON.stringify(menu, null, 2), | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters