1
0
Fork
You've already forked forgejo-website
0
forked from forgejo/website
Astro 70.5%
JavaScript 13.1%
Makefile 11.5%
CSS 4.7%
HTML 0.2%
2022年11月20日 15:02:19 +01:00
public astro init 2022年11月10日 15:08:38 +01:00
src privacy-policy fix Codeberg branch 2022年11月15日 14:31:19 +01:00
.editorconfig cleanup readme 2022年11月14日 09:56:45 +01:00
.eslintignore cleanup readme 2022年11月14日 09:56:45 +01:00
.eslintrc.js add eslint and prettier 2022年11月11日 09:17:39 +01:00
.gitignore ignore emacs backups 2022年11月14日 22:09:30 +01:00
.prettierignore adjust template 2022年11月14日 10:10:49 +01:00
.prettierrc add eslint and prettier 2022年11月11日 09:17:39 +01:00
.woodpecker.yml ci: prevent publish on Pull Request 2022年11月20日 15:02:19 +01:00
astro.config.mjs scaffold 404 page 2022年11月11日 09:44:40 +01:00
index.html Bare minimal Woodpecker setup 2022年11月12日 11:22:09 +01:00
LICENSE.md feat: init 2022年11月07日 17:04:38 +05:30
Makefile fix srht.site build 2022年11月14日 10:14:41 +01:00
package-lock.json add tailwind typography and example markdown pages 2022年11月14日 09:35:33 +01:00
package.json adjust template 2022年11月14日 10:10:49 +01:00
README.md README: add deployment documentation 2022年11月14日 13:46:15 +01:00
tailwind.config.cjs add tailwind typography and example markdown pages 2022年11月14日 09:35:33 +01:00
tsconfig.json basic index 2022年11月11日 09:38:26 +01:00

Website for Codename

The website is build with Astro.

Project Structure

/
├── public/
│ └── favicon.svg
├── src/
│ ├── components/
│ │ └── Card.astro
│ ├── layouts/
│ │ └── Layout.astro
│ └── pages/
│ ├── index.astro
│ └── code-of-conduct.md
└── 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, with a trailing slash.

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.

Commands

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

Command Action
npm install Installs dependencies
npm run dev Starts local dev server at localhost:3000
npm run build Build your production site to ./dist/
npm run preview Preview your build locally, before deploying
npm run astro ... Run CLI commands like astro add, astro preview
npm run astro --help Get help using the Astro CLI

Styling

The styling is achieved using Tailwind CSS. Custom classes can be added to src/style.css.

The standard layout is implemented in src/layouts/Layout.astro (see neighbour files for other layouts).

Continuous deployment

The main branch triggers a Woodpecker build (see .woodpecker.yml), which pushes the "compiled" files to https://codeberg.org/codename/pages, which is accessible via https://codename.codeberg.page/.

Want to learn more?

Feel free to check the documentation of Astro.