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
96 changes: 96 additions & 0 deletions .github/ISSUE_TEMPLATE/add-notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Add notes
description: Share notes, a lab manual or a question paper. No coding needed.
title: "Add notes: "
labels: ["content"]
body:
- type: markdown
attributes:
value: |
Thanks for adding to Knotes Central. Fill this in and a maintainer will
put it on the site — usually within a few days.

**Before you start:** upload your files to a Google Drive folder and set
sharing to *Anyone at RVCE with the link*, or use a public GitHub repo.

- type: input
id: department
attributes:
label: Department
description: e.g. CSE / ISE / AIML, ECE, Mechanical
placeholder: Computer Science, Information Science, AIML Engineering
validations:
required: true

- type: input
id: year
attributes:
label: Year
placeholder: "2"
validations:
required: true

- type: input
id: semester
attributes:
label: Semester
placeholder: "3"
validations:
required: true

- type: input
id: subject
attributes:
label: Subject name
placeholder: Data Structures and its Applications
validations:
required: true

- type: input
id: subject_code
attributes:
label: Subject code
placeholder: CSE201

- type: dropdown
id: type
attributes:
label: What kind of material is it?
options:
- Theory notes
- Lab material
- Question papers
validations:
required: true

- type: input
id: title
attributes:
label: Title to show on the site
placeholder: DSA Unit 1–5 notes (Prof. Sharma)
validations:
required: true

- type: input
id: link
attributes:
label: Link
description: Google Drive folder, Google Doc or GitHub repo.
placeholder: https://drive.google.com/drive/folders/...
validations:
required: true

- type: input
id: credit
attributes:
label: Name for the contributors page
description: Leave blank to stay anonymous.

- type: checkboxes
id: confirm
attributes:
label: Confirm
options:
- label: This is my own work, or I have permission to share it.
required: true
- label: The link is accessible to RVCE students.
required: true
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/broken-link.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Broken or wrong link
description: A note does not open, or points at the wrong material.
title: "Broken link: "
labels: ["broken-link"]
body:
- type: input
id: page
attributes:
label: Page
description: The page on the site where you found it.
placeholder: /cse-ise-aiml/2/3
validations:
required: true

- type: input
id: note
attributes:
label: Which note?
placeholder: DMS Study Materials
validations:
required: true

- type: dropdown
id: problem
attributes:
label: What happens?
options:
- Link is dead / 404
- Asks for access I cannot get
- Opens the wrong material
- Something else
validations:
required: true

- type: input
id: replacement
attributes:
label: Working link, if you have one
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Ask the RVCE community
url: https://www.reddit.com/r/KnotesCentral/
about: General questions about notes, subjects or the site.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
pull_request:
push:
branches: [main, refactor/structure]

jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # What's New reads dates from history

- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- run: npm ci

# Fast, contributor-friendly check first: a bad catalog entry fails here
# with a message that says how to fix it.
- name: Validate catalog data
run: npm run check:data

- name: Typecheck
run: npm run typecheck

- name: Lint
run: npm run lint

- name: Unit tests
run: npm test

- name: Build
run: npm run build
71 changes: 71 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Deploy to GitHub Pages

# The site is a static export, so publishing it is just "build and upload the
# out/ directory". The base path and the canonical URL are read back from the
# Pages API rather than hardcoded, so a rename of the repository — or moving it
# to a custom domain — needs no code change.

on:
push:
branches: [main, refactor/structure]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

# One deploy at a time; never cancel one halfway through.
concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # What's New and the sitemap read dates from history

- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Configure Pages
id: pages
uses: actions/configure-pages@v5
with:
enablement: true

- run: npm ci

- name: Validate the catalog
run: npm run check:data

- name: Build the static export
env:
NEXT_PUBLIC_SITE_URL: ${{ steps.pages.outputs.base_url }}
NEXT_PUBLIC_BASE_PATH: ${{ steps.pages.outputs.base_path }}
run: npm run build

# Pages runs Jekyll over the artifact unless told not to, and Jekyll
# drops every directory beginning with an underscore — including
# _next/, which is the whole build.
- name: Disable Jekyll
run: touch out/.nojekyll

- uses: actions/upload-pages-artifact@v3
with:
path: out

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
85 changes: 85 additions & 0 deletions .github/workflows/link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Link check

on:
schedule:
- cron: "0 3 * * 1" # Mondays, 03:00 UTC
workflow_dispatch:

# Drive folders die when the RVCE account that owned them is purged, so the
# catalog rots silently. This finds the damage weekly and files it as an issue.
jobs:
check:
runs-on: ubuntu-latest
permissions:
contents: write # commits the updated link status and history
issues: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20

# --write updates src/data/generated/link-status.json (what the site
# flags today) and appends this run to link-history.json (what /rot
# charts). Without the commit below, the history would never grow.
- name: Check every resource link
run: node scripts/check-links.mjs --write > link-report.txt 2>/dev/null || true

- name: Summarise
run: cat link-report.txt >> "$GITHUB_STEP_SUMMARY"

- name: Commit the new snapshot
run: |
if git diff --quiet -- src/data/generated; then
echo "Nothing changed since the last check."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add src/data/generated
git commit -m "Link check $(date -u +%Y-%m-%d): record this week's verdicts"
git push

- name: File or update the tracking issue
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const report = fs.readFileSync('link-report.txt', 'utf8');
const title = 'Broken links — automated weekly check';
const body = [
'Automated check of every link in `src/data/departments/`.',
'',
'`needs-auth` is normal for RVCE-restricted Drive folders and is not a problem.',
'`probably-gone` means Drive returned 404 — the folder was almost certainly deleted.',
'',
'```',
report.trim().slice(0, 55000),
'```',
].join('\n');

const { data: issues } = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
labels: 'broken-link',
});

const existing = issues.find((issue) => issue.title === title);

if (existing) {
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: existing.number,
body,
});
} else {
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title,
body,
labels: ['broken-link'],
});
}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,10 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# generated at build time (added.json is committed so a fresh clone typechecks)
/public/icon-*.png
/public/apple-icon.png

# `npm run check:links -- --json` scratch output
/link-report.json
Loading
Loading