Skip to content

Commit

Permalink
Update v1.2.0 (#19)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
LucJosin authored Sep 20, 2023
1 parent 1c36446 commit 4e8fc8b
Show file tree
Hide file tree
Showing 14 changed files with 816 additions and 888 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build

# Only build after new tag.
on:
workflow_dispatch:
push:
tags:
- "*"

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3

- name: Setup Node with yarn caching
uses: actions/setup-node@v3
with:
node-version: "18"
cache: yarn

- name: Install dependencies
run: yarn install

- name: Build Astro
run: yarn build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
publish_branch: release
enable_jekyll: false
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# HawAPI - Website

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

## Topics

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

## Dependencies

Expand Down Expand Up @@ -58,22 +57,19 @@ yarn dev
Open the browser and go to:

```
http://localhost:3000
http://localhost:4321
```

## Scripts

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

| Command | Action |
| :---------------- | :------------------------------------------------- |
| `yarn` | Installs dependencies |
| `yarn dev` | Starts local dev server at `localhost:3000` |
| `yarn dev-docs` | Starts local dev (docs) server at `localhost:5005` |
| `yarn build` | Build production site to `./build/` |
| `yarn build-docs` | Build production site (docs) to `./docs/build/` |
| `yarn build-all` | Build all production site to `./build/` |
| `yarn clean` | Remove `./build/` |
| Command | Action |
| :----------- | :------------------------------------------ |
| `yarn` | Installs dependencies |
| `yarn dev` | Starts local dev server at `localhost:4321` |
| `yarn build` | Build production site to `./build/` |
| `yarn clean` | Remove `./build/` |

## Contributing

Expand Down
1 change: 0 additions & 1 deletion docs
Submodule docs deleted from c9d60f
26 changes: 11 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
{
"name": "@hawapi/root",
"version": "1.0.0",
"version": "1.2.0",
"private": true,
"scripts": {
"dev": "astro dev",
"dev:docs": "cd docs/ && retype watch",
"build": "yarn clean && astro build",
"build:adapt": "./scripts/adapt-website.sh",
"build:docs": "cd docs/ && yarn build",
"build:all": "yarn build && yarn build:docs && ./scripts/setup-docs.sh && yarn build:adapt",
"build": "astro build",
"clean": "rm -rf ./build"
},
"devDependencies": {
"@astrojs/sitemap": "^1.3.3",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"@typescript-eslint/parser": "^5.59.9",
"astro": "^2.5.7",
"@astrojs/sitemap": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2",
"astro": "^3.1.1",
"astro-compress": "^2.0.12",
"astro-icon": "^0.8.1",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-astro": "^0.27.1",
"prettier": "^2.8.8",
"prettier-plugin-astro": "^0.10.0",
"eslint": "^8.49.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-astro": "^0.29.0",
"prettier": "^3.0.3",
"prettier-plugin-astro": "^0.12.0",
"svgo": "2.8.0"
}
}
13 changes: 0 additions & 13 deletions public/data/colors.json

This file was deleted.

22 changes: 0 additions & 22 deletions public/data/sdks.json

This file was deleted.

30 changes: 0 additions & 30 deletions scripts/adapt-website.sh

This file was deleted.

19 changes: 0 additions & 19 deletions scripts/setup-docs.sh

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/core/Button.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface Props {
const { name, id, classes } = Astro.props as Props;
---

<button class:list={['button', classes]} id={id} value="cancel">
<button class:list={['button', classes]} id={id}>
{name}
</button>

Expand Down
18 changes: 10 additions & 8 deletions src/components/layouts/Layout.astro
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
import Footer from '@components/layouts/Footer.astro';
import Header from '@components/layouts/Header.astro';
import Footer from './Footer.astro';
export interface Props {
title: string;
project?: string;
endTitle?: string;
description?: string;
tags?: string;
author?: string;
Expand All @@ -15,11 +16,12 @@ export interface Props {
const {
title,
project = 'HawAPI',
description = 'A Free and Open Source API for Stranger Things.',
endTitle = ' | HawAPI - A Free and Open Source API for Stranger Things.',
description = 'A Free and Open Source API for Stranger Things. This API provides various information about the Stranger Things show.',
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',
author = 'LucJosin',
banner = Astro.url + 'images/banner.png',
icon = Astro.url + 'favicon.ico',
banner = Astro.site + 'images/banner.png',
icon = Astro.site + 'favicon.ico',
} = Astro.props as Props;
---

Expand All @@ -42,8 +44,8 @@ const {
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content={'@' + author} />
<meta name="twitter:domain" content={Astro.url} />
<meta name="twitter:title" content={title + ' | ' + project} />
<meta name="twitter:domain" content={Astro.site} />
<meta name="twitter:title" content={title + endTitle} />
<meta
name="twitter:description"
property="og:description"
Expand All @@ -58,7 +60,7 @@ const {

<!-- Open Graph -->
<meta property="og:url" content={Astro.url} />
<meta property="og:title" content={title + ' | ' + project} />
<meta property="og:title" content={title + endTitle} />
<meta property="og:site_name" content={project} />
<meta property="og:description" content={description} />
<meta property="og:type" content="website" />
Expand All @@ -76,7 +78,7 @@ const {
<meta name="generator" content={Astro.generator} />

<!-- Title -->
<title>{title + ' | ' + project}</title>
<title>{title + endTitle}</title>
</head>
<body>
<Header />
Expand Down
2 changes: 1 addition & 1 deletion src/pages/try-it/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import BackgroundEffect from '@components/core/BackgroundEffect.astro';
import Layout from '@components/layouts/Layout.astro';
---

<Layout title="Swagger">
<Layout title="Try it">
<main>
<BackgroundEffect />
<div id="swagger-ui"></div>
Expand Down
Loading

0 comments on commit 4e8fc8b

Please sign in to comment.