Skip to content

Migrate website to Next.js rebuild (history-preserving)#195

Open
rudra-iitm wants to merge 76 commits into
masterfrom
redesign-nextjs
Open

Migrate website to Next.js rebuild (history-preserving)#195
rudra-iitm wants to merge 76 commits into
masterfrom
redesign-nextjs

Conversation

@rudra-iitm
Copy link
Copy Markdown
Collaborator

Migrate the OpenPrinting website to the Next.js rebuild

This PR replaces the current Jekyll site with the new Next.js + Tailwind + Framer Motion rebuild, while preserving the complete existing Git history. It is opened as a draft for maintainer review — it does not change master or any repo settings on its own.

History preservation (most important)

This is a merge of two previously-unrelated histories, not a force-push:

Parent Lineage Commits
1 master — 7 years of OpenPrinting site history 891
2 redesign — the Next.js rewrite 70
  • The working tree of the merge equals the redesign tree exactly (no leftover Jekyll files).
  • No history was rewritten and no commits were dropped. Every author, timestamp, and commit on both sides remains reachable via git log. Authors such as Michael R Sweet, Till Kamppeter, Zdenek Dohnal, dependabot, etc. are fully preserved on the first-parent history.
  • git log --first-parent continues to show the original master timeline, with this merge on top.

What changed in config for production

  • Base path (config/site.config.ts): defaults to "" (domain root). This is the org root Pages site (https://openprinting.github.io/), so a project-style /openprinting.github.io prefix would 404 every asset/CSS/JS/link. ?? "" keeps an explicit NEXT_PUBLIC_BASE_PATH override possible for sub-path previews.
  • Repo owner set to OpenPrinting so repo slug, links, and Giscus mapping target this repository.
  • Giscus: repoId now points at this repo. This repo has no "Blog Comments" discussion category, so comments currently map to General. ⚠️ A maintainer may prefer to create a dedicated Announcements-type "Blog Comments" category and update categoryId in config/site.config.ts.
  • Workflows: build.yml / deploy.yml now trigger on master (was main).

⚠️ Required at merge time (repo admin only)

GitHub Pages for this repo is currently the legacy Jekyll builder (build_type: legacy, source master/root). This PR's tree is Next.js, not Jekyll. Before/when this lands on master, Pages "Build and deployment → Source" must be switched to "GitHub Actions" (the included deploy.yml builds the static export and publishes it). Otherwise Pages will try to Jekyll-build a Next.js tree and the live site will break. There is no custom domain (cname: null), so no CNAME handling is needed.

Validation performed locally

  • tsc --noEmit typecheck
  • next lint (no warnings/errors)
  • ✅ RSS generation — links are correct root URLs (https://openprinting.github.io/...)
  • ✅ Search index generation — root-relative paths, no double prefix
  • ⏳ Full next build runs the Foomatic prebuild which needs Linux-only system packages — it runs in CI (build.yml) on this PR.

Rollback

Trivial and safe: master is untouched. If anything is wrong, close the PR (and, if already merged, the merge can be reverted; the legacy Pages source can be restored). No history is lost either way.

rudra-iitm and others added 30 commits March 17, 2025 23:26
feat(authors): add reusable AuthorCard component
…es (#8)

feat(authors): add reusable AuthorCard component and fix all linting issues
[feat add]: integrate AuthorCard into news post layout
…#11)

feat(news): migrate all posts from old Jekyll site into Next.js contents

---------

Co-authored-by: Rudra Pratap Singh <rudransh.iitm@gmail.com>
* feat(posts): add automatic redirect support for previous slugs

* fix(posts): decode slug before matching post filenames
…18)

Implemented a complete client-side search system with build-time indexing, markdown AST-based content normalization, and MiniSearch integration. Added a responsive search modal with keyboard shortcuts, debounced input, loading states, and improved UI/UX, along with proper typing, production compatibility, and documentation.
…te (#13)

Fixed React Server Components CVE vulnerabilities by updating dependencies (next, react-server-dom-webpack, react-server-dom-parcel, and react-server-dom-turbopack) to secure versions using the fix-react2shell-next tool, ensuring all package.json files use patched versions based on the official React advisory. Improved site navigation by replacing scroll-based links with route-based navigation and resolving link/button issues. Implemented and migrated multiple website pages including About Us, Contribute, Contact, Downloads, Documentation, Driverless, and other legacy markdown pages. Added a fully functional projects section, news listing with sidebar and year-based navigation, and homepage improvements such as rendering latest posts and aligning hero/info sections with the live site. Fixed theme behavior to follow the system color scheme, updated author card styling for light mode, aligned the footer globally, corrected homepage interactions, and resolved build issues for Next.js 15 static export. Also cleaned content by removing non-legacy news files, syncing posts, updating dependencies, and adjusting the search index.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: Rudra Pratap Singh rudransh.iitm@gmail.com
style: Refine UI styling and update color palette

Refined the overall UI styling by updating the color palette and adjusting layouts across multiple components and pages to provide a cleaner and more consistent visual refresh.

feat: Redesign search modal with spotlight-style interface

Redesigned the search modal to follow a spotlight-style interface for a more modern search experience. Added an escape-to-close feature and improved the presentation of search results.

feat: Improve search input responsiveness and TOC styling

Improved the responsiveness of the search input for better usability and updated the styling of table of contents headings for improved readability.

feat(navbar): Improve mobile search button usability

Enhanced the styling and spacing of the mobile search button in the navbar to make it easier to access and visually consistent with the rest of the interface.

feat(hero): Add subtle banner image to hero section

Added a subtle background banner image to the hero section and adjusted its height to improve visual balance and overall page appeal.
… handling

Added an environment variable `NEXT_PUBLIC_BASE_PATH` to the Next.js configuration for dynamic image path handling based on the production environment. Updated image sources in the Downloads page and hero section to utilize this variable, ensuring correct image loading in different environments. Removed the hardcoded background image URL in the hero section for improved flexibility. Also updated the generated timestamp in the static search index.
…onment flexibility; update generated timestamp in static index
…sed on environment; update generated timestamp in static index
…th; remove unused CSS comments for cleaner code
…ity and responsiveness; update generated timestamp in static index
Copilot AI and others added 18 commits March 24, 2026 04:42
Co-authored-by: rudra-iitm <120119520+rudra-iitm@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rudra-iitm/openprinting.github.io/sessions/46c64b8d-0378-4b0d-92d0-12e03577c126
…ionality

Add smart 404 page with trailing slash redirect for GitHub Pages
- Introduced a Separator component for UI layout.
- Added SimpleSelect and SimpleSelectItem components for dropdown selection.
- Implemented a Skeleton component for loading states.
- Created utility functions for base path handling and debouncing.
- Defined TypeScript interfaces for printer and driver data structures.
- Developed utility functions for class name merging and printer status calculation.
- Implemented scripts for combining, generating, and splitting printer data from XML to JSON.
- Added PPD generation script and handling for printer capabilities.
- Updated PrinterSearch to use new shared components for better consistency and maintainability.
- Replaced SimpleSelect with FoomaticSelect for filtering options.
- Removed unused badge, button, card, dropdown-menu, input, select, separator, simple-select, and skeleton components.
- Introduced shared components: FoomaticCard, FoomaticHeroPill, FoomaticSelect, and FoomaticBadge for UI consistency.
- Adjusted layout and styling for improved user experience in the Printers component.
- Updated utility functions to streamline class name management.
… generation pipeline

- Deleted old JavaScript scripts for data generation and processing.
- Added TypeScript versions of data generation scripts: `data-generate.ts`, `generate-from-xml.ts`, `combine-data.ts`, and `split-printers.ts`.
- Updated the data generation pipeline to use TypeScript and improved error handling.
- Enhanced printer data processing with better type definitions and structured output.
- Created a new `PageHero` component for improved UI consistency.
- Introduced a new `site.ts` utility for handling site URLs and paths.
- Updated RSS feed generation to use new site configuration.
- Improved TypeScript configuration for better module resolution and type checking.
New post and image assets for Opportunity Open Source 4.0 at IIIT
Allahabad, plus regenerated RSS feed and search index. Pin Yarn to the
node-modules linker via .yarnrc.yml.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Prepare the Next.js rebuild to become the live site at the OpenPrinting
organization root Pages site (https://openprinting.github.io/):

- site.config.ts: set repo owner to OpenPrinting so repo slug, links and
  Giscus mapping point at the production repository.
- basePath: default to "" (root) instead of /openprinting.github.io. The
  org *root* Pages site is served from the domain root, so a project-style
  subpath prefix would 404 every asset, stylesheet, script and link. Use
  `?? ""` so an explicit NEXT_PUBLIC_BASE_PATH override is still honored.
- Giscus: point repoId at OpenPrinting/openprinting.github.io. That repo
  has no "Blog Comments" discussion category yet, so map comments to the
  existing "General" category (a maintainer may add a dedicated
  Announcements-type category later).
- Workflows: trigger build/deploy on master (the production default
  branch) rather than main.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the Jekyll site contents with the new Next.js + Tailwind rebuild
while preserving BOTH lineages as merge parents:

  parent 1: master  — 7 years of OpenPrinting site history (891 commits)
  parent 2: redesign — the Next.js rewrite (70 commits)

The working tree of this commit is exactly the redesign tree. No history
was rewritten and no commits were dropped: every author, timestamp, and
commit on both sides remains reachable via `git log`.

Deployment note: this repo's GitHub Pages source must be switched from the
legacy Jekyll builder to "GitHub Actions" (the deploy.yml workflow) before
or at the moment this lands on master, otherwise Pages will try to Jekyll-
build a Next.js tree. This requires repo admin and is documented in the PR.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@michaelrsweet
Copy link
Copy Markdown
Member

@tillkamppeter I am assigning this to you to review.

@rudra-iitm Is there a live link you can provide that shows the new web site content for others to review?

rudra-iitm and others added 3 commits June 4, 2026 20:15
The project migrated to Yarn 4 (Berry lockfile + .yarnrc.yml), but CI ran
the runner's default Yarn 1 with `--frozen-lockfile`, which cannot satisfy
a Yarn 4 lockfile and failed install.

- Pin Yarn with "packageManager": "yarn@4.12.0" so Corepack resolves it.
- Enable Corepack after setup-node in both workflows.
- Use `yarn install --immutable` (Yarn 4's frozen-lockfile equivalent).

Verified locally: `yarn install --immutable` succeeds against the committed
lockfile.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
setup-node's `cache: yarn` runs `yarn cache dir` using the runner's global
Yarn 1, which aborts when package.json pins "packageManager": "yarn@4".
Remove the built-in cache and rely on Corepack (enabled in the next step).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Yarn 4 (Berry) does not execute implicit pre/post lifecycle scripts, so
`yarn build` no longer triggered `prebuild`. That left the Foomatic data
(public/foomatic-db/printersMap.json) ungenerated, so generateStaticParams()
returned [] and `output: export` failed on /foomatic/printer/[id].

Move the generation chain into an explicit `generate` script and have
`build` run it before `next build`, so it works under any package manager.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rudra-iitm
Copy link
Copy Markdown
Collaborator Author

@tillkamppeter I am assigning this to you to review.

@rudra-iitm Is there a live link you can provide that shows the new web site content for others to review?

Hi, you can view the live preview at: https://rudra-iitm.github.io/openprinting.github.io/

@michaelrsweet
Copy link
Copy Markdown
Member

The site updates look great to me, and the working site search is a welcome addition.

@rudra-iitm rudra-iitm marked this pull request as ready for review June 4, 2026 15:21
@tillkamppeter
Copy link
Copy Markdown
Member

I have found some bugs, in "News and Events":

  • There is an entry with January 1, 1970 as date (time_t time = 0), probably your conversion has torn the date in the file name apart.
  • "OpenPrinting News - Opportunity Open Source 4.0 in the IIIT Allahabad" is, despite carried over, completely missing
  • Several recent software release announcements are missing.

Another thing I did not test:

Are all the links conserved? If external sites link to our site these links should continue to work.

Also, could you, so that we get examples for applying to other posts, add the following 2 features to the post about my Tech over Tea video (I have earlier reported issues and you had solved them):

  • Rename it to have the title "OpenPrinting News - Tech over Tea #299 - Brodie interviews Till Kamppeter" and add your mechanism which makes it still be opened with the old link (for the "... Tech over Tea #300 ..." title).
  • Add the needed metadata to it so that the Teaser image gets manually selected, to be the thumbnail of the actual Tech over Tea episode video and not the thumbnail of the arbitrary video which I have referred to in the beginning.

@tillkamppeter
Copy link
Copy Markdown
Member

Another little issue: In all pages (at least in my blog posts) the section titles appear as links pointing to themselves. They should, as you see on the old site not appear as links but have anchors so that they can be navigated to with #-extended URLs.

@tillkamppeter
Copy link
Copy Markdown
Member

Next issue:

Click on the search button at the top right and enter "Fax" as search term. For me the very first result is "IPP Fax Out - A new reality". Click this entry and you get a 404.

@tillkamppeter
Copy link
Copy Markdown
Member

On "Projects" (openprinting.github.io/projects) we should not mention ippusbxd, as this project is discontinued. Instead ipp-usb should be mentioned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants