search

Home  >  Q&A  >  body text

GitHub Pages only supports readme file rendering

<p>This is my repository: <a href="https://github.com/kalrasarthak/ReFash">https://github.com/kalrasarthak/ReFash</a></p> ; <p>This is the page link:</p> <p><a href="https://kalrasarthak.github.io/ReFash/">https://kalrasarthak.github.io/ReFash/</a></p> <p>I tried the solutions provided here, but those are no longer the same. </p> <p>How do I fix an issue where my website hosted on GitHub Pages only displays the README page? </p>
P粉262113569P粉262113569468 days ago465

reply all(2)I'll reply

  • P粉282627613

    P粉2826276132023-08-16 11:05:40

    To resolve an issue where a website hosted on GitHub Pages only displays the README page, follow these steps:

    1. Verify branches: Make sure the branches you want to display on GitHub Pages are set up correctly. By default, GitHub Pages deploys content from the gh-pages branch or the master branch in the repository. If you want to use a different branch, you need to specify this in the repository settings.

    2. Check directory structure: Make sure your website files are in the correct directory. In most cases, you will need to place HTML, CSS, and other resources in the root folder of the repository.

    3. Confirm the index file: GitHub Pages looks for the index.html file by default. Make sure your homepage file is named index.html. If named differently, the files can be specified in the repository settings.

    4. Update repository settings: Go to your repository's Settings tab and scroll down to the GitHub Pages section. Make sure you choose the correct source. You can select a branch or root folder to use for hosting.

    5. If it is a React.js application, please use the Github operation of React.js. Other frameworks such as Angular, Gatsby, and Next.js are similar. You can't use simple operations with applications from frameworks like React.js.

    6. Verify DNS settings (if applicable): If you are using a custom domain name, check the DNS settings to ensure they are configured correctly

    reply
    0
  • P粉736935587

    P粉7369355872023-08-16 09:13:37

    This is expected behavior, according to the GitHub Pages documentation :

    You need to provide an index.html or index.md file in the top-level directory (not inside the directory!), or put your content into README.md middle.

    reply
    0
  • Cancelreply