Skip to content

Commit 4e8fc8b

Browse files
authored
Update v1.2.0 (#19)
Features - Add build workflow Changes - Bump version to `1.2.0` - Remove docs submodule - Remove scripts - Remove unused files - Remove unused scripts from package.json - Update website end title and description - Update dependencies - Update button component - Update README Fixes - Fix wrong /try-it title - Fix wrong images path
1 parent 1c36446 commit 4e8fc8b

File tree

14 files changed

+816
-888
lines changed

14 files changed

+816
-888
lines changed

.github/workflows/build.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build
2+
3+
# Only build after new tag.
4+
on:
5+
workflow_dispatch:
6+
push:
7+
tags:
8+
- "*"
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Setup Node with yarn caching
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: "18"
22+
cache: yarn
23+
24+
- name: Install dependencies
25+
run: yarn install
26+
27+
- name: Build Astro
28+
run: yarn build
29+
30+
- name: Deploy
31+
uses: peaceiris/actions-gh-pages@v3
32+
with:
33+
github_token: ${{ secrets.GITHUB_TOKEN }}
34+
publish_dir: ./build
35+
publish_branch: release
36+
enable_jekyll: false
37+
user_name: "github-actions[bot]"
38+
user_email: "github-actions[bot]@users.noreply.github.com"

.gitmodules

-3
This file was deleted.

README.md

+8-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# HawAPI - Website
22

3-
This repository contains the source code required to build the [HawAPI](https://hawapi.theproject.id) website and documentation.
3+
This repository contains the source code required to build the [HawAPI](https://hawapi.theproject.id) website.
44

55
## Topics
66

@@ -16,7 +16,6 @@ This repository contains the source code required to build the [HawAPI](https://
1616
- Text editor or IDE (VsCode, Subline, Noteped++)
1717
- Npm/Yarn
1818
- [Astro](https://astro.build/) for [website](https://github.com/HawAPI/website) generation
19-
- [Retype](https://retype.com/) for [docs](https://github.com/HawAPI/website) generation
2019

2120
## Dependencies
2221

@@ -58,22 +57,19 @@ yarn dev
5857
Open the browser and go to:
5958

6059
```
61-
http://localhost:3000
60+
http://localhost:4321
6261
```
6362

6463
## Scripts
6564

6665
All scripts are run from the root of the project, from a terminal:
6766

68-
| Command | Action |
69-
| :---------------- | :------------------------------------------------- |
70-
| `yarn` | Installs dependencies |
71-
| `yarn dev` | Starts local dev server at `localhost:3000` |
72-
| `yarn dev-docs` | Starts local dev (docs) server at `localhost:5005` |
73-
| `yarn build` | Build production site to `./build/` |
74-
| `yarn build-docs` | Build production site (docs) to `./docs/build/` |
75-
| `yarn build-all` | Build all production site to `./build/` |
76-
| `yarn clean` | Remove `./build/` |
67+
| Command | Action |
68+
| :----------- | :------------------------------------------ |
69+
| `yarn` | Installs dependencies |
70+
| `yarn dev` | Starts local dev server at `localhost:4321` |
71+
| `yarn build` | Build production site to `./build/` |
72+
| `yarn clean` | Remove `./build/` |
7773

7874
## Contributing
7975

docs

-1
This file was deleted.

package.json

+11-15
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
11
{
22
"name": "@hawapi/root",
3-
"version": "1.0.0",
3+
"version": "1.2.0",
44
"private": true,
55
"scripts": {
66
"dev": "astro dev",
7-
"dev:docs": "cd docs/ && retype watch",
8-
"build": "yarn clean && astro build",
9-
"build:adapt": "./scripts/adapt-website.sh",
10-
"build:docs": "cd docs/ && yarn build",
11-
"build:all": "yarn build && yarn build:docs && ./scripts/setup-docs.sh && yarn build:adapt",
7+
"build": "astro build",
128
"clean": "rm -rf ./build"
139
},
1410
"devDependencies": {
15-
"@astrojs/sitemap": "^1.3.3",
16-
"@typescript-eslint/eslint-plugin": "^5.59.9",
17-
"@typescript-eslint/parser": "^5.59.9",
18-
"astro": "^2.5.7",
11+
"@astrojs/sitemap": "^3.0.0",
12+
"@typescript-eslint/eslint-plugin": "^6.7.2",
13+
"@typescript-eslint/parser": "^6.7.2",
14+
"astro": "^3.1.1",
1915
"astro-compress": "^2.0.12",
2016
"astro-icon": "^0.8.1",
21-
"eslint": "^8.42.0",
22-
"eslint-config-prettier": "^8.8.0",
23-
"eslint-plugin-astro": "^0.27.1",
24-
"prettier": "^2.8.8",
25-
"prettier-plugin-astro": "^0.10.0",
17+
"eslint": "^8.49.0",
18+
"eslint-config-prettier": "^9.0.0",
19+
"eslint-plugin-astro": "^0.29.0",
20+
"prettier": "^3.0.3",
21+
"prettier-plugin-astro": "^0.12.0",
2622
"svgo": "2.8.0"
2723
}
2824
}

public/data/colors.json

-13
This file was deleted.

public/data/sdks.json

-22
This file was deleted.

scripts/adapt-website.sh

-30
This file was deleted.

scripts/setup-docs.sh

-19
This file was deleted.

src/components/core/Button.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface Props {
88
const { name, id, classes } = Astro.props as Props;
99
---
1010

11-
<button class:list={['button', classes]} id={id} value="cancel">
11+
<button class:list={['button', classes]} id={id}>
1212
{name}
1313
</button>
1414

src/components/layouts/Layout.astro

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
2+
import Footer from '@components/layouts/Footer.astro';
23
import Header from '@components/layouts/Header.astro';
3-
import Footer from './Footer.astro';
44
55
export interface Props {
66
title: string;
77
project?: string;
8+
endTitle?: string;
89
description?: string;
910
tags?: string;
1011
author?: string;
@@ -15,11 +16,12 @@ export interface Props {
1516
const {
1617
title,
1718
project = 'HawAPI',
18-
description = 'A Free and Open Source API for Stranger Things.',
19+
endTitle = ' | HawAPI - A Free and Open Source API for Stranger Things.',
20+
description = 'A Free and Open Source API for Stranger Things. This API provides various information about the Stranger Things show.',
1921
tags = 'stranger things, stranger, things, stranger-things, st1, st2, st3, st4, api, github, git, hawapi, haw api, haw-api, HawAPI/HawAPI, theproject id, theproject.id, hawapi.theproject.id, netflix, watch, rest, free, open source',
2022
author = 'LucJosin',
21-
banner = Astro.url + 'images/banner.png',
22-
icon = Astro.url + 'favicon.ico',
23+
banner = Astro.site + 'images/banner.png',
24+
icon = Astro.site + 'favicon.ico',
2325
} = Astro.props as Props;
2426
---
2527

@@ -42,8 +44,8 @@ const {
4244
<!-- Twitter -->
4345
<meta name="twitter:card" content="summary_large_image" />
4446
<meta name="twitter:site" content={'@' + author} />
45-
<meta name="twitter:domain" content={Astro.url} />
46-
<meta name="twitter:title" content={title + ' | ' + project} />
47+
<meta name="twitter:domain" content={Astro.site} />
48+
<meta name="twitter:title" content={title + endTitle} />
4749
<meta
4850
name="twitter:description"
4951
property="og:description"
@@ -58,7 +60,7 @@ const {
5860

5961
<!-- Open Graph -->
6062
<meta property="og:url" content={Astro.url} />
61-
<meta property="og:title" content={title + ' | ' + project} />
63+
<meta property="og:title" content={title + endTitle} />
6264
<meta property="og:site_name" content={project} />
6365
<meta property="og:description" content={description} />
6466
<meta property="og:type" content="website" />
@@ -76,7 +78,7 @@ const {
7678
<meta name="generator" content={Astro.generator} />
7779

7880
<!-- Title -->
79-
<title>{title + ' | ' + project}</title>
81+
<title>{title + endTitle}</title>
8082
</head>
8183
<body>
8284
<Header />

src/pages/try-it/index.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import BackgroundEffect from '@components/core/BackgroundEffect.astro';
33
import Layout from '@components/layouts/Layout.astro';
44
---
55

6-
<Layout title="Swagger">
6+
<Layout title="Try it">
77
<main>
88
<BackgroundEffect />
99
<div id="swagger-ui"></div>

0 commit comments

Comments
 (0)