Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

13 changes: 0 additions & 13 deletions .eslintrc.yml

This file was deleted.

54 changes: 54 additions & 0 deletions .github/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copilot Instructions for openjdk-website

## Project Overview
- This is the source for https://www.adoptopenjdk.net, a static website for AdoptOpenJDK.
- The site is built using [Vite](https://vitejs.dev/) and Handlebars templates.
- The `master` branch is the main development branch. Production is deployed from the `gh-pages` branch via CI/CD.

## Key Directories & Files
- `src/` — Main source code (JS, CSS/SCSS, Handlebars templates, assets)
- `src/handlebars/` — Handlebars templates for all site pages and partials
- `src/js/` — JavaScript for page logic and interactivity
- `src/scss/` — SCSS stylesheets, split by page/feature
- `src/assets/` — Images and static assets
- `public/` — Static files served as-is
- `package.json` — Scripts, dependencies, and build config
- `vite.config.js` — Vite build configuration
- `assemble.sh` — Legacy build script (use Vite for builds)

## Build & Development
- Use Vite for all builds and local development:
- `npm run dev` — Start local dev server
- `npm run build` — Build static site for production
- `npm run preview` — Preview production build locally
- Lint code with `npm run lint` (uses ESLint)
- Do **not** use `assemble.sh` for new workflows; it's for legacy reference only.

## Templating & Patterns
- All HTML is generated from Handlebars templates in `src/handlebars/`.
- Use partials in `src/handlebars/partials/` for shared layout/components (e.g., header, footer, menu).
- Page-specific JS is in `src/js/` and is loaded per template as needed.
- SCSS is modularized by feature/page; import only what is needed.

## Conventions & Practices
- Use ES modules (`type: module` in `package.json`).
- Prefer Vite plugins for asset optimization (see `vite.config.js`).
- Keep all static assets in `src/assets/` or `public/`.
- Do not add new build steps to `assemble.sh`.
- Follow the structure and naming conventions in `src/handlebars/` for new pages/partials.

## External Integrations
- API calls should use the documented endpoints at [api.adoptopenjdk.net](https://api.adoptopenjdk.net).
- For API changes, see the [openjdk-api repo](https://github.com/AdoptOpenJDK/openjdk-api).

## Example: Adding a New Page
1. Create a new Handlebars template in `src/handlebars/`.
2. Add any required partials to `src/handlebars/partials/`.
3. Add page-specific JS to `src/js/` if needed.
4. Add styles to `src/scss/`.
5. Reference assets from `src/assets/`.
6. Update routing/build config if necessary in `vite.config.js`.

---

If any conventions or workflows are unclear, please ask for clarification or check `CONTRIBUTING.md`.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v3.28.12
6 changes: 3 additions & 3 deletions .github/workflows/deploy-to-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
run: |
cd website
npm install
gulp build
npm run build

- name: Create Directory Stucture
- name: Create Directory Structure
run: |
mkdir tmp
mv website/sitemap.xml tmp/
Expand All @@ -39,7 +39,7 @@ jobs:
echo "These files are ready to be moved onto the production web server:"
ls

# Package the artefacts using actions/upload-pages-artifact
# Package the artifacts using actions/upload-pages-artifact
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
- name: Test
run: |
npm install
npm run test
npm run lint
29 changes: 23 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
npm-debug.log
.idea
dist
*.html
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

sitemap.xml
.DS_Store*
.java-version
.vscode/
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ npm start

**IMPORTANT:** Node will run source code and all that is needed inside container. In order to see website and changes you are doing point browser to http://localhost:3000 and for UI http://localhost:3001

Modify code in your preferd IDE outside docker, it will be picked up automaticly
Modify code in your preferred IDE outside docker, it will be picked up automatically

---

Expand Down
30 changes: 30 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { FlatCompat } from '@eslint/eslintrc';
import js from '@eslint/js';
import { fileURLToPath } from 'url';
import { dirname } from 'path';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
});

export default [
{
ignores: ['node_modules/**', 'dist/**'], // Add ignored paths here
},
js.configs.recommended,
{
ignores: ['node_modules/**'],
},
...compat.config({
env: {
browser: true,
es2021: true,
},
rules: {
// Add custom rules here if needed
},
}),
];
Loading