Skip to content

Commit

Permalink
new version
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Aug 12, 2024
1 parent 679ea03 commit bbcd26e
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 9 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this
project adheres to [Semantic Versioning](http://semver.org/).

## [0.9.3] - Unreleased
## [0.9.3] - 2024-08-12
### Added
- Settings to CMS to configure a default extra_head and language.
- New option to include additional links in the navbar.

## [0.9.2] - 2024-08-08
### Added
Expand Down Expand Up @@ -141,7 +142,7 @@ First version
[#8]: https://github.com/lumeland/theme-simple-wiki/issues/8
[#9]: https://github.com/lumeland/theme-simple-wiki/issues/9

[0.9.3]: https://github.com/lumeland/theme-simple-wiki/compare/v0.9.2...HEAD
[0.9.3]: https://github.com/lumeland/theme-simple-wiki/compare/v0.9.2...v0.9.3
[0.9.2]: https://github.com/lumeland/theme-simple-wiki/compare/v0.9.1...v0.9.2
[0.9.1]: https://github.com/lumeland/theme-simple-wiki/compare/v0.9.0...v0.9.1
[0.9.0]: https://github.com/lumeland/theme-simple-wiki/compare/v0.8.2...v0.9.0
Expand Down
37 changes: 32 additions & 5 deletions _cms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,49 @@ cms.document(
],
);

cms.document(
"settings: Global settings for the site",
"src:_data.yml",
[
cms.document({
name: "Settings",
description: "Global settings for the site",
store: "src:_data.yml",
url: "/",
fields: [
{
name: "lang",
type: "text",
label: "Language",
description: "The language of the site",
},
{
name: "extra_head",
type: "code",
description: "Extra content to include in the <head> tag",
},
{
name: "menu_links",
type: "object-list",
description: "Extra links to include in the main menu",
fields: [
{
name: "text",
type: "text",
label: "Text",
},
{
name: "href",
type: "text",
label: "URL",
},
{
name: "icon",
type: "text",
label: "Icon",
description:
"<a href='https://phosphoricons.com/' target='_blank'>A Phosphor icon</a> name",
},
],
},
],
);
});

cms.collection(
"pages: All pages of the site",
Expand Down
5 changes: 3 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"imports": {
"lume/": "https://deno.land/x/[email protected]/",
"lume/cms/": "https://cdn.jsdelivr.net/gh/lumeland/cms@v0.3.10/"
"lume/cms/": "https://cdn.jsdelivr.net/gh/lumeland/cms@v0.5.9/"
},
"lock": false,
"tasks": {
"lume": "echo \"import 'lume/cli.ts'\" | deno run -A -",
"build": "deno task lume",
"serve": "deno task lume -s",
"update-deps": "deno run -A 'https://deno.land/x/[email protected]/cli.ts' update deno.json"
"cms": "deno task lume cms",
"update-deps": "deno run -A 'https://deno.land/x/[email protected]/cli.ts' update deno.json"
},
"compilerOptions": {
"types": [
Expand Down
12 changes: 12 additions & 0 deletions plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import prism from "lume/plugins/prism.ts";
import date from "lume/plugins/date.ts";
import basePath from "lume/plugins/base_path.ts";
import favicon, { Options as FaviconOptions } from "lume/plugins/favicon.ts";
import phosphor, {
Options as IconOptions,
} from "https://deno.land/x/[email protected]/phosphor.ts";
import { alert } from "npm:@mdit/[email protected]";

import "lume/types.ts";
Expand All @@ -18,6 +21,11 @@ export interface Options {
* Options for the favicon plugin.
*/
favicon?: FaviconOptions;

/**
* Options for the phosphor plugin.
*/
icons?: IconOptions;
}

export default function (options: Options = {}) {
Expand All @@ -33,6 +41,10 @@ export default function (options: Options = {}) {
.use(date())
.use(favicon(options.favicon))
.use(basePath())
.use(phosphor({
...options.icons,
name: "icon",
}))
.data("layout", "layout.vto")
.data("date", "Git Last Modified")
.data("order", 0)
Expand Down
1 change: 1 addition & 0 deletions src/_data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
menu_links: []
12 changes: 12 additions & 0 deletions src/_includes/css/menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,18 @@
color: var(--color-base);
background-color: var(--color-line);
}

.menu-custom {
display: flex;
align-items: center;
column-gap: 8px;

svg {
width: 20px;
height: 20px;
fill: var(--color-base);
}
}
}

[data-theme="dark"] {
Expand Down
9 changes: 9 additions & 0 deletions src/_includes/templates/menu.vto
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,14 @@
{{ include "templates/menu_item.vto" { item } }}
</li>
{{ /for }}

{{- for link of menu_links }}
<li>
<a href="{{ link.href }}" class="menu-custom">
{{ link.icon |> icon }}
{{ link.text }}
</a>
</li>
{{ /for }}
</ul>
</nav>

0 comments on commit bbcd26e

Please sign in to comment.