Skip to content

Separate HTML template from build output#7

Merged
danmooney merged 1 commit into
mainfrom
develop
May 20, 2026
Merged

Separate HTML template from build output#7
danmooney merged 1 commit into
mainfrom
develop

Conversation

@danmooney
Copy link
Copy Markdown
Owner

@danmooney danmooney commented May 20, 2026

webpack was using public/index.html as both the HtmlWebpackPlugin template and its output, causing each build to re-inject a bundle.js script tag into the source. Move the template to src/index.html and let webpack regenerate public/index.html on build.

Summary by CodeRabbit

  • Refactor
    • Reorganized landing page structure and updated build configuration
    • Enhanced landing page with detailed information about the Python Dict to JSON Converter tool, including comparisons and use cases

Review Change Stack

webpack was using public/index.html as both the HtmlWebpackPlugin
template and its output, causing each build to re-inject a bundle.js
script tag into the source. Move the template to src/index.html and
let webpack regenerate public/index.html on build.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

📝 Walkthrough

Walkthrough

The PR relocates the HTML landing page template from public/index.html to src/index.html. The webpack build configuration is updated to reference the new source path, and the git ignore rules are adjusted to remove the exception for the old public template location.

Changes

Template Relocation

Layer / File(s) Summary
Move HTML template to src directory
src/index.html, webpack.config.js, .gitignore
New src/index.html contains the landing page HTML (metadata, content sections, footer, and Google Analytics); webpack.config.js HtmlWebpackPlugin template option is updated from ./public/index.html to ./src/index.html; .gitignore no longer includes the public/index.html exception, allowing only .gitkeep in the public directory.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

  • danmooney/dict2json#3: Both PRs modify public/index.html and .gitignore rules; this PR removes the public template and moves it to src, while the related PR adds content to the public template and un-ignores public/privacy.html.

Poem

🐰 From public to src, the HTML hops along,
Webpack knows the new path, webpack sings the song,
.gitignore stops tracking what's no longer there,
A cleaner project structure, with template care! 🌱

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Separate HTML template from build output' directly describes the main change: moving the HTML template from public/ to src/ and updating webpack configuration to separate the template source from the build output directory.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/index.html`:
- Around line 89-95: Replace the current unconditional Google Analytics
injection (the gtag script tag and the gtag(...) calls) with a consent-first
flow: implement a cookie-consent banner/modal that requests explicit consent,
stores the choice (e.g., in localStorage or a consent cookie), and only
dynamically injects the gtag.js script and runs the gtag('js', ...) and
gtag('config', 'G-QFE6TJB3X9') calls after the user grants consent; also provide
an opt-out toggle that removes or disables gtag (and clears related cookies) and
update the privacy policy to document analytics usage and consent behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3df12835-f3b4-4091-94f2-fff899fc8818

📥 Commits

Reviewing files that changed from the base of the PR and between f86577c and 9815d3b.

📒 Files selected for processing (4)
  • .gitignore
  • public/index.html
  • src/index.html
  • webpack.config.js
💤 Files with no reviewable changes (2)
  • public/index.html
  • .gitignore

Comment thread src/index.html
@danmooney danmooney merged commit e178855 into main May 20, 2026
2 checks passed
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.

1 participant