feat(docs): i18n support added to docs

This commit is contained in:
Matt Kilgore
2024-06-27 22:05:36 -04:00
committed by Katos
parent 6a1ffd7700
commit 04eb136ab0
10 changed files with 130 additions and 36 deletions

View File

@@ -8,6 +8,14 @@ export default defineConfig({
sitemap: {
hostname: 'https://homebox.sysadminsmedia.com',
},
locales: {
en: {
label: 'English',
lang: 'en',
}
},
themeConfig: {
logo: '/lilbox.svg',
@@ -23,22 +31,30 @@ export default defineConfig({
{ text: 'API', link: 'https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/sysadminsmedia/homebox/main/docs/docs/api/openapi-2.0.json' }
],
sidebar: [
sidebar: {
'/en/': [
{
text: 'Getting Started',
items: [
{ text: 'Quick Start', link: '/quick-start' },
{ text: 'Tips and Tricks', link: '/tips-tricks' }
{ text: 'Quick Start', link: '/en/quick-start' },
{ text: 'Tips and Tricks', link: '/en/tips-tricks' }
]
},
{
text: 'Advanced',
items: [
{ text: 'Import CSV', link: '/import-csv' },
{ text: 'Build from Source', link: '/build' }
{ text: 'Import CSV', link: '/en/import-csv' },
]
},
{
text: 'Contributing',
items: [
{ text: 'Get Started', link: '/en/contribute/get-started' },
{ text: 'Bounty Program', link: '/en/contribute/bounty' }
]
}
]
},
],
socialLinks: [
{ icon: 'discord', link: 'https://discord.gg/aY4DCkpNA9' },

View File

@@ -1,15 +0,0 @@
# Building The Binary
This document describes how to build the project from source code.
## Prerequisites
TODO
## Building
TODO
## Running
TODO

View File

@@ -0,0 +1,19 @@
# Bounty Program
## About
As part of our commitment to open source, and building an active community around Homebox (and hopefully active pool of developers), we are enabling bounties on issues.
After digging through several platforms we ended up settling on https://www.boss.dev/ as it has some of the lowest fees we could possibly find for any of these platforms other than spinning one up ourselves (which we currently aren't in a position to do).
While it's not the perfect solution, we think it's about the best one we could find at the moment to lower the rates as much as possible to make sure everyone get's the highest payouts possible. (Some we found were as high as a combined 16%!!!)
We hope that by enabling bounties on issues that people who have the means and want certain features implemented quicker can sponsor issues, and in turn everyone contributing code can potentially earn some money for their hard work.
## Contributor
As a contributor wanting to accept money from bounties you simply need to register for an account via GitHub, and attach a bank account (or debit card in the USA).
## Sponsor
Sign in with a GitHub account, and then attach a credit card to your account.
## Commands to use boss.dev
There is documentation on their website regarding commands that you can put in comments to use the bounty system. https://www.boss.dev/doc/

View File

@@ -0,0 +1,69 @@
# Getting Started With Contributing
## Get Started
### Prerequisites
There is a devcontainer available for this project. If you are using VSCode, you can use the devcontainer to get started. If you are not using VSCode, you need to ensure that you have the following tools installed:
- [Go 1.19+](https://golang.org/doc/install)
- [Swaggo](https://github.com/swaggo/swag)
- [Node.js 16+](https://nodejs.org/en/download/)
- [pnpm](https://pnpm.io/installation)
- [Taskfile](https://taskfile.dev/#/installation) (Optional but recommended)
- For code generation, you'll need to have `python3` available on your path. In most cases, this is already installed and available.
If you're using `taskfile` you can run `task --list-all` for a list of all commands and their descriptions.
### Setup
If you're using the taskfile, you can use the `task setup` command to run the required setup commands. Otherwise, you can review the commands required in the `Taskfile.yml` file.
Note that when installing dependencies with pnpm you must use the `--shamefully-hoist` flag. If you don't use this flag, you will get an error when running the frontend server.
### API Development Notes
start command `task go:run`
1. API Server does not auto reload. You'll need to restart the server after making changes.
2. Unit tests should be written in Go, however, end-to-end or user story tests should be written in TypeScript using the client library in the frontend directory.
test command `task go:test`
lint command `task go:lint`
swagger update command `task swag`
### Frontend Development Notes
start command `task: ui:dev`
1. The frontend is a Vue 3 app with Nuxt.js that uses Tailwind and DaisyUI for styling.
2. We're using Vitest for our automated testing. You can run these with `task ui:watch`.
3. Tests require the API server to be running, and in some cases the first run will fail due to a race condition. If this happens, just run the tests again and they should pass.
fix/lint code `task ui:fix`
type checking `task ui:check`
## Documentation
We use [Vitepress](https://vitepress.dev/) for the web documentation of homebox. Anyone is welcome to contribute the documentation if they wish.
For documentation contributions you only need NodeJS and PNPM.
::: info Notes
- Languages are seperated by folder (e.g `/en`, `/fr`, etc.)
- The Sidebar must be updated on a per language basis
- Each languages files can be named independently (slugs can match the language)
- The `public/_redirects` file is used to redirect the default to english
- Redirects can also be configured per language by adding `Language=` after the redirect code
:::
## Branch Flow
We use the `main` branch as the development branch. All PRs should be made to the `main` branch form a feature branch.
To create a pull request you can use the following steps:
1. Fork the repo and create a new branch from `main`
2. If you added code that should be tested, add tests
3. If you've changed APIs update the documentation
4. Ensure that the test suite and linters pass
5. Create your PR

View File

@@ -11,10 +11,10 @@ hero:
actions:
- theme: brand
text: Quick Start
link: /quick-start
link: /en/quick-start
- theme: alt
text: Tips and Tricks
link: /tips-tricks
link: /en/tips-tricks
features:
- title: Add/Update/Delete Items

View File

@@ -17,7 +17,7 @@ Homebox Custom Fields also have special support for URLs. Provide a URL (`https:
## Managing Asset IDs
Homebox provides the option to auto-set asset IDs, this is the default behavior. These can be used for tracking assets with printable tags or labels. You can disable this behavior via a command line flag or ENV variable. See [configuration](/quick-start#env-variables-configuration) for more details.
Homebox provides the option to auto-set asset IDs, this is the default behavior. These can be used for tracking assets with printable tags or labels. You can disable this behavior via a command line flag or ENV variable. See [configuration](/docs/en/quick-start.md#env-variables-configuration) for more details.
Example ID: `000-001`

4
docs/public/_redirects Normal file
View File

@@ -0,0 +1,4 @@
/* /en/:splat 302
# This is an example for a french redirect
# /* /fr/:splat 302 Language=fr

View File

@@ -14,5 +14,6 @@
"license": "ISC",
"devDependencies": {
"vitepress": "^1.2.3"
}
},
"packageManager": "pnpm@9.1.4+sha512.9df9cf27c91715646c7d675d1c9c8e41f6fce88246f1318c1aa6a1ed1aeb3c4f032fcdf4ba63cc69c4fe6d634279176b5358727d8f2cc1e65b65f43ce2f8bfb0"
}