Search code examples
htmlgitgithubgithub-pages

Inserting index.html file into Github Repository


I've created a very simple website in a Codecademy exercise that I'd like to upload to the Internet using Github Pages. Because you are unable to export your index.html and main.css files from Codecademy, I copy and pasted them into a word document, with the intent to get them in their proper file formats. However, I have been unable to find a source to convert these plain text files to .html and .css formats. Also, I've created an account on Github and a new repository, but the tutorial doesn't cover how to insert these two files into this repository.

How do I convert code from text in a document to .html and .css file format, and then insert these files into a Github repository? Thanks!


Solution

  • You don't need any special tools to convert plain text files to html or css. You simply do it yourself as well.

    Follow the steps to change .txt files to .html or .css:

    1. Right-click on your index.txt or main.txt

    enter image description here

    1. Click on Rename from the list of options shown

    enter image description here

    1. Then it will take you to editing the file name

    enter image description here

    1. Navigate the cursor and delete txt

    enter image description here

    1. Type html in txt's place

    enter image description here

    1. Press Enter

    1. Then you might receive a prompt asking if you are sure. Click on Yes/use .html whichever is appropriate for your prompt.

    enter image description here

    1. Voila! you have your file extension changed

    enter image description here

    Follow a similar approach to change the files to css as well

    *Please note that my screenshots are from Mac OS and may look different from yours depending on the Operating system you are using


    Hosting Webpages on Github:

    1. Github pages website gives you a step by step guide with visual illustrations on how to do it.
    2. If you are looking for a more comprehensive guide, then please refer to this page.