Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions bin/docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,17 @@ readonly MY_PATH
readonly SCRIPT_DIR
readonly DOC_SINGLE="${SCRIPT_DIR}/doc-single.sh"
readonly LIB_BASH_DIR="${SCRIPT_DIR}/.."
readonly LIB_DOCS_DIR="${SCRIPT_DIR}/../docs/lib"
readonly LIB_DOCS_DIR="${SCRIPT_DIR}/../docs/_lib"

function front_matter() {
local title="${1?Must provide title}"
cat <<EOF
---
title: "${title} – lib-bash"
permalink: /lib/${title}/
---
EOF
}

function main() {
rm -rf "${LIB_DOCS_DIR}"
Expand All @@ -34,8 +44,10 @@ function main() {
for lib in "${LIB_BASH_DIR}"/lib_*.sh; do
local lib_name
lib_name="$(basename "${lib}")"
local target="${LIB_DOCS_DIR}/${lib_name%.sh}.md"
"${DOC_SINGLE}" "${lib}" >"${target}"
lib_title="${lib_name%.sh}"
local target="${LIB_DOCS_DIR}/${lib_title}.md"
front_matter "${lib_title}" >"${target}"
"${DOC_SINGLE}" "${lib}" >>"${target}"
done
}

Expand Down
8 changes: 8 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@
![Lib-Bash Decorative Image](img/LibBashGitHubSocialPreview.jpg)

A set of libraries to use from within your Bash scripts.

## Libraries

{% for lib in site.lib %}

- [{{ lib.title }}]({{ lib.url | relative_url }})

{% endfor %}
38 changes: 38 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# _config.yml
title: lib-bash – Bash Libraries
description: Documentation generated via Jekyll GitHub Action
theme: jekyll-theme-minimal

# Other configurations
markdown: kramdown
strict_front_matter: true
collections:
lib:
output: true
sort_by: title
permalink: /:collection/:path/
#plugins:
# - jekyll-feed
# - jekyll-seo-tag
# - jekyll-sitemap
# - jekyll-remote-theme
# - jekyll-redirect-from
# - jekyll-paginate
# - jekyll-archives
# - jekyll-github-metadata
# - jekyll-avatar
# - jekyll-mentions
# - jekyll-include-cache
# - jekyll-default-layout
# - jekyll-default-mimetype
# - jekyll-optional-front-matter
# - jekyll-readme-index
# - jekyll-relative-links
# - jekyll-remote-theme
# - jekyll-titles-from-headings
# - jekyll-redirect-from
# - jekyll-optional-front-matter
# - jekyll-remote-theme
# - jekyll-titles-from-headings
# - jekyll-redirect-from
#
4 changes: 4 additions & 0 deletions docs/lib/lib_console.md → docs/_lib/lib_console.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: "lib_console – lib-bash"
permalink: /lib/lib_console/
---

# lib_console.sh

Expand Down
4 changes: 4 additions & 0 deletions docs/lib/lib_gnucompat.md → docs/_lib/lib_gnucompat.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: "lib_gnucompat – lib-bash"
permalink: /lib/lib_gnucompat/
---

# GNU-Tools Compatibility Layer

Expand Down
4 changes: 4 additions & 0 deletions docs/lib/lib_init.md → docs/_lib/lib_init.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: "lib_init – lib-bash"
permalink: /lib/lib_init/
---

# lib_init.sh

Expand Down
4 changes: 4 additions & 0 deletions docs/lib/lib_scriptinfo.md → docs/_lib/lib_scriptinfo.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: "lib_scriptinfo – lib-bash"
permalink: /lib/lib_scriptinfo/
---

# lib_scriptinfo.sh

Expand Down
Loading