codemetropolis / CodeMetropolis

See your software as never before.
http://codemetropolis.github.io/CodeMetropolis/
14 stars 30 forks source link

381-fix-the-css-of-the-projects-github-page #382

Closed R3tes closed 1 month ago

R3tes commented 1 month ago

Problem:

After merging a branch containing updates for Java versions from 1.8 to 22 into the homepage branch, the CodeMetropolis projects webpage appeared broken, as previously documented. The issue seems to be related to MkDocs CSS and JS scripts not loading correctly.

Solution:

  1. Update mkdocs.yml:

    • Added the site_url variable to mkdocs.yml with the actual link for the GitHub page: https://codemetropolis.github.io/CodeMetropolis/.
    • This update should resolve the issue with accessing the CSS and JS paths, ensuring they are correctly referenced and loaded.
    
    site_url: https://codemetropolis.github.io/CodeMetropolis/
    
    ![image](https://github.com/codemetropolis/CodeMetropolis/assets/100042127/1a7d376e-d7b3-40f6-ae0f-7dc95270dc72)
  2. Add .gitignore:

    • Added a .gitignore file to this branch to filter out non-GitHub Pages related directories. This prevents unnecessary files and directories from being tracked when developers switch between different branches.
  3. Build and Test:

    • Built the site with MkDocs and confirmed that it works fine on localhost.
    • These changes should ensure the site appears correctly on the live version after merging into the homepage branch.

Conclusion:

These changes should resolve the issue with the broken webpage by ensuring proper paths for CSS and JS files. The addition of a .gitignore file also improves the project's maintainability by excluding irrelevant files from being tracked.