Skip to content
Merged
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
14 changes: 8 additions & 6 deletions .github/ISSUE_TEMPLATE/broken-link.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ body:
- type: input
id: file
attributes:
label: File path
placeholder: docs/python.md
label: Where did you see it?
description: Prefer the live library URL or books.json id. Do not paste working Drive links in public issues if avoidable.
placeholder: https://freecodebooks.vercel.app/library?lang=python or python-fluent-python
validations:
required: true
- type: input
Expand All @@ -24,10 +25,10 @@ body:
- type: input
id: url
attributes:
label: Current URL
label: Current URL (optional — leave blank if unknown)
placeholder: https://
validations:
required: true
required: false
- type: dropdown
id: problem
attributes:
Expand All @@ -37,14 +38,15 @@ body:
- Permission denied / private
- Redirects to unrelated content
- Wrong book or edition
- Read book fails on the website
- Other
validations:
required: true
- type: input
id: replacement
attributes:
label: Suggested replacement URL (optional)
placeholder: https://
label: Suggested replacement (maintainers only — optional)
placeholder: leave blank as a contributor
- type: textarea
id: notes
attributes:
Expand Down
3 changes: 2 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ Briefly describe your change.
## Checklist

- [ ] Contributors did **not** add example.com or other placeholder links
- [ ] Book URLs (if any) are only in `web/data/books.json` — not in README or `docs/`
- [ ] Any URL added is a real `https://drive.google.com/…` (or approved docs host) and passes `cd web && npm run validate:links`
- [ ] Correct language file and skill-level section (when editing docs)
- [ ] Correct language file and skill-level section (when editing docs — titles only)
- [ ] No duplicate titles
- [ ] Markdown / UI renders correctly

Expand Down
30 changes: 19 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ By participating, you agree to follow our [Code of Conduct](CODE_OF_CONDUCT.md).

## Ways to contribute

- **Suggest a book by title only** (no links — maintainers attach Google Drive PDFs)
- Report a broken or outdated Drive link
- **Suggest a book by title only** (no links — maintainers add PDFs in the library app)
- Report a broken library link via the issue template
- Improve categorization or docs clarity
- Enrich the library app (`web/data/books.json`) with `author` / `coverImage` (maintainers)

Expand All @@ -25,13 +25,19 @@ By participating, you agree to follow our [Code of Conduct](CODE_OF_CONDUCT.md).
- Author (if known)
- Edition (optional)
- Why it belongs
3. Maintainers find the book, upload a **public Google Drive PDF**, and add it to [`docs/`](docs/) + [`web/data/books.json`](web/data/books.json).
3. Maintainers find the book, upload a **public Google Drive PDF**, and add it to [`web/data/books.json`](web/data/books.json). Optionally mirror the **title only** (no URL) under [`docs/`](docs/).

Fake or placeholder URLs (`https://example.com`, `PDF_LINK`, empty links) are rejected by validation.

## Where readers open books

Readers use **only** the live library: [https://freecodebooks.vercel.app/](https://freecodebooks.vercel.app/).

Do **not** put Drive, publisher, or download URLs in README or `docs/*.md`. Those files list titles and point people to the site.

## Link policy (maintainers only)

When adding or fixing a book URL:
Book URLs live **only** in [`web/data/books.json`](web/data/books.json) (`driveUrl`), never in public Markdown guides.

**Required for PDF books**

Expand All @@ -47,6 +53,7 @@ When adding or fixing a book URL:
- Empty `()`, `PDF_LINK`, `#`
- Random third-party dump sites
- Contributor-submitted unverified download links
- Drive / download URLs in `docs/` or README

Validate before merge:

Expand All @@ -65,30 +72,31 @@ Maintainer fields:

```bash
cd web
npm run import:docs # sync from docs/*.md (keeps author/cover)
npm run import:docs # sync titles/categories from docs/*.md (keeps existing driveUrl/author/cover)
npm run validate:links # reject placeholders / invalid hosts
npm run dev
```

Set Vercel **Root Directory** to `web`.

## Entry format (Markdown — maintainers)
## Entry format (Markdown — titles only)

```markdown
- [**Book Title**](https://drive.google.com/file/d/FILE_ID/view?usp=sharing) (*Edition*)
- **Book Title** (*Edition*)
```

Rules:

1. Correct skill-level section
2. Real Drive (or approved docs) URL — never example.com
3. Accurate title + edition
4. No duplicates on the same page
2. Accurate title + edition — **no URL**
3. No duplicates on the same page
4. Point readers to `https://freecodebooks.vercel.app/library?lang=…`

## Pull request checklist

- [ ] Contributors suggested **titles only** (no links in issues/PRs from new contributors)
- [ ] Any URL added by maintainers passes `npm run validate:links`
- [ ] Any URL added by maintainers is in `web/data/books.json` and passes `npm run validate:links`
- [ ] `docs/` and README have **no** Drive/download book links
- [ ] Correct language + section when editing docs
- [ ] No duplicate titles
- [ ] Markdown renders correctly
Expand Down
Loading
Loading