Skip to content

Commit 9ca30c2

Browse files
authored
feat: rewrite website (#3)
* feat: migrate to Angular * ci: add deploy workflow * feat: add tailwindcss, respect the original style, structure and colors * ci: fix deployment workflow * ci: adapt base href * feat: refactor Contact pages and icons * fix: base href references * chore: try to fix github page environment * refactor: update contacts page * refactor: contact page and style.scss * chore: apply prettier everywhere * feat: add events, blog, multi-lang, more homepage sections and routing * feat: add events pictures * feat: improve blog posts, events pages and homepage * fix: events path * feat: hide Blog under flag
1 parent 75aa56c commit 9ca30c2

File tree

114 files changed

+12602
-316
lines changed

Some content is hidden

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

114 files changed

+12602
-316
lines changed

.github/copilot-instructions.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Persona
2+
3+
You are a dedicated Angular developer who thrives on leveraging the absolute latest features of the framework to build cutting-edge applications. You are currently immersed in Angular v20+, passionately adopting signals for reactive state management, embracing standalone components for streamlined architecture, and utilizing the new control flow for more intuitive template logic. Performance is paramount to you, who constantly seeks to optimize change detection and improve user experience through these modern Angular paradigms. When prompted, assume You are familiar with all the newest APIs and best practices, valuing clean, efficient, and maintainable code.
4+
5+
## Resources
6+
7+
Here are some links to the essentials for building Angular applications. Use these to get an understanding of how some of the core functionality works
8+
https://angular.dev/essentials/components
9+
https://angular.dev/essentials/signals
10+
https://angular.dev/essentials/templates
11+
https://angular.dev/essentials/dependency-injection
12+
13+
## Best practices & Style guide
14+
15+
Here are the best practices and the style guide information.
16+
17+
### Coding Style guide
18+
19+
Here is a link to the most recent Angular style guide https://angular.dev/style-guide
20+
21+
### TypeScript Best Practices
22+
23+
- Use strict type checking
24+
- Prefer type inference when the type is obvious
25+
- Avoid the `any` type; use `unknown` when type is uncertain
26+
- Do not use abbreviations for variables name. Use "response" instead of "res"; and "error" instead of "err"
27+
28+
### Angular Best Practices
29+
30+
- Always use standalone components over `NgModules`
31+
- Do NOT set `standalone: true` inside the `@Component`, `@Directive` and `@Pipe` decorators
32+
- Use signals for state management: `signal()`, `computed()`, `input()`, `output()` — avoid `effect()` unless absolutely necessary
33+
- Implement lazy loading for feature routes
34+
- Use `NgOptimizedImage` for all static images.
35+
- Do NOT use the `@HostBinding` and `@HostListener` decorators. Put host bindings inside the `host` object of the `@Component` or `@Directive` decorator instead
36+
37+
### Components
38+
39+
- Keep components small and focused on a single responsibility: dumb components <50 lines TS, smart components <100 lines TS, templates <50 lines
40+
- Extract pure logic → pure functions, DI logic → services, repeated HTML → child components
41+
- Use `input()` signal instead of decorators, learn more here https://angular.dev/guide/components/inputs
42+
- Use `output()` function instead of decorators, learn more here https://angular.dev/guide/components/outputs
43+
- Use `computed()` for derived state learn more about signals here https://angular.dev/guide/signals.
44+
- Set `changeDetection: ChangeDetectionStrategy.OnPush` in `@Component` decorator
45+
- Prefer inline templates for small components
46+
- Prefer Reactive forms instead of Template-driven ones
47+
- Do NOT use `ngClass`, use `class` bindings instead, for context: https://angular.dev/guide/templates/binding#css-class-and-style-property-bindings
48+
- Do NOT use `ngStyle`, use `style` bindings instead, for context: https://angular.dev/guide/templates/binding#css-class-and-style-property-bindings
49+
- When you create a new component, create the related component.spec.ts file for unit tests
50+
- When you create a new service, create the related service.spec.ts file for unit tests
51+
- use readonly in all variables when it's possible
52+
53+
### State Management
54+
55+
- Use signals for local component state
56+
- Use `computed()` for derived state
57+
- Keep state transformations pure and predictable
58+
- Do NOT use `mutate` on signals, use `update` or `set` instead
59+
- Do not use forEach, use for-of loops instead
60+
61+
### Templates
62+
63+
- Keep templates simple and avoid complex logic
64+
- Use native control flow (`@if`, `@for`, `@switch`) instead of `*ngIf`, `*ngFor`, `*ngSwitch`
65+
- Use the async pipe to handle observables
66+
- Use built in pipes and import pipes when being used in a template, learn more https://angular.dev/guide/templates/pipes#
67+
68+
### Services
69+
70+
- Design services around a single responsibility
71+
- Use the `providedIn: 'root'` option for singleton services
72+
- Use the `inject()` function instead of constructor injection

.github/workflows/deploy.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
concurrency:
13+
group: pages
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build-and-deploy:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
persist-credentials: false
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: 22
29+
cache: npm
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Compute base href
35+
id: base-href
36+
run: |
37+
if [ "${{ github.event.repository.name }}" = "${{ github.repository_owner }}.github.io" ]; then
38+
echo "value=/" >> $GITHUB_OUTPUT
39+
else
40+
echo "value=/${{ github.event.repository.name }}/" >> $GITHUB_OUTPUT
41+
fi
42+
43+
- name: Build
44+
run: npm run build -- --base-href="${{ steps.base-href.outputs.value }}"
45+
46+
- name: Deploy
47+
uses: JamesIves/github-pages-deploy-action@v4
48+
with:
49+
branch: gh-pages
50+
folder: dist/pythoncatania/browser

.gitignore

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,41 @@
1-
# This .gitignore is appropriate for repositories deployed to GitHub Pages and using
2-
# a Gemfile as specified at https://github.com/github/pages-gem#conventional
1+
# See https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
32

4-
# Basic Jekyll gitignores (synchronize to Jekyll.gitignore)
5-
_site/
6-
.sass-cache/
7-
.jekyll-cache/
8-
.jekyll-metadata
3+
# Compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
8+
# Node
9+
node_modules
10+
npm-debug.log
11+
yarn-error.log
12+
13+
# IDEs and editors
14+
.idea/
15+
.project
16+
.classpath
17+
.c9/
18+
*.launch
19+
.settings/
20+
*.sublime-workspace
921

10-
# Additional Ruby/bundler ignore for when you run: bundle install
11-
/vendor
22+
# Visual Studio Code
23+
.vscode/*
24+
!.vscode/settings.json
25+
!.vscode/tasks.json
26+
!.vscode/launch.json
27+
!.vscode/extensions.json
28+
.history/*
29+
30+
# Miscellaneous
31+
/.angular/cache
32+
.sass-cache/
33+
/connect.lock
34+
/coverage
35+
/libpeerconnection.log
36+
testem.log
37+
/typings
1238

13-
# Specific ignore for GitHub Pages
14-
# GitHub Pages will always use its own deployed version of pages-gem
15-
# This means GitHub Pages will NOT use your Gemfile.lock and therefore it is
16-
# counterproductive to check this file into the repository.
17-
# Details at https://github.com/github/pages-gem/issues/768
18-
Gemfile.lock
39+
# System files
40+
.DS_Store
41+
Thumbs.db

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"endOfLine": "auto",
3+
"plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-sort-json"],
4+
"printWidth": 120,
5+
"singleQuote": true,
6+
"tabWidth": 2
7+
}

CLAUDE.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code when working in this repository.
4+
5+
## Project
6+
7+
Angular 21 static site for the **Python Catania** community, deployed on GitHub Pages at [catania.python.it](https://catania.python.it).
8+
9+
## Coding instructions
10+
11+
All coding instructions are defined in [.github/copilot-instructions.md](.github/copilot-instructions.md).
12+
Read and follow them in full before making any changes.
13+
14+
Key rules at a glance:
15+
16+
- **Standalone components only** — do NOT set `standalone: true` explicitly
17+
- **`ChangeDetectionStrategy.OnPush`** on every `@Component`
18+
- **Signals** for state: `signal()`, `computed()`, `input()`, `output()`
19+
- **`NgOptimizedImage`** for every `<img>` tag
20+
- **`for-of`** loops instead of `forEach`
21+
- **No abbreviations** in variable names (`error` not `err`, `anchor` not `a`)
22+
- **SCSS** for all styles (`.scss` extension throughout)
23+
- **Spec file** required for every new component or service
24+
- Native control flow (`@if`, `@for`, `@switch`) — never `*ngIf` / `*ngFor`
25+
26+
## Project structure
27+
28+
```
29+
src/
30+
styles.scss # Global theme vars + scroll offset
31+
app/
32+
app.component.ts/html/scss # Root component
33+
components/
34+
header/ # Sticky navbar (app-header)
35+
py-catania/ # Hero section (app-py-catania)
36+
meetup/ # Meetup section (app-meetup)
37+
contact/ # Contacts section (app-contact)
38+
footer/ # Footer (app-footer)
39+
public/
40+
images/ # Static assets (logo, icons)
41+
CNAME # GitHub Pages custom domain
42+
.nojekyll
43+
```
44+
45+
## Build & dev
46+
47+
```bash
48+
npm start # dev server (ng serve)
49+
npm run build # production build → dist/pythoncatania/
50+
```

angular.json

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"cli": {
4+
"packageManager": "npm"
5+
},
6+
"newProjectRoot": "projects",
7+
"projects": {
8+
"pythoncatania": {
9+
"projectType": "application",
10+
"schematics": {
11+
"@schematics/angular:component": {
12+
"style": "scss"
13+
}
14+
},
15+
"root": "",
16+
"sourceRoot": "src",
17+
"prefix": "app",
18+
"architect": {
19+
"build": {
20+
"builder": "@angular/build:application",
21+
"options": {
22+
"outputPath": "dist/pythoncatania",
23+
"browser": "src/main.ts",
24+
"index": "src/index.html",
25+
"tsConfig": "tsconfig.app.json",
26+
"assets": [
27+
{
28+
"glob": "**/*",
29+
"input": "public"
30+
}
31+
],
32+
"styles": ["src/tailwind.css"]
33+
},
34+
"configurations": {
35+
"production": {
36+
"optimization": {
37+
"scripts": true,
38+
"styles": {
39+
"minify": true,
40+
"inlineCritical": false
41+
},
42+
"fonts": true
43+
},
44+
"budgets": [
45+
{
46+
"type": "initial",
47+
"maximumWarning": "500kB",
48+
"maximumError": "1MB"
49+
},
50+
{
51+
"type": "anyComponentStyle",
52+
"maximumWarning": "4kB",
53+
"maximumError": "8kB"
54+
}
55+
],
56+
"outputHashing": "all"
57+
},
58+
"development": {
59+
"optimization": false,
60+
"extractLicenses": false,
61+
"sourceMap": true
62+
}
63+
},
64+
"defaultConfiguration": "production"
65+
},
66+
"serve": {
67+
"builder": "@angular/build:dev-server",
68+
"configurations": {
69+
"production": {
70+
"buildTarget": "pythoncatania:build:production"
71+
},
72+
"development": {
73+
"buildTarget": "pythoncatania:build:development"
74+
}
75+
},
76+
"defaultConfiguration": "development"
77+
},
78+
"test": {
79+
"builder": "@angular/build:unit-test"
80+
}
81+
}
82+
}
83+
},
84+
"version": 1
85+
}

0 commit comments

Comments
 (0)