Skip to content

Project Organization & Asset Cleanup#18

Open
OmarAglan wants to merge 4 commits intohouselearning:mainfrom
OmarAglan:Files-Organization
Open

Project Organization & Asset Cleanup#18
OmarAglan wants to merge 4 commits intohouselearning:mainfrom
OmarAglan:Files-Organization

Conversation

@OmarAglan
Copy link
Contributor

Overview

This PR focuses on decluttering the project root and improving maintainability by organizing assets (CSS, JavaScript, Images) into a structured /assets/ directory. All references have been updated to use root-relative paths, ensuring the site remains fully functional across all pages.

Key Changes

  • Directory Restructuring:
    • Created /assets/, /assets/css/, /assets/js/, and /assets/images/favicons/.
    • Moved style.css to /assets/css/.
    • Moved all script files (nav.js, nav-xml-search.js, feedback.js, etc.) to /assets/js/.
    • Organized all favicons and the web manifest into /assets/images/favicons/.
  • Reference Modernization:
    • Replaced all legacy relative paths (e.g., ../style.css) with robust root-relative paths (e.g., /assets/css/style.css).
    • Fixed hardcoded asset URLs in cookiebanner.js.
    • Updated site.webmanifest to reflect new icon locations.
  • Root Cleanup: Removed redundant files from the root directory to emphasize the core HTML landing pages.

Impact

  • Zero Deployment Impact: Public URLs like https://houselearning.org/about remain unchanged.
  • Improved DX: Developers can easily find logic, styles, and assets in their respective folders.
  • Performance: Removed redundant legacy tags that were causing 404 console errors.

Move search styling out of JS into style.css and add richer UI/UX for the nav XML search. Introduces a formatUrlToTitle helper to produce human-friendly titles from URLs, shortens displayed URLs, increases result limit, trims input, shows a "no results" message, and closes results on Escape. Updates markup to include a search icon wrapper and updates styles (nav-xml-search, search-wrapper, nav-xml-results, item styling). Also adjusts header padding and gap in style.css.
Group navigation links and actions into .nav-links and .nav-actions in the header, rename "View on GitHub" to "GitHub", and adjust nav markup spacing. Update nav-xml-search.js to initialize the search on .nav-actions instead of the entire nav. Revise CSS for nav layout, gaps, alignment, button sizing, hover states, and nav-search dimensions, plus responsive/mobile tweaks to improve spacing and behavior.
Handle both .htm and .html suffixes when normalizing paths and replace unsafe innerHTML usage in search results with explicit DOM creation. The changes create a dedicated no-results element (clearing previous content first), build result anchor content using span elements with textContent (prevents HTML injection), and only set a.href for http(s) or root-relative URLs. Overall this improves correctness and reduces XSS risk in the search UI.
Reorganize static files into an assets/ hierarchy and update HTML references accordingly. CSS, JS and image files (favicons, manifests, images) were renamed/moved under assets/{css,js,images}. Added a new assets/js/cookiebanner.js (removed the root-level cookiebanner.js) and updated site.webmanifest paths. Updated pages (index, about, 404, partners, meta/*.html, dashboard, error, privacy, tos, sitemap, etc.) to use the new asset paths and include favicon/manifest links; minor markup/whitespace cleanups and content formatting adjustments.
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the project's file structure by centralizing all static assets into a dedicated /assets/ directory. This change aims to enhance the project's organization, making it easier for developers to locate and manage different types of files. The update also includes the introduction of a new navigation search feature and various styling improvements, all while ensuring no disruption to public-facing URLs.

Highlights

  • Directory Restructuring: Assets including CSS, JavaScript, and images (favicons) have been moved into a new, structured /assets/ directory to improve project organization and maintainability.
  • Reference Modernization: All asset references across HTML files have been updated to use root-relative paths, ensuring consistency and functionality after the directory changes. Hardcoded URLs in cookiebanner.js and icon locations in site.webmanifest were also fixed.
  • Root Cleanup: Redundant files have been removed from the root directory, streamlining the project structure and emphasizing core HTML landing pages.
  • New Navigation Search Functionality: A new nav-xml-search.js script was added to implement an XML-based search feature within the navigation, enhancing site usability.
  • CSS Enhancements: The main stylesheet (style.css) received updates to header padding, navigation layout, button styling, and new styles for the XML search feature, along with responsive adjustments.
Changelog
  • 404.html
    • Updated script and stylesheet paths to reflect the new /assets/ directory structure.
    • Added a favicon link to the head section.
    • Adjusted newline at the end of the file.
  • about.html
    • Updated script and stylesheet paths to reflect the new /assets/ directory structure.
    • Added a favicon link to the head section.
    • Adjusted HTML formatting for readability.
    • Adjusted newline at the end of the file.
  • also.js
    • Renamed to assets/js/also.js.
  • assets/js/cookiebanner.js
    • Added new file for cookie banner functionality, including consent management, modal, and footer generation.
    • Integrated Google Analytics loading based on user consent.
  • assets/js/nav-xml-search.js
    • Added new file implementing XML-based search functionality for the navigation bar.
    • Includes URL formatting logic to display user-friendly titles for search results.
  • cookiebanner.js
    • Removed file, replaced by assets/js/cookiebanner.js.
  • favicon.svg
    • Renamed to assets/images/favicons/favicon.svg.
  • feedback.js
    • Renamed to assets/js/feedback.js.
  • index.html
    • Updated script and stylesheet paths to reference files in the new /assets/ directory.
    • Added multiple favicon and web manifest links for comprehensive favicon support.
    • Restructured the navigation HTML to include .nav-links and .nav-actions divs for improved layout and search integration.
    • Adjusted formatting for featured learning paths and intro to programming sections.
    • Adjusted newline at the end of the file.
  • meta/dashboard.html
    • Updated stylesheet and script paths to use the new /assets/ structure.
    • Adjusted button text formatting.
    • Reformatted Firebase SDK import statements for better readability.
    • Adjusted newline at the end of the file.
  • meta/error.html
    • Updated script and stylesheet paths to use the new /assets/ structure.
    • Adjusted meta description and keywords formatting.
    • Formatted the contact support link for readability.
    • Adjusted newline at the end of the file.
  • nav-xml-search.js
    • Removed file, replaced by assets/js/nav-xml-search.js.
  • nav.js
    • Renamed to assets/js/nav.js.
  • partners.html
    • Updated script and stylesheet paths to reflect the new /assets/ directory structure.
    • Added a favicon link to the head section.
    • Adjusted HTML formatting for readability.
    • Adjusted newline at the end of the file.
  • privacy.html
    • Updated script and stylesheet paths to reflect the new /assets/ directory structure.
    • Added a favicon link to the head section.
    • Adjusted newline at the end of the file.
  • site.webmanifest
    • Renamed to assets/images/favicons/site.webmanifest.
    • Updated src paths for icons to the new /assets/images/favicons/ location.
  • sitemap.html
    • Updated script paths to reflect the new /assets/js/ directory structure.
    • Adjusted HTML formatting and indentation for various sitemap entries.
    • Adjusted newline at the end of the file.
  • style.css
    • Renamed to assets/css/style.css.
    • Updated header padding and added a gap property.
    • Refactored navigation (nav) styles to include .nav-links and .nav-actions for better organization and responsiveness.
    • Adjusted button (.button) padding, height, font size, and added white-space: nowrap and flex-shrink: 0.
    • Modified .btn-ghost hover effect and border color.
    • Added extensive new CSS rules for .nav-xml-search, .search-wrapper, .search-icon, .nav-xml-search input, and .nav-xml-results to support the new search functionality.
    • Updated responsive styles for footer content and navigation links/actions.
  • tos.html
    • Updated script and stylesheet paths to reflect the new /assets/ directory structure.
    • Added a favicon link to the head section.
    • Adjusted newline at the end of the file.
Activity
  • No human activity (comments, reviews) was recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively reorganizes the project's assets into a structured /assets/ directory and updates all references to use root-relative paths, which is a great improvement for maintainability. My review includes a critical security finding regarding a hardcoded API key that needs to be addressed, along with a suggestion to modernize some JavaScript code.

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