Homepage AJAX quick-search, shared header/footer, and sitemap automation (SEO + UX improvements)#41
Conversation
There was a problem hiding this comment.
💡 Codex Review
After moving this script under /pages/code/, the relative link ../movie/index.html (and the analogous TV link) now points to /pages/movie/index.html, but the actual detail routes are /movie/index.html and /series/index.html; users who click مشاهده جزئیات from ID-search results are sent to non-existent pages.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
pages/code/index.html
Outdated
|
|
||
| <div id="shared-footer"></div> | ||
|
|
||
| <script src="../apiKeySwitcher.js"></script> |
There was a problem hiding this comment.
Point API key switcher script to the real root path
Because this page now lives at /pages/code/index.html, ../apiKeySwitcher.js resolves to /pages/apiKeySwitcher.js, but the repository only has /apiKeySwitcher.js; this leaves loadApiKeys undefined and initializeSwitcher() in pages/code/id-search.js throws on load, so the ID search workflow breaks as soon as the page initializes.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a60117f7fe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| </button> | ||
| </div> | ||
| </header> | ||
| <div id="shared-header"></div> |
There was a problem hiding this comment.
Restore theme toggle before player script initialization
player/index.html now swaps the static header for #shared-header, but the inline script still immediately executes document.getElementById('theme-toggle').addEventListener(...). Because the header is injected later by deferred /js/layout-shared.js, #theme-toggle is null on every page load, which throws and stops the remaining setup code (including paste auto-detect, keyboard shortcuts, and theme initialization).
Useful? React with 👍 / 👎.
| </button> | ||
| </div> | ||
| </header> | ||
| <div id="shared-header"></div> |
There was a problem hiding this comment.
Keep a UI trigger for returning to Playsho input mode
This header replacement removes the previous “film new” control that called showInputSection(), and after this change there is no remaining invocation in playsho/index.html (the function is only exported in playsho/script.js). In active sessions, users lose the in-page way to get back to the input form and start a new shared video without manually manipulating the URL/reloading.
Useful? React with 👍 / 👎.
Motivation
robots.txtthat points to the sitemap.Description
index.html) and implemented client logic:createHomeSearchCard,runHomeAjaxSearch, andsetupHomeSearchinscript.jsto fetch TMDB search results inline and keep Enter →/search/index.html?q=...behavior.#seo-crawl-links) on the homepage and a helperupdateSeoCrawlLinks(...)to render indexable/movie/index.html?id=...and/series/index.html?id=...links populated after the main content fetch.qquery parameter exists by addinggetQueryParam('q')and auto-invoking the search (insearch/search.js).scripts/generate-sitemap.mjscollects a set of static paths and attempts to enrich the sitemap with IDs from TMDB endpoints; it writessitemap.xmlusing the base URLhttps://freemovieir.github.io. Added an npm scriptgenerate:sitemapinpackage.json.robots.txtthat allows crawlers and references the generated sitemap.js/layout-shared.jsto render a shared header and footer into pages, and migrated many pages underpages/(and added small redirect stubs) to keep canonical URLs consistent.resolvePoster(...),getCachedImage(...), and API-key switcher integration where available; used a proxied TMDB fetch helperproxify(...)to avoid CORS in the client.Testing
node --check script.js,node --check search/search.js, andnode --check scripts/generate-sitemap.mjs— all passed.npm run generate:sitemapin the environment; TMDB was unreachable in CI, but the generator gracefully fell back and produced a validsitemap.xmlcontaining the site domainhttps://freemovieir.github.io/and the configured static paths (success with static fallback).python -m http.server 4173) and captured a Playwright screenshot of the homepage AJAX search flow to validate the inline search UI (screenshot artifact created successfully).robots.txtandsitemap.xmlfiles were added and contain the site domain reference for crawler discovery.Codex Task