Skip to content

Commit

Permalink
frontmatter: support VSCode Front Matter extension #481
Browse files Browse the repository at this point in the history
  • Loading branch information
McShelby committed Feb 19, 2023
1 parent 0e0b3bb commit bbd322b
Show file tree
Hide file tree
Showing 10 changed files with 1,126 additions and 2 deletions.
1 change: 1 addition & 0 deletions .frontmatter/content/mediaDb.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The Relearn theme is a fork of the great [Learn theme](https://github.com/matcor
- Looks nice on paper (if you have to)
- Usable offline, no external dependencies
- [Usable from your local file system via `file://` protocol](https://mcshelby.github.io/hugo-theme-relearn/basics/configuration#serving-your-page-from-the-filesystem)
- Support for the [VSCode Front Matter extension](https://github.com/estruyf/vscode-front-matter) for on-premise CMS capabilities
- Support for Internet Explorer 11
- **Configurable theming and visuals**
- [Configurable brand images](https://mcshelby.github.io/hugo-theme-relearn/basics/customization#change-the-logo)
Expand Down
1 change: 1 addition & 0 deletions exampleSite/content/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The theme is a fork of the great [Learn theme](https://github.com/matcornic/hugo
- Looks nice on paper (if you have to)
- Usable offline, no external dependencies
- [Usable from your local file system via `file://` protocol]({{%relref "basics/configuration#serving-your-page-from-the-filesystem" %}})
- Support for the [VSCode Front Matter extension](https://github.com/estruyf/vscode-front-matter) for on-premise CMS capabilities
- Support for Internet Explorer 11
- **Configurable theming and visuals**
- [Configurable brand images]({{%relref "basics/customization#change-the-logo" %}})
Expand Down
16 changes: 15 additions & 1 deletion exampleSite/content/basics/migration/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ This document shows you what's new in the latest release. For a detailed list of

## 5.12.0 (not yet released)

- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} Support for the great [VSCode Front Matter extension](https://github.com/estruyf/vscode-front-matter) which provides on-premise CMS capabilties to Hugo.

The theme provides Front Matter snippets for its shortcodes. Currently only English and German is supported. Put a reference into your `frontmatter.json` like this

````json
{
...
"frontMatter.extends": [
"./vscode-frontmatter/snippets.en.json"
]
...
}
````

- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} Support for languages that are written right to left (like Arabic) is now complete and extended to the menu, the top navigation bar and print. You can experience this in the [pirate translation]({{%relref path="basics/migration" lang="pir" %}}). This feature is not available in Internet Explorer 11.

- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} The scrollbars are now colored according to their variant color scheme to better fit into the visuals.
Expand All @@ -33,7 +47,7 @@ This document shows you what's new in the latest release. For a detailed list of
In case you made changes to the theme that are dependend on this library you can place a copy of jQuery into your `static/js` directory and load it from your own `layouts/partials/custom-header.html` like this:

````html
<script src="{{"js/jquery.min.js"| relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" defer></script>
<script src="{{"js/jquery.min.js"| relURL}}" defer></script>
````

- {{% badge style="note" title=" " %}}Change{{% /badge %}} [Mermaid]({{% relref "shortcodes/mermaid#parameter" %}}) diagrams can now be configured for pan and zoom on site-, page-level or individually for each graph.
Expand Down
85 changes: 85 additions & 0 deletions frontmatter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"$schema": "https://frontmatter.codes/frontmatter.schema.json",
"frontMatter.content.defaultSorting": "LastModifiedAsc",
"frontMatter.content.hideFm": false,
"frontMatter.content.pageFolders": [
{
"contentTypes": [
"default"
],
"path": "[[workspace]]/exampleSite/content",
"title": "Docs"
}
],
"frontMatter.content.publicFolder": "static",
"frontMatter.experimental": true,
"frontMatter.extends": [
"./vscode-frontmatter/snippets.en.json"
],
"frontMatter.framework.id": "hugo",
"frontMatter.framework.startCommand": ".\\exampleSite\\hugo.exe server -p 1313 --bind 0.0.0.0 --navigateToChanged -s .\\exampleSite",
"frontMatter.git.commitMesage": "docs: changes via Front Matter editor",
"frontMatter.git.enabled": true,
"frontMatter.global.activeMode": "Editor",
"frontMatter.global.modes": [
{
"id": "Power",
"features": [
"dashboard.data.view",
"dashboard.snippets.manage",
"dashboard.snippets.view",
"dashboard.taxonomy.view",
"panel.actions",
"panel.contentType",
"panel.globalSettings",
"panel.metadata",
"panel.otherActions",
"panel.recentlyModified",
"panel.seo"
]
},
{
"id": "Editor",
"features": [
"dashboard.snippets.view",
"dashboard.taxonomy.view",
"panel.actions",
"panel.metadata"
]
}
],
"frontMatter.preview.host": "http://localhost:1313",
"frontMatter.preview.pathName": "{{pathToken.relPath}}/",
"frontMatter.taxonomy.categories": [],
"frontMatter.taxonomy.contentTypes": [
{
"fields": [
{
"name": "title",
"title": "Titel",
"type": "string"
},
{
"default": " ",
"name": "description",
"title": "Description",
"type": "string"
},
{
"name": "weight",
"title": "Weight",
"type": "number"
},
{
"name": "toc",
"title": "Create TOC",
"type": "boolean"
}
],
"name": "default",
"pageBundle": true,
"previewPath": null
}
],
"frontMatter.taxonomy.frontMatterType": "TOML"
}
23 changes: 23 additions & 0 deletions hugo-theme-relearn.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"extensions": {
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp

// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"eliostruyf.vscode-front-matter"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [
]
},
"folders": [
{
"path": "."
}
],
"settings": {
"explorer.excludeGitIgnore": true,
"terminal.integrated.defaultProfile.windows": "Command Prompt"
}
}
1 change: 1 addition & 0 deletions static/css/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -1709,6 +1709,7 @@ html[dir] #sidebar .collapsible-menu input.toggle:checked:before {
/* avoid breakage if no content is given */
content: "\200b";
}

/* task list and its checkboxes */
article ul li:has(input[type="checkbox"]) {
list-style: none;
Expand Down
2 changes: 1 addition & 1 deletion theme.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ features = ["badges", "breadcrumbs", "boxes", "buttons",
"chemical formulae", "customizable", "color variants",
"dark", "dark mode", "docs", "documentation",
"expand",
"favicon", "file inclusion", "file system support", "font awesome",
"favicon", "file inclusion", "file system support", "font awesome", "front matter cms",
"gfm",
"hidden pages",
"i18n", "icons", "ie11", "image resizing", "include", "internet explorer",
Expand Down
Loading

0 comments on commit bbd322b

Please sign in to comment.