Skip to content

Commit

Permalink
fix: add docs and fix umami
Browse files Browse the repository at this point in the history
  • Loading branch information
spaenleh committed Feb 5, 2025
1 parent 29be374 commit 32f3926
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
UMAMI_WEBSITE_ID=3f9eb1f6-5f5f-4a28-87a5-312829f1446d
BASE="/"
43 changes: 24 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,46 @@
# Website
# Graasp Documentation and news

This repo hosts the code for the Graasp documentation and news website.

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```sh
yarn
```

### Local Development

Create a `.env` file to store your environment variables:

```dotenv
# required Id for website analytics, locally you can set this to whatever
UMAMI_WEBSITE_ID=3f9eb1f6-5f5f-4a28-87a5-312829f1446d
# Base url where you will host the website, locally you can change it to `/` so you can serve the static content using static web server
# Or to mimic the production deployment you can omit it.
BASE="/"
```
$ yarn start

```sh
yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

> [!WARNING]
> If you want to locally develop one of the internationalisations you will have to start the app with the correct local:
> `yarn start --locale fr` This is because the locales are different SPAs.
### Build

```
$ yarn build
```sh
yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
This repo deploys the website using GitHub Actions to deploy to GitHub Pages.
3 changes: 2 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
import { themes } from "prism-react-renderer";
import "dotenv/config";

/** @type {import('@docusaurus/types').Config} */
const config = {
Expand Down Expand Up @@ -203,7 +204,7 @@ const config = {
websiteID: process.env.UMAMI_WEBSITE_ID, // Required
analyticsDomain: "umami.graasp.org", // Required
// scriptName: "", // Optional
dataHostURL: "umami.graasp.org", // Optional
dataHostURL: "https://umami.graasp.org", // Optional
dataAutoTrack: true, // Optional
dataDoNotTrack: true, // Optional
dataCache: true, // Optional
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@mdx-js/react": "^3.1.0",
"autoprefixer": "^10.4.20",
"clsx": "^2.1.1",
"dotenv": "^16.4.7",
"postcss": "^8.4.47",
"prism-react-renderer": "^2.4.0",
"react": "^18.3.1",
Expand Down
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8432,6 +8432,7 @@ __metadata:
"@tsconfig/docusaurus": "npm:^2.0.3"
autoprefixer: "npm:^10.4.20"
clsx: "npm:^2.1.1"
dotenv: "npm:^16.4.7"
postcss: "npm:^8.4.47"
prism-react-renderer: "npm:^2.4.0"
react: "npm:^18.3.1"
Expand Down Expand Up @@ -8545,6 +8546,13 @@ __metadata:
languageName: node
linkType: hard

"dotenv@npm:^16.4.7":
version: 16.4.7
resolution: "dotenv@npm:16.4.7"
checksum: 10/f13bfe97db88f0df4ec505eeffb8925ec51f2d56a3d0b6d916964d8b4af494e6fb1633ba5d09089b552e77ab2a25de58d70259b2c5ed45ec148221835fc99a0c
languageName: node
linkType: hard

"duplexer@npm:^0.1.2":
version: 0.1.2
resolution: "duplexer@npm:0.1.2"
Expand Down

0 comments on commit 32f3926

Please sign in to comment.