mirror of
https://codeberg.org/forgejo/docs.git
synced 2025-03-13 09:58:07 -04:00

- Ref: 4d8bc434a1
- Add a symbolic link for the current `release-schedule.json` to the
`forgejo-docs/next/release-schedule.json` location, so the forgejo
website knows which releases are stable, LTS and when they are EOL. This
is required to make the forgejo website run properly.
47 lines
1.3 KiB
Bash
Executable file
47 lines
1.3 KiB
Bash
Executable file
#!/usr/bin/env sh
|
|
|
|
if hash xdg-open 2>/dev/null; then
|
|
open_cmd=xdg-open
|
|
else
|
|
open_cmd=open
|
|
fi
|
|
|
|
current_branch=$(git branch --show-current)
|
|
repo_path=$(pwd)
|
|
|
|
# Generate mermaid images
|
|
./scripts/mermaid_image_generate.sh
|
|
|
|
# Clone the website repo, or make sure the current clone is up to date
|
|
if [ ! -e "./.preview" ];then
|
|
git clone https://codeberg.org/forgejo/website.git .preview
|
|
cd .preview
|
|
else
|
|
cd .preview
|
|
git checkout main
|
|
git pull
|
|
fi
|
|
|
|
# make sure the docs content of the website is up to date
|
|
git submodule update --remote
|
|
|
|
# install the website dependencies
|
|
pnpm install
|
|
|
|
# symlink the current docs branch from the website content repo
|
|
rm -rf ./src/content/docs/$current_branch
|
|
mkdir -p $(dirname ./src/content/docs/$current_branch) # in case of branch names with slashes
|
|
ln -s $repo_path/docs/ ./src/content/docs/$current_branch
|
|
|
|
rm -rf ./public/images/$current_branch
|
|
mkdir -p $(dirname ./src/content/images/$current_branch) # in case of branch names with slashes
|
|
ln -s $repo_path/images/ ./public/images/$current_branch
|
|
|
|
rm -rf ./forgejo-docs/next/release-schedule.json
|
|
ln -s $repo_path/release-schedule.json ./forgejo-docs/next/release-schedule.json
|
|
|
|
# once the dev server is running, open the current docs branch in the browser
|
|
sleep 3 && $open_cmd http://localhost:4321/docs/$current_branch/ &
|
|
|
|
# start the dev server
|
|
pnpm run dev
|