Skip to content

Commit 4712fe5

Browse files
committed
Initial commit
0 parents  commit 4712fe5

131 files changed

Lines changed: 10994 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Sample workflow for building and deploying a VitePress site to GitHub Pages
2+
#
3+
name: Deploy VitePress site to Pages
4+
5+
on:
6+
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
7+
# using the `master` branch as the default branch.
8+
push:
9+
branches: [main]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
19+
20+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
21+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
22+
concurrency:
23+
group: pages
24+
cancel-in-progress: false
25+
26+
jobs:
27+
# Build job
28+
build:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v5
33+
with:
34+
fetch-depth: 0 # Not needed if lastUpdated is not enabled
35+
- uses: pnpm/action-setup@v4 # Uncomment this block if you're using pnpm
36+
with:
37+
version: 9 # Not needed if you've set "packageManager" in package.json
38+
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
39+
- name: Setup Node
40+
uses: actions/setup-node@v6
41+
with:
42+
node-version: 24
43+
cache: pnpm # or pnpm / yarn
44+
- name: Setup Pages
45+
uses: actions/configure-pages@v4
46+
- name: Install dependencies
47+
run: pnpm install # or pnpm install / yarn install / bun install
48+
- name: Build with VitePress
49+
run: pnpm run build # or pnpm docs:build / yarn docs:build / bun run docs:build
50+
- name: Upload artifact
51+
uses: actions/upload-pages-artifact@v3
52+
with:
53+
path: docs/.vitepress/dist
54+
55+
# Deployment job
56+
deploy:
57+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
needs: build
61+
runs-on: ubuntu-latest
62+
name: Deploy
63+
steps:
64+
- name: Deploy to GitHub Pages
65+
id: deployment
66+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
cache
2+
dist
3+
temp
4+
5+
node_modules/

docs/.vitepress/config.mts

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
import { createContentLoader, defineConfig, type DefaultTheme } from 'vitepress'
2+
import { generateSidebarItems, getFiles } from './sidebar'
3+
4+
const isBuild = process.env.NODE_ENV === 'production'
5+
const baseUrl = isBuild && '/libremesh.github.io' || ''
6+
7+
const libremesh = {
8+
stable_version: '2024.1',
9+
stable_branch_openwrt: ['23.05'],
10+
oldstable_version: '2020.4',
11+
oldstable_branch_openwrt: ['19.07'],
12+
}
13+
14+
const packages = await getFiles('docs/packages/*.md'); // Path to folder
15+
16+
// https://vitepress.dev/reference/site-config
17+
export default defineConfig({
18+
title: "LibreMesh",
19+
description: "A modular framework for creating OpenWrt-based firmwares for wireless mesh nodes",
20+
head: [['link', { rel: 'icon', href: baseUrl+'/favicon.ico' }]],
21+
lastUpdated: true,
22+
base: baseUrl,
23+
metaChunk: true,
24+
25+
locales: {
26+
root: {
27+
label: 'English',
28+
lang: 'en'
29+
},
30+
},
31+
32+
themeConfig: {
33+
// https://vitepress.dev/reference/default-theme-config
34+
logo: { light: '/libremesh_logo.svg', dark: '/libremesh_logo.svg', alt: 'Logo' },
35+
siteTitle: false,
36+
editLink: {
37+
pattern: 'https://github.com/a-gave/libremesh.github.io/edit/main/docs/:path',
38+
text: 'Edit this page on GitHub'
39+
},
40+
search: {
41+
provider: 'local'
42+
},
43+
44+
nav: nav(),
45+
46+
sidebar: {
47+
'/': { base: '/', items: sidebarGuide() },
48+
'/reference/': { base: '/reference/', items: sidebarReference() }
49+
},
50+
51+
socialLinks: [
52+
{ icon: 'github', link: 'https://github.com/libremesh/lime-packages' },
53+
// { icon: 'maildotru', link: 'https://www.autistici.org/mailman/listinfo/libremesh' },
54+
{ icon: 'matrix', link: 'https://matrix.to/#/#libremesh-dev:matrix.guifi.net' },
55+
{ icon: 'mastodon', link: 'https://social.freifunk.net/@libremesh' },
56+
{ icon: 'peertube', link: 'https://media.exo.cat/a/libremesh' }
57+
],
58+
},
59+
// async buildEnd() {
60+
// // const meetings = await createContentLoader('meetings/*.md').load()
61+
// // generate files based on posts metadata, e.g. RSS feed
62+
// }
63+
})
64+
65+
function nav(): DefaultTheme.NavItem[] {
66+
return [
67+
{ text: 'Reference', link: '/reference/configuration' },
68+
// { text: 'News', link: '/news' },
69+
{ text: 'v2024.1',
70+
items: [
71+
{ text: 'v2020.4', link: '/news/2023-10-07' },
72+
{ text: 'News', link: '/news' },
73+
{ text: 'Changelog', link: 'https://github.com/libremesh/lime-packages/tree/master/CHANGELOG.md'},
74+
{ text: 'Issues', link: 'https://github.com/libremesh/lime-packages/issues'},
75+
]
76+
},
77+
]
78+
}
79+
80+
function sidebarGuide(): DefaultTheme.SidebarItem[] {
81+
return [
82+
{
83+
text: 'Introduction',
84+
collapsed: false,
85+
items: [
86+
{ text: 'What is LibreMesh?', link: '/what-is-libremesh' },
87+
{ text: 'Getting Started', link: '/getting-started' },
88+
{ text: 'Features', link: '/features' },
89+
]
90+
},
91+
{
92+
text: 'User Guide',
93+
collapsed: false,
94+
items: [
95+
{ text: 'Connecting to the router', link: '/install/connecting' },
96+
{ text: 'Packages selection',
97+
link: '/install/packages-selection',
98+
collapsed: true,
99+
items: [
100+
{ text: 'Build customization', link: '/install/packages-selection' },
101+
{ text: 'Network Profiles', link: '/install/network-profiles' }
102+
] },
103+
{ text: 'Build LibreMesh',
104+
link: '/build',
105+
collapsed: true,
106+
items: [
107+
{ text: 'Build methods', link: '/build/' },
108+
{ text: 'Imagebuilder', link: '/build/imagebuilder' },
109+
{ text: 'Buildroot', link: '/build/buildroot/debian'}
110+
]}
111+
]
112+
},
113+
{
114+
text: 'Developer Guide',
115+
collapsed: false,
116+
items: [
117+
{ text: 'Run it on QEMU', link: '/install/qemu' }
118+
]
119+
},
120+
{
121+
text: 'Community',
122+
collapsed: false,
123+
items: [
124+
{ text: 'Communication', link: '/communication' },
125+
{ text: 'Contribute', link: '/contribute' },
126+
{ text: 'Meetings', link: '/meetings' },
127+
{ text: 'News', link: '/news' }
128+
129+
]
130+
},
131+
{
132+
text: 'Resources',
133+
collapsed: false,
134+
link: '/resources',
135+
items: [
136+
{ text: 'Media list', link: '/resources/media_list' },
137+
{ text: 'Related projects', link: '/resources/related_projects' },
138+
{ text: 'Tools',
139+
link: '/resources/tools/monitoring',
140+
collapsed: true,
141+
items: [
142+
{ text: 'Monitoring', link: '/resources/tools/monitoring' },
143+
]},
144+
]
145+
},
146+
{
147+
text: 'Packages',
148+
collapsed: false,
149+
link: '/resources',
150+
items: generateSidebarItems(packages),
151+
},
152+
]
153+
}
154+
155+
156+
function sidebarReference(): DefaultTheme.SidebarItem[] {
157+
return [
158+
{
159+
text: 'Reference',
160+
items: [
161+
{ text: 'Configuration', link: 'configuration' },
162+
{ text: 'Flavors', link: '/reference/flavors' },
163+
{ text: 'lime-files', items: [
164+
{ text: 'System options', link: 'system' },
165+
{ text: 'Network options', link: 'network/', items: [
166+
{ text: 'Protocols list', link: 'network/protocols-list'},
167+
{ text: 'Protocols options', link: 'network/protocols-options'},
168+
{ text: 'Interface specific', link: 'network/interface-specific'},
169+
] },
170+
{ text: 'Wifi', link: 'wifi', items: [
171+
{ text: 'Band specific', link: 'wifi#wifi-band-specific-options'},
172+
{ text: 'Interface specific', link: 'wifi#wifi-interface-specific-options'},
173+
{ text: 'Client mode', link: 'wifi#wifi-client-mode'},
174+
{ text: 'Backbone AP', link: 'wifi#wifi-backbone-ap'},
175+
] },
176+
{ text: 'Generic UCI configs', link: 'openwrt_configs' },
177+
{ text: 'BGP', link: 'bgp' },
178+
{ text: 'Ground Routing', link: 'wifi' },
179+
{ text: 'Watchcat', link: 'watchcat' }
180+
]}
181+
]
182+
}
183+
]
184+
}

docs/.vitepress/sidebar.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import { glob } from 'glob'
2+
import fs from 'fs'
3+
import matter from 'gray-matter'
4+
5+
export interface INavItem {
6+
title: string;
7+
id: string;
8+
link: string;
9+
}
10+
11+
export interface INavMenuItem {
12+
text: string;
13+
link: string;
14+
}
15+
16+
export function getFiles(path: string): Promise<INavItem[]> {
17+
return new Promise((resolve, reject) => {
18+
let navigation: INavItem[] = [];
19+
const filePath = path;
20+
const files: string[] = glob.sync(filePath);
21+
files.sort();
22+
for (const file of files) {
23+
const fileData = fs.readFileSync(file).toString();
24+
const fm = matter(fileData);
25+
26+
let title = fm.data.title;
27+
if (fm.data.title === undefined) {
28+
title = file;
29+
}
30+
31+
navigation.push({
32+
title,
33+
id: fm.data.id, // Custom data
34+
link: file.replace('docs', ''), // Passing in the entire docs folder path, so removing this manually
35+
});
36+
}
37+
resolve(navigation);
38+
});
39+
}
40+
41+
export function generateSidebarItems(module: any) {
42+
let processedLinks: INavMenuItem[] = [];
43+
for(let i = 0; i < module.length; i++) {
44+
let title = '';
45+
const moduleData: INavItem = module[i];
46+
title += `<span class="custom-class">${moduleData.title}</span>`;
47+
processedLinks.push({
48+
text: title,
49+
link: moduleData.link,
50+
})
51+
}
52+
return processedLinks;
53+
}

docs/.vitepress/theme/index.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// https://vitepress.dev/guide/custom-theme
2+
import { h } from 'vue'
3+
import type { Theme } from 'vitepress'
4+
import DefaultTheme from 'vitepress/theme'
5+
import './style.css'
6+
7+
export default {
8+
extends: DefaultTheme,
9+
Layout: () => {
10+
return h(DefaultTheme.Layout, null, {
11+
// https://vitepress.dev/guide/extending-default-theme#layout-slots
12+
})
13+
},
14+
enhanceApp({ app, router, siteData }) {
15+
// ...
16+
}
17+
} satisfies Theme

0 commit comments

Comments
 (0)