1
0
Fork
You've already forked website
0
forked from forgejo/website
Forgejo website content
  • Astro 79%
  • TypeScript 16.7%
  • CSS 2.8%
  • JavaScript 1.4%
  • Nix 0.1%
Gusted 8dcd251f0f fix: make Astro preserve whitespace ( #987 )
Regression of !977
Keep the old behavior of whitespace generation by Astro. I don't
understand or see the particular need for this JSX method of whitespace
generation.
Ref:
https://docs.astro.build/en/guides/upgrade-to/v7/#new-default-whitespace-handling-compresshtml-jsx
Closes forgejo/website#990
Reported-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-on: forgejo/website#987
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
2026年07月14日 05:28:07 +02:00
.forgejo Update https://data.forgejo.org/crate-ci/typos action to v1.48.0 ( #968 ) 2026年07月01日 01:34:28 +02:00
.husky fix husky deprecation warning in pre-commit hook 2025年01月17日 14:23:46 +01:00
.vscode refactor: fix typescript errors 2023年08月21日 23:09:22 +01:00
flux Update redirect 2026年04月16日 17:19:03 +02:00
forgejo-docs publish 2026年07月13日 07:23:29 +00:00
public build: convert apache to nginx config for flux 2026年04月09日 13:08:27 +02:00
src Visual warning for outdated docs ( #978 ) 2026年07月09日 17:49:43 +02:00
.editorconfig build: convert apache to nginx config for flux 2026年04月09日 13:08:27 +02:00
.gitignore [CI] do not try to lint .pnpm-store 2023年12月26日 12:45:25 +01:00
.gitmodules chore(release): v16.0 docs ( #959 ) 2026年06月25日 07:50:44 +02:00
.lychee.toml fix: correct v14.0 EOL date and fix some link checks ( #852 ) 2026年04月20日 14:49:19 +02:00
.npmrc reset theme to https://github.com/onwidget/astrowind 2022年12月01日 18:04:49 +01:00
.prettierignore add docs to .prettierignore 2023年08月17日 07:52:32 +02:00
.prettierrc build: convert apache to nginx config for flux 2026年04月09日 13:08:27 +02:00
.typos.toml Forgejo monthly report - May 2026 2026年06月08日 20:20:23 +02:00
astro.config.ts fix: make Astro preserve whitespace ( #987 ) 2026年07月14日 05:28:07 +02:00
caddyfile.tmLanguage.json add caddyfile syntax highlighting 2024年05月13日 18:11:54 +02:00
eslint.config.mjs Update eslint monorepo to v10 (major) ( #755 ) 2026年03月02日 10:52:42 +01:00
LICENSE Fix licensing problems 2023年03月02日 23:44:11 -07:00
package.json Update dependency sanitize-html to v2.17.6 ( #988 ) 2026年07月14日 01:31:41 +02:00
pnpm-lock.yaml Update dependency sanitize-html to v2.17.6 ( #988 ) 2026年07月14日 01:31:41 +02:00
pnpm-workspace.yaml build: convert apache to nginx config for flux 2026年04月09日 13:08:27 +02:00
README.md docs: update readme 2026年01月07日 17:33:17 +01:00
sandbox.config.json reset theme to https://github.com/onwidget/astrowind 2022年12月01日 18:04:49 +01:00
shell.nix Add shell.nix 2026年03月10日 22:08:13 +01:00
tailwind.config.ts eslint and ts errors fixes 2026年05月12日 14:48:31 +02:00
tsconfig.json bump all dependancies 2024年05月12日 22:13:14 +02:00

Website for Forgejo

This website is built with Astro and Tailwind CSS, and is based on the AstroWind template.

When a branch foobar is pushed to the repository, the content is rendered for preview at https://forgejo.codeberg.page/@foobar/.

When a PR is created, its content is rendered for preview at https://forgejo.codeberg.page/@pull_1234/ where 1234 is the number of the PR.

The forgejo-website user is dedicated to providing an application token set to websitetoken and allows for publishing the branch and CI previews in https://codeberg.org/forgejo/pages.

Hosting

The website is hosted at our Kubernetes cluster and the technical details on how this is done can be found in the CI configuration at .forgejo/workflows and the k8s-cluster repo.

Contributing

Format locally

docker run --rm -ti -v $(pwd):$(pwd) -w $(pwd) node:20 bash -c 'corepack enable ; pnpm install --frozen-lockfile ; pnpm run format'

Commands

All commands are run from the root of the project, from a terminal:

Command Action
pnpm install Installs dependencies
pnpm run prepare Install git pre-commit hook
pnpm run dev Starts local dev server at localhost:3000
pnpm run build Build your production site to ./dist/
pnpm run preview Preview your build locally, before deploying
pnpm run format Format codes with Prettier
pnpm run format-staged Format staged files with Prettier
pnpm run lint:eslint Run Eslint
pnpm run astro ... Run CLI commands like astro add, astro preview

See the AstroWind docs for more information.

Project structure

The following is the default structure of the AstroWind template:

/
├── data/
| └── blog/
| ├── post-slug-1.md
| ├── post-slug-2.mdx
| └── ...
├── public/
│ ├── robots.txt
│ └── favicon.ico
├── src/
│ ├── assets/
│ │ ├── images/
| | └── styles/
| | └── base.css
│ ├── components/
│ │ ├── atoms/
│ │ ├── blog/
│ │ ├── core/
| | └── widgets/
| | ├── Header.astro
| | ├── Footer.astro
| | └── ...
│ ├── layouts/
│ | |── BaseLayout.astro
│ | └── ...
│ ├── pages/
│ | ├── [...blog]/
| | | ├── [...page].astro
| | | └── [slug].astro
│ | ├── [...categories]/
| | | └── [category]/
| | | └── [...page].astro
│ | ├── [...tags]/
| | | └── [tag]/
| | | └── [...page].astro
│ | ├── index.astro
| | ├── 404.astro
| | └-- rss.xml.js
│ ├── utils/
│ └── config.ts
├── package.json
└── ...

Astro looks for .astro or .md files in the src/pages/ directory. Each page is exposed as a route based on its file name.

There's nothing special about src/components/, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.

Any static assets, like images, can be placed in the public/ directory if they do not require any transformation or in the assets/ directory if they are imported directly.

Manual testing

When doing some dependency upgrade (e.g. using pnpm update), the following should be manually tested:

Note that ideally both the mobile (narrow) and desktop (wide) versions should be tested

  • visit the homepage
  • visit the rss.xml feed (⚠️ the menu button points to the main version: put the URL manually in case of a pull request with /@pull_XX prefix)
  • switch the theme (light/dark)
  • visit the FAQ
  • visit the Releases page (there should be one Stable and one LTS tag)
  • visit the News page
  • visit the News page for a given tag (report for instance)
  • visit the first News
  • visit the docs /latest
  • visit the docs /next
  • visit the docs /v11.0
  • visit the docs > Admin > Reverse proxy and check that all code blocks have syntax coloring
  • visit the docs > Admin > Configuration Cheat Sheet and check that the internal page navigation (on the right) behaves correctly (independently scrollable / click on item goes to the right place) only available on desktop for now
  • check the menu toggling only for mobile