WIP: move shit around

This commit is contained in:
Valentin Gagarin 2024-04-12 16:34:04 +02:00
parent 7be5afe882
commit 9a789f1f5b
18 changed files with 87 additions and 110 deletions

View File

@ -11,10 +11,17 @@ repo_license = "Open-source MIT License."
repo_url = "https://git.clan.lol/clan/"
# Menu items
[[extra.menu.main]]
name = "Docs"
section = "docs"
url = "/docs/thevision"
name = "Vision"
section = "vision"
url = "/vision/"
weight = 10
[[extra.menu.main]]
name = "Architecture"
section = "architecture"
url = "/architecture/"
weight = 10
[[extra.menu.main]]
@ -23,6 +30,18 @@ section = "blog"
url = "/blog/"
weight = 20
[[extra.menu.main]]
name = "Documentation"
section = "docs"
url = "/docs/"
weight = 10
[[extra.menu.main]]
name = "Contributing"
section = "contributing"
url = "/contributing/"
weight = 10
[[extra.list]]
title = "Easy to use"
content = 'cLAN provides a user-friendly interface that allows you to establish your own private network, complete with services.'

View File

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 174 KiB

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

@ -1,5 +1,5 @@
+++
title = "Technical Overview"
title = "Architecture"
description = "Overview of cLAN's architecture, components and security"
date = 2021-05-01T18:10:00+00:00
updated = 2021-07-13T18:10:00+00:00
@ -11,7 +11,6 @@ template = "docs/page.html"
[extra]
lead = "Overview of cLAN's architecture, components and security"
toc = true
top = false
+++

View File

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View File

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 140 KiB

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

21
content/contributing.md Normal file
View File

@ -0,0 +1,21 @@
+++
title = "Contribute to cLAN"
description = "Hack on the code, improve documentation, or submit a showcase."
date = 2021-05-01T18:10:00+00:00
updated = 2021-05-01T18:10:00+00:00
draft = false
weight = 410
sort_by = "weight"
template = "docs/page.html"
[extra]
toc = true
+++
👉 Explore our repos at [git.clan.lol/clan](https://git.clan.lol/clan)
👉 [Open issues](https://git.clan.lol/clan/clan-core/issues)
👉 [Open pull requests](https://git.clan.lol/clan/clan-core/issues)
👉 Source code for this site: [git.clan.lol/clan/clan-homepage](https://git.clan.lol/clan/clan-homepage/src/branch/main/content/docs)

View File

@ -1,28 +0,0 @@
+++
title = "How to Contribute"
description = "Contribute to cLAN, improve documentation, or submit to showcase."
date = 2021-05-01T18:10:00+00:00
updated = 2021-05-01T18:10:00+00:00
draft = false
weight = 410
sort_by = "weight"
template = "docs/page.html"
[extra]
lead = "Contribute to cLAN, improve documentation, or submit to showcase."
toc = true
top = false
+++
## Contribute to the code
👉 Explore our repos at [git.clan.lol/clan](https://git.clan.lol/clan)
👉 [Browse issues](https://git.clan.lol/clan/clan-core/issues)
👉 [Create a new issue](https://git.clan.lol/clan/clan-core/issues/new)
## Improve documentation
👉 The source code for this site lives in [git.clan.lol/clan/clan-homepage](https://git.clan.lol/clan/clan-homepage/src/branch/main/content/docs)

View File

@ -1,13 +1,17 @@
+++
title = "The Vision"
description = "The General Vision of this Project"
title = "Vision"
description = "The Vision for this Project"
date = 2021-05-01T19:30:00+00:00
updated = 2021-05-01T19:30:00+00:00
draft = false
weight = 30
sort_by = "weight"
paginator.next = "docs/overview/index.md"
paginator.next = "/architecture/"
template = "docs/page.html"
[extra]
lead = "Overview of cLAN's architecture, components and security"
toc = true
+++
@ -39,4 +43,4 @@ The core idea is to ensure service decentralization without a single point of fa
Within a cLAN, administrators define the configuration file and have control over who becomes part of the network.
Go to [Technical Overview](@/docs/overview/index.md) to see more indepth details of our work.
Go to [Architecture](architecture/) to see more indepth details of our work.

View File

@ -1,75 +1,39 @@
{
self,
inputs,
...
{ self
, inputs
, ...
}: {
perSystem = {
lib,
pkgs,
self',
inputs',
...
}: let
build = baseUrl: pkgs.runCommand "website" {
buildInputs = [ pkgs.zola ];
} ''
mkdir -p $out
cp -r ${self}/* .
chmod -R u+w .
perSystem =
{ lib
, pkgs
, self'
, inputs'
, ...
}:
let
build = baseUrl: pkgs.runCommand "website"
{
buildInputs = [ pkgs.zola ];
} ''
mkdir -p $out
cp -r ${self}/* .
chmod -R u+w .
substituteInPlace config.toml --replace \
'base_url = "https://clan.lol"' \
'base_url = "${baseUrl}"' \
substituteInPlace config.toml --replace \
'base_url = "https://clan.lol"' \
'base_url = "${baseUrl}"' \
# generates a zola compatible .md from a clan-core/docs/**/*.md
generatePage() {
local sourceFile="$1"
local targetFile="$2"
# generate title by reading first non-empty line of $file and stripping all '#' symbols
title=$(sed -n '/./{p;q}' "$sourceFile" | sed 's/#*//g')
echo "generating page from clan-core: $title"
# generate header with title, template, weight to make zola happy
echo -e "+++\ntitle = \"$title\"\ntemplate = \"docs/page.html\"\nweight = 0\n+++" > "$targetFile"
# append everything from the file but remove header line starting with '#' and all preceding non-empty lines
tail -n +2 "$sourceFile" >> "$targetFile"
}
# inject pages from clan-core
for dir in ${inputs.clan-core}/docs/*; do
subdir=$(basename $dir)
targetDir="content/docs/$subdir"
mkdir -p "$targetDir"
for file in ${inputs.clan-core}/docs/$subdir/*.md; do
target="content/docs/$subdir/$(basename $file)"
# only generate page if file doesn't start with _
if [[ $(basename $file) == _* ]]; then
cat "$file" > "$target"
continue
fi
generatePage "$file" "$target"
done
done
# inject nixos options docs for clanCore
cp -r ${inputs'.clan-core.packages.docs-zola-pages-core} content/docs/core-options
# inject nixos options docs for clanModules
cp -r ${inputs'.clan-core.packages.docs-zola-pages-modules} content/docs/modules-options
zola build
cp -r public/* public/.* $out
'';
in {
packages.default = self'.packages.website;
packages.website = build "https://clan.lol";
packages.website-localhost = build "http://localhost:1111";
packages.serve = pkgs.writeShellScriptBin "serve-local" ''
echo "serving: ${self'.packages.website-localhost}"
${pkgs.python3}/bin/python -m http.server 1111 \
-d ${self'.packages.website-localhost}
'';
};
zola build
cp -r public/* public/.* $out
'';
in
{
packages.default = self'.packages.website;
packages.website = build "https://clan.lol";
packages.website-localhost = build "http://localhost:1111";
packages.serve = pkgs.writeShellScriptBin "serve-local" ''
echo "serving: ${self'.packages.website-localhost}"
${pkgs.python3}/bin/python -m http.server 1111 \
-d ${self'.packages.website-localhost}
'';
};
}

View File

@ -14,7 +14,6 @@
<div class="wrap container" role="document">
<div class="content">
<div class="row flex-xl-nowrap">
{{ macros_sidebar::docs_sidebar(current_section=current_section) }}
{{ macros_toc::docs_toc(page=page) }}
<main class="docs-content col-lg-11 col-xl-9">
<h1>{{ page.title }}</h1>
@ -23,7 +22,6 @@
{% if config.extra.edit_page %}
{{ macros_edit_page::docs_edit_page(current_path=current_path) }}
{% endif %}
{{ macros_navigation::docs_navigation(page=page, current_section=current_section) }}
</main>
</div>
</div>