generated from fallion/go-template
-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hopefully will mean less of a headache with docusaurus dependencies. Closes #407
- Loading branch information
Showing
196 changed files
with
1,327 additions
and
12,330 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,3 @@ | ||
# Contributing | ||
|
||
Contributions are most welcome. Please check the [CONTRIBUTING](https://commitsar.tech/docs/contributing/get_started) section of documentation. | ||
Contributions are most welcome. Please check the [CONTRIBUTING](https://commitsar.aevea.ee/contributing/get_started) section of documentation. |
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 @@ | ||
public |
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,6 @@ | ||
--- | ||
title: "{{ replace .Name "-" " " | title }}" | ||
date: {{ .Date }} | ||
draft: true | ||
--- | ||
|
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,19 @@ | ||
baseURL = "https://commitsar.aevea.ee" | ||
title = "Commitsar" | ||
theme = "hugo-geekdoc" | ||
|
||
pluralizeListTitles = false | ||
|
||
# Geekdoc required configuration | ||
pygmentsUseClasses = true | ||
pygmentsCodeFences = true | ||
disablePathToLower = true | ||
|
||
# Needed for mermaid shortcodes | ||
[markup] | ||
[markup.goldmark.renderer] | ||
# Needed for mermaid shortcode | ||
unsafe = true | ||
[markup.tableOfContents] | ||
startLevel = 1 | ||
endLevel = 9 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,20 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2021 Robert Kaussow | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the "Software"), to deal in | ||
the Software without restriction, including without limitation the rights to | ||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
the Software, and to permit persons to whom the Software is furnished to do so, | ||
subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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,44 @@ | ||
# Geekdoc | ||
|
||
[![Build Status](https://img.shields.io/drone/build/thegeeklab/hugo-geekdoc?logo=drone&server=https%3A%2F%2Fdrone.thegeeklab.de)](https://drone.thegeeklab.de/thegeeklab/hugo-geekdoc) | ||
[![Hugo Version](https://img.shields.io/badge/hugo-0.83-blue.svg)](https://gohugo.io) | ||
[![GitHub release](https://img.shields.io/github/v/release/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/releases/latest) | ||
[![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/graphs/contributors) | ||
[![License: MIT](https://img.shields.io/github/license/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/blob/main/LICENSE) | ||
|
||
Geekdoc is a simple Hugo theme for documentations. It is intentionally designed as a fast and lean theme and may not fit the requirements of complex projects. If a more feature-complete theme is required there are a lot of got alternatives out there. You can find a demo and the full documentation at [https://geekdocs.de](https://geekdocs.de). | ||
|
||
![Desktop and mobile preview](https://raw.githubusercontent.com/thegeeklab/hugo-geekdoc/main/images/readme.png) | ||
|
||
## Build and release process | ||
|
||
This theme is subject to a CI driven build and release process common for software development. During the release build, all necessary assets are automatically built by [gulp](https://gulpjs.com/) and bundled in a release tarball. You can download the latest release from the GitHub [release page](https://github.com/thegeeklab/hugo-geekdoc/releases). | ||
|
||
Due to the fact that `gulp` is used as pre-processor the theme cannot be used from the main branch by default. If you want to use the theme from a cloned branch instead of a release tarball you'll need to install `gulp` locally and run the default pipeline once to create all required assets. | ||
|
||
```Shell | ||
# install required packages from package.json | ||
npm install | ||
|
||
# run gulp pipeline to build required assets | ||
npx gulp default | ||
``` | ||
|
||
See the [Getting Started Guide](https://geekdocs.de/usage/getting-started/) for details about the different setup options. | ||
|
||
## Contributors | ||
|
||
Special thanks goes to all [contributors](https://github.com/thegeeklab/hugo-geekdoc/graphs/contributors). If you would like to contribute, | ||
please see the [instructions](https://github.com/thegeeklab/hugo-geekdoc/blob/main/CONTRIBUTING.md). | ||
|
||
Geekdoc is inspired and partially based on the [hugo-book](https://github.com/alex-shpak/hugo-book) theme, thanks [Alex Shpak](https://github.com/alex-shpak/) for your work. | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License - see the [LICENSE](https://github.com/thegeeklab/hugo-geekdoc/blob/main/LICENSE) file for details. | ||
|
||
The used SVG icons and generated icon fonts are licensed under the license of the respective icon pack: | ||
|
||
- Font Awesome: [CC BY 4.0 License](https://github.com/FortAwesome/Font-Awesome#license) | ||
- IcoMoon Free Pack: [GPL/CC BY 4.0](https://icomoon.io/#icons-icomoon) | ||
- Material Icons: [Apache License 2.0](https://github.com/google/material-design-icons/blob/main/LICENSE) |
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 @@ | ||
v0.17.1 |
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 @@ | ||
--- | ||
title: "{{ .Name | humanize | title }}" | ||
weight: 1 | ||
# geekdocFlatSection: false | ||
# geekdocToc: 6 | ||
# geekdocHidden: false | ||
--- |
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,4 @@ | ||
--- | ||
title: "{{ replace .Name "-" " " | title }}" | ||
date: {{ .Date }} | ||
--- |
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,171 @@ | ||
'use strict'; | ||
|
||
{{ $searchDataFile := printf "%s.search-data.json" .Language.Lang }} | ||
{{ $searchData := resources.Get "search-data.json" | resources.ExecuteAsTemplate $searchDataFile . | resources.Minify }} | ||
|
||
(function() { | ||
const input = document.querySelector('#gdoc-search-input'); | ||
const results = document.querySelector('#gdoc-search-results'); | ||
let showParent = {{ if .Site.Params.GeekdocSearchShowParent }}true{{ else }}false{{ end }} | ||
|
||
if (input) { | ||
input.addEventListener('focus', init); | ||
input.addEventListener('keyup', search); | ||
} | ||
|
||
function init() { | ||
input.removeEventListener('focus', init); // init once | ||
|
||
loadScript('{{ index .Site.Data.assets "js/groupBy.min.js" | relURL }}'); | ||
loadScript('{{ index .Site.Data.assets "js/flexsearch.min.js" | relURL }}', function() { | ||
const indexCfgDefaults = { | ||
tokenize: 'forward' | ||
} | ||
const indexCfg = {{ with .Scratch.Get "geekdocSearchConfig" }}{{ . | jsonify }}{{ else }}indexCfgDefaults{{ end }}; | ||
const dataUrl = '{{ $searchData.RelPermalink }}' | ||
|
||
indexCfg.document = { | ||
key: 'id', | ||
index: ['title', 'content'], | ||
store: ['title', 'href', 'parent'], | ||
}; | ||
|
||
const index = new FlexSearch.Document(indexCfg); | ||
window.geekdocSearchIndex = index; | ||
|
||
getJson(dataUrl, function(data) { | ||
data.forEach(obj => { | ||
window.geekdocSearchIndex.add(obj); | ||
}); | ||
}); | ||
}); | ||
} | ||
|
||
function search() { | ||
const searchCfg = { | ||
enrich: true, | ||
limit: 10 | ||
}; | ||
|
||
while (results.firstChild) { | ||
results.removeChild(results.firstChild); | ||
} | ||
|
||
if (!input.value) { | ||
return results.classList.remove('has-hits'); | ||
} | ||
|
||
let searchHits = flattenHits(window.geekdocSearchIndex.search(input.value, searchCfg)); | ||
if (searchHits.length < 1) { | ||
return results.classList.remove('has-hits'); | ||
} | ||
|
||
results.classList.add('has-hits'); | ||
|
||
if (showParent === true) { | ||
searchHits = groupBy(searchHits, hit => hit.parent); | ||
} | ||
|
||
const items = []; | ||
|
||
if (showParent === true) { | ||
for (const section in searchHits) { | ||
const item = document.createElement('li'), | ||
title = item.appendChild(document.createElement('span')), | ||
subList = item.appendChild(document.createElement('ul')); | ||
|
||
title.textContent = section; | ||
createLinks(searchHits[section], subList); | ||
|
||
items.push(item); | ||
} | ||
} else { | ||
const item = document.createElement('li'), | ||
title = item.appendChild(document.createElement('span')), | ||
subList = item.appendChild(document.createElement('ul')); | ||
|
||
title.textContent = 'Results'; | ||
createLinks(searchHits, subList); | ||
|
||
items.push(item); | ||
} | ||
|
||
items.forEach(item => { | ||
results.appendChild(item); | ||
}) | ||
} | ||
|
||
/** | ||
* Creates links to given fields and either returns them in an array or attaches them to a target element | ||
* @param {Object} fields Page to which the link should point to | ||
* @param {HTMLElement} target Element to which the links should be attatched | ||
* @returns {Array} If target is not specified, returns an array of built links | ||
*/ | ||
function createLinks(pages, target) { | ||
const items = []; | ||
|
||
for (const page of pages) { | ||
const item = document.createElement("li"), | ||
entry = item.appendChild(document.createElement("span")), | ||
a = entry.appendChild(document.createElement("a")); | ||
|
||
entry.classList.add('flex') | ||
|
||
a.href = page.href; | ||
a.textContent = page.title; | ||
a.classList.add('gdoc-search__entry') | ||
|
||
if (target) { | ||
target.appendChild(item); | ||
continue | ||
} | ||
|
||
items.push(item); | ||
} | ||
|
||
return items; | ||
} | ||
|
||
function fetchErrors(response) { | ||
if (!response.ok) { | ||
throw Error(response.statusText); | ||
} | ||
return response; | ||
} | ||
|
||
function getJson(src, callback) { | ||
fetch(src) | ||
.then(fetchErrors) | ||
.then(response => response.json()) | ||
.then(json => callback(json)) | ||
.catch(function(error) { | ||
console.log(error); | ||
}); | ||
} | ||
|
||
function flattenHits(results) { | ||
const items = []; | ||
const map = new Map(); | ||
|
||
for (const field of results) { | ||
for (const page of field.result) { | ||
if(!map.has(page.doc.href)){ | ||
map.set(page.doc.href, true); | ||
items.push(page.doc); | ||
} | ||
} | ||
} | ||
|
||
return items | ||
} | ||
|
||
function loadScript(src, callback) { | ||
let script = document.createElement('script'); | ||
script.defer = true; | ||
script.async = false; | ||
script.src = src; | ||
script.onload = callback; | ||
|
||
document.body.appendChild(script); | ||
} | ||
})(); |
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,12 @@ | ||
[ | ||
{{ range $index, $page := (where .Site.Pages "Params.GeekdocProtected" "ne" true) }} | ||
{{ if ne $index 0 }},{{ end }} | ||
{ | ||
"id": {{ $index }}, | ||
"href": "{{ $page.RelPermalink }}", | ||
"title": {{ (partial "title" $page) | jsonify }}, | ||
"parent": {{ with $page.Parent }}{{ (partial "title" .) | jsonify }}{{ else }}""{{ end }}, | ||
"content": {{ $page.Plain | jsonify }} | ||
} | ||
{{ end }} | ||
] |
Oops, something went wrong.