Skip to content

Commit 8ab44b3

Browse files
authored
Merge pull request #3 from imlargo/migration
Migration
2 parents 0e8e5f4 + d0447a2 commit 8ab44b3

File tree

1,319 files changed

+35254
-28832
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,319 files changed

+35254
-28832
lines changed

.github/workflows/node.yml

+4-13
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,17 @@ jobs:
2121
uses: actions/setup-node@v4
2222
with:
2323
node-version: ${{ matrix.node }}
24-
- name: Install node module
25-
run: |
26-
npm install -D --save autoprefixer
27-
npm install -D --save postcss-cli
28-
npm audit fix
29-
30-
- name: Setup Hugo
31-
uses: peaceiris/actions-hugo@v3
32-
with:
33-
hugo-version: '0.125.4'
34-
extended: true
24+
- name: Install node modules
25+
run: npm install
3526

3627
- name: Build
3728
run: |
38-
hugo --minify
29+
npm run build
3930
echo 'gin-gonic.com' > public/CNAME
4031
4132
- name: Deploy
4233
uses: peaceiris/actions-gh-pages@v4
4334
if: github.ref == 'refs/heads/master'
4435
with:
4536
github_token: ${{ secrets.GITHUB_TOKEN }}
46-
publish_dir: ./public
37+
publish_dir: ./dist

.gitignore

+20-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# environment variables
2+
.env
3+
.env.production
4+
5+
# macOS-specific files
6+
.DS_Store
7+
18
# Binaries for programs and plugins
29
*.exe
310
*.exe~
@@ -11,7 +18,16 @@
1118
# Output of the go coverage tool, specifically when used with LiteIDE
1219
*.out
1320

14-
public
15-
resources
16-
node_modules
17-
.hugo_build.lock
21+
# build output
22+
dist/
23+
# generated types
24+
.astro/
25+
26+
# dependencies
27+
node_modules/
28+
29+
# logs
30+
npm-debug.log*
31+
yarn-debug.log*
32+
yarn-error.log*
33+
pnpm-debug.log*

README.md

+41-17
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,17 @@
1-
21
# Gin website
32

43
[![Run Deploy](https://github.com/gin-gonic/website/actions/workflows/node.yml/badge.svg)](https://github.com/gin-gonic/website/actions/workflows/node.yml)
54

65
Welcome! This repository houses all the assets required to build the Gin website and documentation. We're pleased that you want to contribute! The website is hosted at https://gin-gonic.com.
76

8-
We use [Hugo](https://gohugo.io/) to format and generate our website, the [Docsy](https://github.com/google/docsy) theme for styling and site structure. Thanks!.
9-
10-
**Note:** We only support hugo [v0.75.1 version](https://github.com/gohugoio/hugo/releases/tag/v0.75.1).
7+
We use [Astro](https://astro.build) to format and generate our website, the [Starlight](https://starlight.astro.build) template for styling and site structure. Thanks!.
118

129
## Contribution
1310

1411
- Fork the repository
1512

1613
You can click the Fork button in the upper-right area of the screen to create a copy of this repository in your GitHub account. This copy is called as fork.
1714

18-
> You need to use the below command to clone code for docsy theme.
19-
20-
```sh
21-
git clone --recurse-submodules --depth 1 https://github.com/google/docsy.git themes/docsy
22-
```
23-
2415
- Create one pull request
2516

2617
Make any changes you want in your fork, and when you are ready to send those changes to us, go to your fork and create a new pull request to let us know about it.
@@ -31,19 +22,52 @@ Once your pull request is created, a Gin reviewer will take responsibility for p
3122

3223
## Running
3324

34-
See the [official Hugo documentation](https://gohugo.io/getting-started/installing/) for Hugo installation instructions.
25+
See the [official Astro documentation](https://docs.astro.build/en/getting-started) for Astro installation instructions. and [Starlight documentation](https://starlight.astro.build/getting-started) for Starlight installation instructions.
3526

3627
To run the site locally when you have Hugo installed:
3728

3829
```sh
39-
# If use `hugo` command, you need to use `npm install` command
40-
$ npm install
41-
$ hugo
42-
# Or use `hugo server`, it not need `npm install` command
43-
$ hugo server
30+
npm install
31+
npm run dev
4432
```
4533

46-
This will start the local Hugo server on port 1313. Open up your browser to http://localhost:1313 to view the site. As you make changes to the source files, Hugo updates the site and forces a browser refresh.
34+
This will start the local Astro server on port 4321. Open up your browser to http://localhost:4321 to view the site. As you make changes to the source files, Astro updates the site and forces a browser refresh.
35+
36+
## 🚀 Project Structure
37+
38+
Inside of your Astro + Starlight project, you'll see the following folders and files:
39+
40+
```
41+
.
42+
├── public/
43+
├── src/
44+
│ ├── assets/
45+
│ ├── content/
46+
│ │ ├── docs/
47+
│ └── content.config.ts
48+
├── astro.config.mjs
49+
├── package.json
50+
└── tsconfig.json
51+
```
52+
53+
Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name.
54+
55+
Images can be added to `src/assets/` and embedded in Markdown with a relative link.
56+
57+
Static assets, like favicons, can be placed in the `public/` directory.
58+
59+
## 🧞 Commands
60+
61+
All commands are run from the root of the project, from a terminal:
62+
63+
| Command | Action |
64+
| :------------------------ | :----------------------------------------------- |
65+
| `npm install` | Installs dependencies |
66+
| `npm run dev` | Starts local dev server at `localhost:4321` |
67+
| `npm run build` | Build your production site to `./dist/` |
68+
| `npm run preview` | Preview your build locally, before deploying |
69+
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
70+
| `npm run astro -- --help` | Get help using the Astro CLI |
4771

4872
## Thanks
4973

assets/scss/_variables_project.scss

-9
This file was deleted.

astro.config.mjs

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
// @ts-check
2+
import { defineConfig } from 'astro/config';
3+
import starlight from '@astrojs/starlight';
4+
import starlightUtils from "@lorenzo_lewis/starlight-utils";
5+
6+
import sitemap from "@astrojs/sitemap";
7+
8+
// https://astro.build/config
9+
export default defineConfig({
10+
integrations: [starlight({
11+
plugins: [starlightUtils({
12+
multiSidebar: {
13+
switcherStyle: "horizontalList",
14+
},
15+
})],
16+
17+
title: 'Gin Web Framework',
18+
favicon: '/favicon.ico',
19+
logo: {
20+
src: "./src/assets/gin.png",
21+
},
22+
23+
defaultLocale: 'en',
24+
locales: {
25+
'en': {
26+
label: 'English',
27+
lang: 'en',
28+
},
29+
'es': {
30+
label: 'Español',
31+
lang: 'es',
32+
},
33+
"fa": {
34+
label: "Persian",
35+
lang: "fa",
36+
},
37+
"ja": {
38+
label: "日本語",
39+
lang: "ja",
40+
},
41+
"ko-kr": {
42+
label: "한국어",
43+
lang: "ko-kr",
44+
},
45+
"pt": {
46+
label: "Português",
47+
lang: "pt",
48+
},
49+
"ru": {
50+
label: "Russian",
51+
lang: "ru",
52+
},
53+
"tr": {
54+
label: "Turkish",
55+
lang: "tr",
56+
},
57+
"zh-cn": {
58+
label: "简体中文",
59+
lang: "zh-cn",
60+
},
61+
"zh-tw": {
62+
label: "繁體中文",
63+
lang: "zh-tw",
64+
},
65+
},
66+
67+
social: {
68+
github: 'https://github.com/gin-gonic/gin',
69+
gitter: "https://gitter.im/gin-gonic/gin"
70+
},
71+
sidebar: [
72+
{
73+
label: "Docs",
74+
autogenerate: { directory: "docs" }
75+
},
76+
{
77+
label: "Blog",
78+
autogenerate: { directory: "blog" }
79+
},
80+
],
81+
expressiveCode: {
82+
themes: ['github-dark', 'github-light'],
83+
},
84+
editLink: {
85+
baseUrl: 'https://github.com/gin-gonic/website/edit/master/',
86+
},
87+
customCss: [
88+
'./src/styles/custom.css',
89+
],
90+
lastUpdated: true,
91+
credits: false, // Opcional
92+
}), sitemap()],
93+
});

content/en/_index.html

-77
This file was deleted.

content/en/blog/_index.md

-13
This file was deleted.

content/en/blog/news/_index.md

-8
This file was deleted.

0 commit comments

Comments
 (0)