Skip to content

Commit 8563f44

Browse files
authored
Merge branch 'main' into Linter-feature-checking-broken-links-and-show-in-PR
2 parents fdd0e95 + f0a92b5 commit 8563f44

26 files changed

+1176
-1273
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build Pelican site on PR
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repo
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.x'
23+
24+
- name: Check if pelicanconf.py exists
25+
id: check_pelicanconf
26+
run: |
27+
if [ -f pelicanconf.py ]; then
28+
echo "file_exists=true" >> "$GITHUB_OUTPUT"
29+
else
30+
echo "file_exists=false" >> "$GITHUB_OUTPUT"
31+
fi
32+
33+
- name: Install dependencies
34+
if: steps.check_pelicanconf.outputs.file_exists == 'true'
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install pelican markdown
38+
39+
- name: Build Pelican site
40+
if: steps.check_pelicanconf.outputs.file_exists == 'true'
41+
run: pelican content -o output -s pelicanconf.py
42+
43+
- name: Upload artifact (optional)
44+
if: steps.check_pelicanconf.outputs.file_exists == 'true'
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: pelican-site
48+
path: output/
49+
50+
- name: Deploy to GitHub Pages
51+
if: github.event_name == 'pull_request' && steps.check_pelicanconf.outputs.file_exists == 'true'
52+
uses: peaceiris/actions-gh-pages@v4
53+
with:
54+
github_token: ${{ secrets.GITHUB_TOKEN }}
55+
publish_dir: ./output
56+
publish_branch: gh-pages-pr-${{ github.event.number }}

.pre-commit-config.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,12 @@ repos:
198198
description: Black is the uncompromising Python code formatter. By using it, you agree to cede control over minutiae of hand-formatting. In return, Black gives you speed, determinism, and freedom from pycodestyle nagging about formatting
199199
language_version: python3
200200
args: ['--line-length=88']
201-
# - repo: https://github.com/PyCQA/bandit
202-
# rev: 1.8.6
203-
# hooks:
204-
# - id: bandit
205-
# name: A security linter from PyCQA
206-
# description: Bandit is a tool designed to find common security issues in Python code
207-
# args: ["-c", "bandit.yaml"]
208-
# files: \.py$
209-
# pass_filenames: false
201+
- repo: https://github.com/PyCQA/bandit
202+
rev: 1.8.6
203+
hooks:
204+
- id: bandit
205+
name: A security linter from PyCQA
206+
description: Bandit is a tool designed to find common security issues in Python code
207+
args: ['-c', 'bandit.yaml', '-r', '.']
208+
files: \.py$
209+
pass_filenames: false

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
package-lock.json
2+
packages/cfsite/package-lock.json

CONTRIBUTING.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,31 +112,37 @@ Our configuration is already in the repo: [dprint.json](./dprint.json)
112112

113113
#### 🧪 Setting Up pre-commit
114114

115-
Used to enforce newline at end of files and OS-specific line endings.
115+
We use [pre-commit](https://pre-commit.com/) to automatically check your code for common issues, like missing end-of-file newlines and inconsistent line endings. This keeps our project clean and easy for everyone to work on.
116116

117-
**Install (requires Python):**
117+
**How to install (requires Python):**
118118

119119
```bash
120-
pip install pre-commit
120+
python -m pip install --user pre-commit
121121
```
122122

123-
**Activate pre-commit hooks:**
123+
**Set up pre-commit hooks for this project:**
124124

125125
```bash
126126
pre-commit install
127127
```
128128

129-
**Run manually (optional):**
129+
This will make pre-commit run its checks every time you make a commit.
130+
**Running checks manually (optional):**
130131

131132
```bash
132133
pre-commit run --all-files
133134
```
134135

136+
This command runs all configured pre-commit hooks against all files in the repository.
137+
For more info, visit the [pre-commit website](https://pre-commit.com/).
138+
135139
---
136140

137141
### 5. 📝 Commit Changes
138142

139-
Use descriptive commit messages that clearly state the purpose of your changes.
143+
Use meaningful and clear commit messages that describe the purpose of your changes. This helps maintain a clean and understandable project history.
144+
145+
**Example of staging and committing changes:**
140146

141147
```bash
142148
git add .
@@ -145,22 +151,29 @@ git commit -m "Add feature: description of feature"
145151

146152
### 6. ⬆️ Push Changes
147153

154+
Push your local branch to your remote fork. Replace `your-branch-name` with the name of your current branch.
155+
148156
```bash
149157
git push origin add-new-feature
150158
```
151159

160+
This makes your changes available for review and merging via a Pull Request.
161+
152162
### 7. 🔄 Create a Pull Request
153163

154164
- Go to your forked repository on GitHub.
155-
- Click **"Compare & pull request"**.
156-
- Add a title and description (e.g., "Fixes #102").
157-
- Click **"Create pull request"**.
165+
- Click the **"Compare & pull request"** button near the top of the page.
166+
- Make sure your changes look correct and you are merging into the right branch.
167+
- Write a clear and simple title describing your changes.
168+
- Add a short description explaining what you changed and why. If it fixes an issue, mention it like this: `Fixes #issue-number`.
169+
- Click **"Create pull request"** to submit your contribution.
170+
- Watch for feedback on your Pull Request and respond to any comments.
158171

159172
---
160173

161174
## Community Support
162175

163176
If you need help or have questions:
164177

165-
- Join Discussions: Participate in discussions.
166-
- Contact Maintainers: Reach out to project maintainers if needed.
178+
- Join Discussions: Participate in ongoing discussions with the community.
179+
- Contact Maintainers: Reach out to project maintainers if you need direct assistance.

Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM node:22.18.0-bullseye
2+
3+
ENV GO_VERSION=1.24.5
4+
ENV NODE_VERSION=22.18.0
5+
6+
RUN apt-get update && apt-get install -y --no-install-recommends \
7+
curl \
8+
git \
9+
bash \
10+
python3 \
11+
python3-pip \
12+
build-essential \
13+
ca-certificates \
14+
tar \
15+
xz-utils \
16+
libstdc++6 \
17+
&& rm -rf /var/lib/apt/lists/*
18+
19+
RUN pip3 install pre-commit
20+
21+
RUN curl -LO https://mirrors.aliyun.com/golang/go${GO_VERSION}.linux-amd64.tar.gz && \
22+
tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz && \
23+
rm go${GO_VERSION}.linux-amd64.tar.gz
24+
25+
ENV PATH="/usr/local/go/bin:${PATH}"
26+
27+
RUN go version && python3 --version && pip3 --version
28+
29+
WORKDIR /app
30+
31+
CMD ["pre-commit", "run", "--all-files"]

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Welcome to the source code repository for the Brisbane Social Chess website.
99
[![CodeQL Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/brisbanesocialchess/brisbanesocialchess.github.io/.github%2Fworkflows%2Fcodeql.yml?label=codeql)](https://github.com/brisbanesocialchess/brisbanesocialchess.github.io/actions/workflows/codeql.yml)
1010
[![Dprint Workflow Status](https://img.shields.io/github/actions/workflow/status/brisbanesocialchess/brisbanesocialchess.github.io/.github%2Fworkflows%2Fdprint.yml?label=dprint)](https://github.com/brisbanesocialchess/brisbanesocialchess.github.io/actions/workflows/dprint.yml)
1111
[![Git Clone Matrix Workflow Status](https://img.shields.io/github/actions/workflow/status/brisbanesocialchess/brisbanesocialchess.github.io/.github%2Fworkflows%2Fgit-clone-matrix.yml?label=git-clone-matrix)](https://github.com/brisbanesocialchess/brisbanesocialchess.github.io/actions/workflows/git-clone-matrix.yml)
12+
[![GitHub License](https://img.shields.io/github/license/brisbanesocialchess/brisbanesocialchess.github.io)](LICENSE)
13+
[![GitHub Pages](https://img.shields.io/website?url=https%3A%2F%2Fbrisbanesocialchess.github.io&label=github-pages)](https://brisbanesocialchess.github.io)
1214
[![Labeler Workflow Status](https://img.shields.io/github/actions/workflow/status/brisbanesocialchess/brisbanesocialchess.github.io/.github%2Fworkflows%2Flabeler.yml?label=labeler)](https://github.com/brisbanesocialchess/brisbanesocialchess.github.io/actions/workflows/labeler.yml)
1315
[![Lerna Workflow Status](https://img.shields.io/github/actions/workflow/status/brisbanesocialchess/brisbanesocialchess.github.io/.github%2Fworkflows%2Flerna.yml?label=lerna)](https://github.com/brisbanesocialchess/brisbanesocialchess.github.io/actions/workflows/lerna.yml)
1416
[![Ls-lint Workflow Status](https://img.shields.io/github/actions/workflow/status/brisbanesocialchess/brisbanesocialchess.github.io/.github%2Fworkflows%2Fls-lint.yml?label=ls-lint)](https://github.com/brisbanesocialchess/brisbanesocialchess.github.io/actions/workflows/ls-lint.yml)
@@ -28,6 +30,7 @@ Welcome to the source code repository for the Brisbane Social Chess website.
2830
- [Run Tests](#run-tests)
2931
- [About Brisbane Social Chess](#about-brisbane-social-chess)
3032
- [Getting Started / Building the Site](#getting-started--building-the-site)
33+
- [Build the Docker image for running `pre-commit` easily](#build-the-docker-image-for-running-pre-commit-easily)
3134

3235
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
3336

@@ -74,4 +77,26 @@ npx serve
7477

7578
---
7679

80+
## Build the Docker image for running `pre-commit` easily
81+
82+
```bash
83+
docker build -t my-go-precommit .
84+
or
85+
docker build --no-cache -t my-go-precommit .
86+
```
87+
88+
And then:
89+
90+
```bash
91+
docker run --rm -v "$PWD":/app -w /app my-go-precommit
92+
```
93+
94+
Or if you want to run and keep the container and go into bash:
95+
96+
```bash
97+
docker run -it -v "$PWD":/app -w /app my-go-precommit bash
98+
```
99+
100+
---
101+
77102
© 2025 Brisbane Social Chess

bandit.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
# FILE: bandit.yaml
12
exclude_dirs: ['node_modules', 'packages/cfsite/node_modules']
3+
tests: ['B201', 'B301']
4+
skips: ['B101', 'B601']

docs/404.html

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,17 @@
1313
<div class="background-overlay">
1414
<main class="content-wrapper">
1515
<div class="logo">
16-
<a href="/">
17-
<img src="/assets/logo.jpg" alt="Brisbane Social Chess Logo" />
18-
</a>
16+
<a href="/">
17+
<img src="/assets/logo.jpg" alt="Brisbane Social Chess Logo" />
18+
</a>
1919
<h1>Oops! Page Not Found</h1>
2020
<p>Looks like the page you're looking for doesn't exist.</p>
2121
</div>
2222
<nav class="nav-links">
2323
<a href="/">Home</a>
2424
<a href="/about.html">About</a>
2525
<a href="/games.html">Games</a>
26+
<a href="/meetup.html">Meetups</a>
2627
<a href="/minutes.html">Minutes</a>
2728
<a href="/register.html">Register</a>
2829
<a href="/rules.html">Rules</a>
@@ -31,26 +32,17 @@ <h1>Oops! Page Not Found</h1>
3132
</nav>
3233
<section class="section">
3334
<h2>Error 404 – Not Found</h2>
34-
<p>
35-
Don’t worry, you haven’t blundered too badly. Maybe the link is outdated or there's a typo in the URL.
36-
</p>
37-
<p>
38-
You can return to our homepage or explore other sections of our site.
39-
</p>
40-
35+
<p> Don’t worry, you haven’t blundered too badly. Maybe the link is outdated or there's a typo in the URL. </p>
36+
<p> You can return to our homepage or explore other sections of our site. </p>
4137
<div class="button-group">
4238
<a href="/" class="button">Go Home</a>
4339
</div>
4440
<img src="assets/locations.jpg" alt="Chess Pieces Lost" />
4541
</section>
4642
</main>
4743
</div>
48-
4944
<footer class="site-footer">
50-
<p>
51-
&copy; <span id="year"></span> Brisbane Social Chess. All rights
52-
reserved.
53-
</p>
45+
<p> &copy; <span id="year"></span> Brisbane Social Chess. All rights reserved. </p>
5446
</footer>
5547
<script type="text/javascript" src="/script.js"></script>
5648
</body>

0 commit comments

Comments
 (0)