Skip to content

Commit 9a12caf

Browse files
authored
Merge pull request #9 from weaponsforge/dev
v1.0.0
2 parents 97c7745 + efd2220 commit 9a12caf

File tree

24 files changed

+5575
-6
lines changed

24 files changed

+5575
-6
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NEXT_PUBLIC_BASE_PATH=''

.eslintrc.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"extends": "next/core-web-vitals",
3+
"plugins": [
4+
"eslint-plugin-react", "eslint-plugin-react-hooks"
5+
],
6+
"rules": {
7+
"indent": ["error", 2],
8+
"linebreak-style": ["error", "unix"],
9+
"quotes": ["error", "single"],
10+
"semi": ["error", "never"],
11+
"no-unused-vars": "error",
12+
"no-undef": "error",
13+
"no-console": 2
14+
}
15+
}

.github/workflows/lint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Lint Files
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'master'
7+
8+
jobs:
9+
lint-client:
10+
name: Lint Client
11+
runs-on: ubuntu-latest
12+
env:
13+
NEXT_PUBLIC_BASE_PATH: ${{ secrets.NEXT_PUBLIC_BASE_PATH }}
14+
steps:
15+
- name: Checkout the repository
16+
uses: actions/checkout@v3
17+
- name: Use NodeJS v16.14.2
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: 16.14.2
21+
- name: Install Dependencies and lint
22+
run: |
23+
npm install
24+
npm run lint
25+

.github/workflows/release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Deploy to GitHub Pages
2+
3+
# This workflow will trigger on any tag/release created on *any* branch
4+
# Make sure to create tags/releases only from the "master" branch for consistency
5+
on:
6+
release:
7+
types: [published]
8+
9+
jobs:
10+
lint-client:
11+
name: Lint and Export client
12+
runs-on: ubuntu-latest
13+
env:
14+
NEXT_PUBLIC_BASE_PATH: ${{ secrets.NEXT_PUBLIC_BASE_PATH }}
15+
steps:
16+
- name: Checkout the repository
17+
uses: actions/checkout@v3
18+
- name: Use NodeJS v16.14.2
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: 16.14.2
22+
- name: Install Dependencies and lint
23+
run: npm install
24+
- name: Lint
25+
run: npm run lint
26+
- name: Export static files
27+
run: |
28+
npm run export
29+
mv out/404/index.html out/404.html
30+
- name: Disable Jekyll
31+
run: touch out/.nojekyll
32+
- name: Archive Development Artifact
33+
uses: actions/upload-artifact@v3
34+
with:
35+
name: main-out
36+
path: out
37+
retention-days: 3
38+
39+
deploy-client:
40+
name: Deploy client to Github Pages
41+
needs: lint-client
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Download Artifact
45+
uses: actions/download-artifact@v3
46+
with:
47+
name: main-out
48+
- name: List files for publish
49+
run: ls -l -a
50+
- name: Deploy to Github Pages
51+
uses: peaceiris/actions-gh-pages@v3
52+
with:
53+
github_token: ${{ secrets.GITHUB_TOKEN }}
54+
publish_dir: ./
55+
publish_branch: gh-pages

.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
.pnpm-debug.log*
27+
28+
# local env files
29+
.env*.local
30+
.env*.development
31+
*.env
32+
33+
# vercel
34+
.vercel
35+
36+
# typescript
37+
*.tsbuildinfo
38+
next-env.d.ts
39+
40+
*.zip

README.md

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,42 @@
1-
## climate-profile-full
2-
3-
Testing display of all related content based on a URL query string.
4-
5-
@weaponsforge<br>
6-
20221122
1+
## climate-profile-full
2+
3+
Testing display of all related content based on a URL query string.
4+
5+
## Requirements
6+
7+
1. Windows, Linux or Mac OS
8+
2. NodeJS LTS v16.14.2
9+
10+
### Core Libraries/Frameworks
11+
12+
1. NextJS v13.0.4
13+
2. React 18.2.0
14+
15+
## Installation
16+
17+
1. Install dependencies.<br>
18+
`npm install`
19+
20+
2. Set up the environment variables. Create a `.env`, `.env.local` and a `.env.development` files inside the root project directory with reference to the `.env.example` file.<br>
21+
22+
| Variable Name | Description |
23+
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
24+
| NEXT_PUBLIC_BASE_PATH | Root directory path name that NextJS uses for assets, media and client-side routing for the app.<br><br>Set its value to blank `''` when working on development mode in localhost.<br>Set its value to the sub-directory name where the exported NextJS app is to be deployed, i.e. `/<YOUR_REPOSITORY_NAME>` when deploying on a repository (sub-directory) of a root GitHub Pages site, i.e, on `https://<YOUR_GITHUB_USERNAME>.github.io/<YOUR_REPOSITORY_NAME>` |
25+
26+
## Usage
27+
28+
1. Run the app in development mode.<br>
29+
`npm run dev`
30+
31+
2. Launch the development website from:<br>
32+
`http://localhost:3000`
33+
34+
3. Check for lint errors.
35+
- `npm run lint` (check lint errors)
36+
- `npm run lint:fix` (fix lint errors)
37+
38+
4. Export the static website.<br>
39+
`npm run export`
40+
41+
@weaponsforge<br>
42+
2022112
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import Link from 'next/link'
2+
import styles from '@/styles/Navigation.module.css'
3+
4+
function Navigation () {
5+
return (
6+
<span className={styles.container}>
7+
<Link href='/'>Start</Link> |&nbsp;
8+
<Link href='/home'>Home</Link> |&nbsp;
9+
<Link href='/home/cafe'>Cafe</Link> |&nbsp;
10+
<Link href='/about'>About</Link>
11+
</span>
12+
)
13+
}
14+
15+
export default Navigation

components/layout/section/index.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import PropTypes from 'prop-types'
2+
import styles from '@/styles/Section.module.css'
3+
4+
function Section ({ children }) {
5+
return (
6+
<div className={styles.containersection}>
7+
{children}
8+
</div>
9+
)
10+
}
11+
12+
Section.propTypes = {
13+
children: PropTypes.node
14+
}
15+
16+
export default Section

jsconfig.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"compilerOptions": {
3+
"baseUrl": ".",
4+
"paths": {
5+
"@/components/*": ["components/*"],
6+
"@/pages/*": ["pages/*"],
7+
"@/public/*": ["public/*"],
8+
"@/styles/*": ["styles/*"]
9+
}
10+
}
11+
}

next.config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/** @type {import('next').NextConfig} */
2+
const nextConfig = {
3+
reactStrictMode: true,
4+
trailingSlash: true,
5+
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
6+
images: {
7+
unoptimized: true
8+
},
9+
eslint: {
10+
dirs: ['components', 'pages', 'styles']
11+
},
12+
env: {
13+
NEXT_PUBLIC_BASE_PATH: process.env.NEXT_PUBLIC_BASE_PATH
14+
}
15+
}
16+
17+
module.exports = nextConfig

0 commit comments

Comments
 (0)