Skip to content

Commit

Permalink
feat(docs): i18n support added to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tankerkiller125 authored and katosdev committed Jun 29, 2024
1 parent 6a1ffd7 commit 04eb136
Show file tree
Hide file tree
Showing 10 changed files with 130 additions and 36 deletions.
48 changes: 32 additions & 16 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ export default defineConfig({
sitemap: {
hostname: 'https://homebox.sysadminsmedia.com',
},

locales: {
en: {
label: 'English',
lang: 'en',
}
},

themeConfig: {
logo: '/lilbox.svg',

Expand All @@ -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: [
{
text: 'Getting Started',
items: [
{ text: 'Quick Start', link: '/quick-start' },
{ text: 'Tips and Tricks', link: '/tips-tricks' }
]
},
{
text: 'Advanced',
items: [
{ text: 'Import CSV', link: '/import-csv' },
{ text: 'Build from Source', link: '/build' }
]
},
],
sidebar: {
'/en/': [
{
text: 'Getting Started',
items: [
{ text: 'Quick Start', link: '/en/quick-start' },
{ text: 'Tips and Tricks', link: '/en/tips-tricks' }
]
},
{
text: 'Advanced',
items: [
{ 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' },
Expand Down
15 changes: 0 additions & 15 deletions docs/build.md

This file was deleted.

19 changes: 19 additions & 0 deletions docs/en/contribute/bounty.md
Original file line number Diff line number Diff line change
@@ -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/
69 changes: 69 additions & 0 deletions docs/en/contribute/get-started.md
Original file line number Diff line number Diff line change
@@ -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

File renamed without changes.
4 changes: 2 additions & 2 deletions docs/index.md → docs/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/tips-tricks.md → docs/en/tips-tricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
4 changes: 4 additions & 0 deletions docs/public/_redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* /en/:splat 302

# This is an example for a french redirect
# /* /fr/:splat 302 Language=fr
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"license": "ISC",
"devDependencies": {
"vitepress": "^1.2.3"
}
}
},
"packageManager": "[email protected]+sha512.9df9cf27c91715646c7d675d1c9c8e41f6fce88246f1318c1aa6a1ed1aeb3c4f032fcdf4ba63cc69c4fe6d634279176b5358727d8f2cc1e65b65f43ce2f8bfb0"
}

0 comments on commit 04eb136

Please sign in to comment.