{"id":41,"date":"2026-01-10T17:16:04","date_gmt":"2026-01-10T22:16:04","guid":{"rendered":"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/chapter\/using-github-as-a-web-server\/"},"modified":"2026-01-18T17:07:04","modified_gmt":"2026-01-18T22:07:04","slug":"using-github-as-a-web-server","status":"publish","type":"chapter","link":"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/chapter\/using-github-as-a-web-server\/","title":{"raw":"Chapter 2 \u2022 GitHub as a Web Server","rendered":"Chapter 2 \u2022 GitHub as a Web Server"},"content":{"raw":"<h2>What is GitHub?<\/h2>\r\n<div id=\"github\">\r\n\r\n&nbsp;\r\n\r\n[caption id=\"attachment_73\" align=\"alignleft\" width=\"150\" class=\"align left \"]<a href=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GitHub_Invertocat_Logo.png\"><img src=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GitHub_Invertocat_Logo-150x150.png\" alt=\"\" width=\"150\" height=\"150\" class=\"wp-image-73 size-thumbnail\" \/><\/a> Github logo[\/caption]\r\n\r\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/Git\">GitHub<\/a>, owned by Microsoft, is a free platform that allows software developers (including web designers) to create, manage, distribute, and share code. GitHub is a great way to publish web pages. The intricacies of adding, displaying, and deleting files do take getting used to, which is the reason for this chapter. The site allows a maximum file size of 25MB so be careful of large image and especially large video files.\r\n\r\n<\/div>\r\n<div>\r\n\r\nGithub is not confidential. Anyone who knows your username can see your files because the point of the platform is to share information.\r\n<div style=\"width: 768px;margin: 24px auto;border: 1px solid darkgray;padding: 0 24px 24px 12px;background: whitesmoke\">\r\n<h2 style=\"text-align: center\">Reminder: Your Login and Your URL Are Different<\/h2>\r\nLogin for you to upload files (do not submit):\r\n<b>https:\/\/github.com\/youruserid<\/b>\r\n\r\nURL to see your files on the web (submit this):\r\n<b>http:\/\/youruserid.github.io\/repositoryname\/<\/b>\r\nThe first file should be named \u201cindex.html\u201d (lowecase \u201ci\u201d) to load automatically. You must \"deploy\" your repository for it to be visible on the web.\r\n\r\n<\/div>\r\n<h2>Making a Github Repository<\/h2>\r\n<ol>\r\n \t<li>Go to <a href=\"https:\/\/github.com\" target=\"_blank\" rel=\"noopener\">github.com<\/a>, create an account, and log in.<\/li>\r\n \t<li>In your Dashboard, click \u201cCreate repository\u201c (Figure 2-1 below). This will be the folder for your HTML files.<\/li>\r\n \t<li>The URL for a file named \u201cindex.html\u201d will be: username.github.io\/repository\/index.html.<\/li>\r\n \t<li>In the respository, click Add file &gt; Upload Files, then drag-and-drop the files you want to upload into the window.<\/li>\r\n \t<li>At the bottom of the window, click \u201cCommit changes.\u201d<\/li>\r\n \t<li>To replace a file, re-upload the new file; it will replace the old file of the same name.<\/li>\r\n \t<li>To delete a file, click on the file, then the three dots at the top right of the window, and select \u201cDelete.\u201d<\/li>\r\n<\/ol>\r\n[caption id=\"\" align=\"aligncenter\" width=\"256\"]<a href=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GH-W_1_CreateRepository.jpg\"><img src=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GH-W_1_CreateRepository.jpg\" alt=\"image\" width=\"256\" height=\"526\" style=\"border: 1px solid darkgray;box-shadow: 2px 3px 6px darkgray\" \/><\/a> Figure 2-1. Making a new folder (\"repository\") on Github.[\/caption]\r\n<h2>Preparing Files for Upload<\/h2>\r\n<\/div>\r\n<div id=\"github-instr\">\r\n<ol>\r\n \t<li>Make a \u201cgold master\u201d folder on your desktop called \u201csite\u201d or some other name.<\/li>\r\n \t<li>Place your .html files and any linked css, image, video, font, or other files into this folder.<\/li>\r\n \t<li>I recommend using all lowercase letters and avoiding spaces in file names. Use \u201cindex.html\u201d for the home page, which will load automatically.<\/li>\r\n \t<li>Preflight the web pages by opening in a browser, checking for proper display, missing images, and broken or incorrect links.<\/li>\r\n \t<li>Select all the files and upload to your Github repository.<\/li>\r\n<\/ol>\r\n[caption id=\"\" align=\"aligncenter\" width=\"768\"]<a href=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GH-W_3_UploadFile.jpg\"><img src=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GH-W_3_UploadFile.jpg\" alt=\"image\" width=\"768\" height=\"auto\" style=\"border: 1px solid darkgray;box-shadow: 2px 3px 6px darkgray\" \/><\/a> Figure 2-3. Click \"Upload an existing file\" to add files to your repository by drag-and-drop.[\/caption]\r\n\r\n[caption id=\"\" align=\"aligncenter\" width=\"768\"]<a href=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GH-W_4_DragFiles.jpg\"><img src=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GH-W_4_DragFiles.jpg\" alt=\"image\" width=\"768\" height=\"auto\" style=\"border: 1px solid darkgray;box-shadow: 2px 3px 6px darkgray\" \/><\/a> Figure 2-4. Upload files by drag-and-drop.[\/caption]\r\n<h2>Setting File Visibility and Deleting<\/h2>\r\n<ol>\r\n \t<li>After uploading your files to a Repository, click the Settings button at the top, Pages at left, and scroll down to Select \"main\" as the deployment (Figure 2-5 below).<\/li>\r\n \t<li>To delete a file, click on the file. From the three dots at right, select Delete File (Figure 2-6 below).<\/li>\r\n \t<li>To delete a repository, go to the repository, select Settings, and scroll down to \"Danger Zone\" &gt; Delete this repository.<\/li>\r\n<\/ol>\r\n[caption id=\"\" align=\"aligncenter\" width=\"768\"]<a href=\"SF-W_GithubSettings.jpg\"><img src=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/SF-W_GithubSettings.jpg\" alt=\"image\" width=\"768\" height=\"auto\" style=\"border: 1px solid darkgray;box-shadow: 2px 3px 6px darkgray\" \/><\/a> Figure 2-5. To be visible on the web, your repository must be \"deployed\" through Settings &gt; Pages. Set deployment from the \"main\" branch and click \"Save\" to save settings.[\/caption]\r\n\r\n[caption id=\"\" align=\"aligncenter\" width=\"256\"]<a href=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GH-W_5_DeleteFile.jpg\"><img src=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GH-W_5_DeleteFile.jpg\" alt=\"image\" width=\"256\" height=\"auto\" style=\"border: 1px solid darkgray;box-shadow: 2px 3px 6px darkgray\" \/><\/a> Figure 2-6. To delete a file, click on the file. From the three dots at right, select Delete File.[\/caption]\r\n<table style=\"margin: 24px auto;background: whitesmoke\">\r\n<tbody>\r\n<tr>\r\n<td colspan=\"2\"><strong>Quick-Reference Guide to Github<\/strong><\/td>\r\n<\/tr>\r\n<tr>\r\n<td><em>Task<\/em><\/td>\r\n<td><em>Path<\/em><\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Create Repository (Folder)<\/td>\r\n<td>Home &gt; Repositories &gt; New<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Delete Repository<\/td>\r\n<td>Click on repository &gt; Settings &gt; Delete this repository<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Rename Repository<\/td>\r\n<td>Repository &gt; Settings &gt; Rename<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Make Repository Viewable<\/td>\r\n<td>Repository &gt; Pages &gt; Source &gt; Deploy from a branch &gt; Main<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Add Files to Repository<\/td>\r\n<td>Repository &gt; Add File<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>URL for your files<\/td>\r\n<td>github.com\/[userid]\/[repository-name]<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>URL for your page<\/td>\r\n<td>[userid].github.io\/[repository-name]<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/div>","rendered":"<h2>What is GitHub?<\/h2>\n<div id=\"github\">\n<p>&nbsp;<\/p>\n<figure id=\"attachment_73\" aria-describedby=\"caption-attachment-73\" style=\"width: 150px\" class=\"wp-caption alignleft align left\"><a href=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GitHub_Invertocat_Logo.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GitHub_Invertocat_Logo-150x150.png\" alt=\"\" width=\"150\" height=\"150\" class=\"wp-image-73 size-thumbnail\" srcset=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GitHub_Invertocat_Logo-150x150.png 150w, https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GitHub_Invertocat_Logo-300x300.png 300w, https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GitHub_Invertocat_Logo-65x65.png 65w, https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GitHub_Invertocat_Logo-225x225.png 225w, https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GitHub_Invertocat_Logo.png 330w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/><\/a><figcaption id=\"caption-attachment-73\" class=\"wp-caption-text\">Github logo<\/figcaption><\/figure>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Git\">GitHub<\/a>, owned by Microsoft, is a free platform that allows software developers (including web designers) to create, manage, distribute, and share code. GitHub is a great way to publish web pages. The intricacies of adding, displaying, and deleting files do take getting used to, which is the reason for this chapter. The site allows a maximum file size of 25MB so be careful of large image and especially large video files.<\/p>\n<\/div>\n<div>\n<p>Github is not confidential. Anyone who knows your username can see your files because the point of the platform is to share information.<\/p>\n<div style=\"width: 768px;margin: 24px auto;border: 1px solid darkgray;padding: 0 24px 24px 12px;background: whitesmoke\">\n<h2 style=\"text-align: center\">Reminder: Your Login and Your URL Are Different<\/h2>\n<p>Login for you to upload files (do not submit):<br \/>\n<b>https:\/\/github.com\/youruserid<\/b><\/p>\n<p>URL to see your files on the web (submit this):<br \/>\n<b>http:\/\/youruserid.github.io\/repositoryname\/<\/b><br \/>\nThe first file should be named \u201cindex.html\u201d (lowecase \u201ci\u201d) to load automatically. You must &#8220;deploy&#8221; your repository for it to be visible on the web.<\/p>\n<\/div>\n<h2>Making a Github Repository<\/h2>\n<ol>\n<li>Go to <a href=\"https:\/\/github.com\" target=\"_blank\" rel=\"noopener\">github.com<\/a>, create an account, and log in.<\/li>\n<li>In your Dashboard, click \u201cCreate repository\u201c (Figure 2-1 below). This will be the folder for your HTML files.<\/li>\n<li>The URL for a file named \u201cindex.html\u201d will be: username.github.io\/repository\/index.html.<\/li>\n<li>In the respository, click Add file &gt; Upload Files, then drag-and-drop the files you want to upload into the window.<\/li>\n<li>At the bottom of the window, click \u201cCommit changes.\u201d<\/li>\n<li>To replace a file, re-upload the new file; it will replace the old file of the same name.<\/li>\n<li>To delete a file, click on the file, then the three dots at the top right of the window, and select \u201cDelete.\u201d<\/li>\n<\/ol>\n<figure style=\"width: 256px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GH-W_1_CreateRepository.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GH-W_1_CreateRepository.jpg\" alt=\"image\" width=\"256\" height=\"526\" style=\"border: 1px solid darkgray;box-shadow: 2px 3px 6px darkgray\" \/><\/a><figcaption class=\"wp-caption-text\">Figure 2-1. Making a new folder (&#8220;repository&#8221;) on Github.<\/figcaption><\/figure>\n<h2>Preparing Files for Upload<\/h2>\n<\/div>\n<div id=\"github-instr\">\n<ol>\n<li>Make a \u201cgold master\u201d folder on your desktop called \u201csite\u201d or some other name.<\/li>\n<li>Place your .html files and any linked css, image, video, font, or other files into this folder.<\/li>\n<li>I recommend using all lowercase letters and avoiding spaces in file names. Use \u201cindex.html\u201d for the home page, which will load automatically.<\/li>\n<li>Preflight the web pages by opening in a browser, checking for proper display, missing images, and broken or incorrect links.<\/li>\n<li>Select all the files and upload to your Github repository.<\/li>\n<\/ol>\n<figure style=\"width: 768px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GH-W_3_UploadFile.jpg\"><img decoding=\"async\" src=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GH-W_3_UploadFile.jpg\" alt=\"image\" width=\"768\" height=\"auto\" style=\"border: 1px solid darkgray;box-shadow: 2px 3px 6px darkgray\" \/><\/a><figcaption class=\"wp-caption-text\">Figure 2-3. Click &#8220;Upload an existing file&#8221; to add files to your repository by drag-and-drop.<\/figcaption><\/figure>\n<figure style=\"width: 768px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GH-W_4_DragFiles.jpg\"><img decoding=\"async\" src=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GH-W_4_DragFiles.jpg\" alt=\"image\" width=\"768\" height=\"auto\" style=\"border: 1px solid darkgray;box-shadow: 2px 3px 6px darkgray\" \/><\/a><figcaption class=\"wp-caption-text\">Figure 2-4. Upload files by drag-and-drop.<\/figcaption><\/figure>\n<h2>Setting File Visibility and Deleting<\/h2>\n<ol>\n<li>After uploading your files to a Repository, click the Settings button at the top, Pages at left, and scroll down to Select &#8220;main&#8221; as the deployment (Figure 2-5 below).<\/li>\n<li>To delete a file, click on the file. From the three dots at right, select Delete File (Figure 2-6 below).<\/li>\n<li>To delete a repository, go to the repository, select Settings, and scroll down to &#8220;Danger Zone&#8221; &gt; Delete this repository.<\/li>\n<\/ol>\n<figure style=\"width: 768px\" class=\"wp-caption aligncenter\"><a href=\"SF-W_GithubSettings.jpg\"><img decoding=\"async\" src=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/SF-W_GithubSettings.jpg\" alt=\"image\" width=\"768\" height=\"auto\" style=\"border: 1px solid darkgray;box-shadow: 2px 3px 6px darkgray\" \/><\/a><figcaption class=\"wp-caption-text\">Figure 2-5. To be visible on the web, your repository must be &#8220;deployed&#8221; through Settings &gt; Pages. Set deployment from the &#8220;main&#8221; branch and click &#8220;Save&#8221; to save settings.<\/figcaption><\/figure>\n<figure style=\"width: 256px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GH-W_5_DeleteFile.jpg\"><img decoding=\"async\" src=\"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-content\/uploads\/sites\/449\/2026\/01\/GH-W_5_DeleteFile.jpg\" alt=\"image\" width=\"256\" height=\"auto\" style=\"border: 1px solid darkgray;box-shadow: 2px 3px 6px darkgray\" \/><\/a><figcaption class=\"wp-caption-text\">Figure 2-6. To delete a file, click on the file. From the three dots at right, select Delete File.<\/figcaption><\/figure>\n<table style=\"margin: 24px auto;background: whitesmoke\">\n<tbody>\n<tr>\n<td colspan=\"2\"><strong>Quick-Reference Guide to Github<\/strong><\/td>\n<\/tr>\n<tr>\n<td><em>Task<\/em><\/td>\n<td><em>Path<\/em><\/td>\n<\/tr>\n<tr>\n<td>Create Repository (Folder)<\/td>\n<td>Home &gt; Repositories &gt; New<\/td>\n<\/tr>\n<tr>\n<td>Delete Repository<\/td>\n<td>Click on repository &gt; Settings &gt; Delete this repository<\/td>\n<\/tr>\n<tr>\n<td>Rename Repository<\/td>\n<td>Repository &gt; Settings &gt; Rename<\/td>\n<\/tr>\n<tr>\n<td>Make Repository Viewable<\/td>\n<td>Repository &gt; Pages &gt; Source &gt; Deploy from a branch &gt; Main<\/td>\n<\/tr>\n<tr>\n<td>Add Files to Repository<\/td>\n<td>Repository &gt; Add File<\/td>\n<\/tr>\n<tr>\n<td>URL for your files<\/td>\n<td>github.com\/[userid]\/[repository-name]<\/td>\n<\/tr>\n<tr>\n<td>URL for your page<\/td>\n<td>[userid].github.io\/[repository-name]<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"author":6,"menu_order":2,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-41","chapter","type-chapter","status-publish","hentry"],"part":3,"_links":{"self":[{"href":"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-json\/pressbooks\/v2\/chapters\/41","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-json\/wp\/v2\/users\/6"}],"version-history":[{"count":19,"href":"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-json\/pressbooks\/v2\/chapters\/41\/revisions"}],"predecessor-version":[{"id":72,"href":"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-json\/pressbooks\/v2\/chapters\/41\/revisions\/72"}],"part":[{"href":"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-json\/pressbooks\/v2\/parts\/3"}],"metadata":[{"href":"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-json\/pressbooks\/v2\/chapters\/41\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-json\/wp\/v2\/media?parent=41"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-json\/pressbooks\/v2\/chapter-type?post=41"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-json\/wp\/v2\/contributor?post=41"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/pressbooks.library.torontomu.ca\/webdesign2\/wp-json\/wp\/v2\/license?post=41"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}