{"id":639,"date":"2020-01-02T18:53:21","date_gmt":"2020-01-02T23:53:21","guid":{"rendered":"http:\/\/newmediaproduction.mynmi.net\/?page_id=639"},"modified":"2025-08-12T20:17:08","modified_gmt":"2025-08-12T20:17:08","slug":"indexes-and-directories","status":"publish","type":"page","link":"https:\/\/nmi.cool\/webdev\/indexes-and-directories\/","title":{"rendered":"Homepages and Course File Structure"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2022\/01\/file-cabinet-drawer.jpeg\" alt=\"File drawer opened to reveal neatly organized, off white files.\" \/><figcaption class=\"wp-element-caption\">Photo by <a href=\"https:\/\/unsplash.com\/@qwitka\">Maksym Kaharlytskyi<\/a>.<\/figcaption><\/figure>\n\n\n\n<p>It\u2019s time to expand your files and folder knowledge and learn more about <strong>index files<\/strong> and the <strong>file structure we&#8217;ll be using for this class<\/strong>. You&#8217;ll also create your website&#8217;s homepage.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Homepages<\/h2>\n\n\n\n<p>Homepages operate a little bit differently than other files.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Homepage at the root directory<\/h4>\n\n\n\n<p>If we place a file called <strong>index.html<\/strong> in public_html, index.html would become the <strong>homepage<\/strong> of our website. <\/p>\n\n\n\n<p>Meaning, that if you type in your domain, such as yourname.com, what you&#8217;re actually viewing is that person&#8217;s index file, located in the public_html folder of their server. <strong>Indexes are home pages.<\/strong><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Homepages in folders<\/h4>\n\n\n\n<figure class=\"wp-block-image size-large is-style-rounded is-style-rounded--1\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"310\" src=\"https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-1.46.59\u202fPM-1024x310.png\" alt=\"\" class=\"wp-image-6025\" srcset=\"https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-1.46.59\u202fPM-1024x310.png 1024w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-1.46.59\u202fPM-300x91.png 300w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-1.46.59\u202fPM-768x232.png 768w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-1.46.59\u202fPM.png 1514w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>You can create <em>other<\/em> homepages by placing index files in folders. For example, if you created <strong>index.html,<\/strong> placed it in the webdev folder, and navigated to yoursite.com\/webdev, you&#8217;d see <em><strong>that<\/strong><\/em> index.html.<\/p>\n\n\n\n<p>Essentially, you can have more than one homepage. Rather than the webdev homepage being at the root directory of our site, it would live in a subdirectory\u2014the webdev subdirectory!<\/p>\n\n\n\n<p><strong>Subdirectory: <\/strong>a directory (fancy word for folder) located within the root directory.<\/p>\n\n\n\n<p>TL;DR: indexes are home pages, and you can have more than one!<\/p>\n\n\n\n<p>Still confused? Read more about <a href=\"https:\/\/techterms.com\/definition\/subdirectory\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"directories and subdirectories (opens in a new tab)\">directories and subdirectories<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Every other webpage<\/h2>\n\n\n\n<p>Most web pages we create for this class won&#8217;t be index files. If we wanted to view in the browser a file that is <strong>not <\/strong>an index file, we would type in the file path followed by the file extension.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"173\" src=\"https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-1.49.33\u202fPM-1024x173.png\" alt=\"\" class=\"wp-image-6029\" srcset=\"https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-1.49.33\u202fPM-1024x173.png 1024w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-1.49.33\u202fPM-300x51.png 300w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-1.49.33\u202fPM-768x130.png 768w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-1.49.33\u202fPM-1536x260.png 1536w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-1.49.33\u202fPM.png 2008w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>To view project-one.html, which resides in two folders:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">www.yoursite.com\/webdev\/project-one\/project-one.html<\/pre>\n\n\n\n<p>This should sound familiar to the previous lesson on <a href=\"https:\/\/nmi.cool\/webdev\/files-and-folders\/\" data-type=\"page\" data-id=\"6114\" target=\"_blank\" rel=\"noreferrer noopener\">folders and file paths.<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"coursefilestructure\">Course File structure<\/h2>\n\n\n\n<p>Download the <a href=\"https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2023\/06\/webdev.zip\">file structure<\/a> for this course.<\/p>\n\n\n\n<p>Move the webdev folder into Dropbox, your flash drive, Google Drive for desktop, or the cloud\/hard drive of your choice. Just <strong>don&#8217;t save it locally<\/strong> (to your desktop). Why? You will have a designated (more secure) location (cloud, hard drive, flash drive) as your homebase for your files for this course. You will also create a backup that you update regularly. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"production-homepage\">Create webdev homepage<\/h2>\n\n\n\n<p>You likely already have an index.html file that exists in the webdev folder, but if you do not:<\/p>\n\n\n\n<p>Skip to <a href=\"https:\/\/nmi.cool\/webdev\/your-first-html-file\/\" data-type=\"page\" data-id=\"616\">this lesson<\/a> and create one in Visual Studio Code. Save it as index.html.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"homepage-root\">Create a homepage at the root directory (your NMI portfolio homepage)<\/h2>\n\n\n\n<p>Create a <strong>second<\/strong> index.html (perhaps by copying and pasting that first file?) and save it, but <strong>not <\/strong>in the webdev folder.<\/p>\n\n\n\n<p>This will become your website&#8217;s main homepage, which will appear when you navigate to yoursite.com. See the index located at the top level.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"312\" src=\"https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-1.47.26\u202fPM-1024x312.png\" alt=\"\" class=\"wp-image-6026\" srcset=\"https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-1.47.26\u202fPM-1024x312.png 1024w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-1.47.26\u202fPM-300x91.png 300w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-1.47.26\u202fPM-768x234.png 768w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2025\/05\/Screenshot-2025-05-14-at-1.47.26\u202fPM.png 1504w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Your folder structure should look like this. Notice there is an index.html file at both the root level and in the webdev folder.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"nmccontent\"><strong>Add content<\/strong> to your nmi portfolio home page<\/h2>\n\n\n\n<p>Wouldn\u2019t it be nice if the home page of your website said something like your name? Your major? Let\u2019s edit the index.html\u2014the one we just made.<\/p>\n\n\n\n<p>Add your name as title between your title tags. In the body of your page, add:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Name <\/li>\n\n\n\n<li>Major <\/li>\n\n\n\n<li>Year<\/li>\n\n\n\n<li>A fun fact about yourself<\/li>\n<\/ul>\n\n\n\n<p>Here\u2019s an example of the type of thrilling narrative to put on your homepage:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;  \n&lt;html lang=\"en\"&gt;  \n&lt;head&gt; \n    &lt;meta charset=\"UTF-8\"&gt;     \n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt; &nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp;\n    &lt;title&gt;<strong>Herbert Hoover<\/strong>&lt;\/title&gt; \n&lt;\/head&gt; \n&lt;body&gt;\n\n<strong>Herbert Hoover\nEngineering \n1895\nFun Fact: Before becoming the 31st President of the United States, I was a successful mining engineer and led major humanitarian efforts during and after World War I<\/strong>.\n\n&lt;\/body&gt; \n&lt;\/html&gt; <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"production-content\">Add content to your webdev homepage<\/h2>\n\n\n\n<p>Open the webdev index.html file with Visual Studio Code (File &gt; Open). Remember, this index.html is what appears when people go to yoursite.com\/nmc\/webdev.<\/p>\n\n\n\n<p>Go ahead and add the <a href=\"https:\/\/nmi.cool\/webdev\/html-boilerplate\/\" target=\"_blank\" rel=\"noreferrer noopener\">HTML boilerplate<\/a>, a title, again, and add some thrilling content in the &lt;body&gt;. Here&#8217;s what to add:<\/p>\n\n\n\n<p>If you don&#8217;t see the changes that you just made, double-check that you saved your file and that you&#8217;re trying to preview the correct file.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Your New Media Institute status:\n<ul class=\"wp-block-list\">\n<li>New Media Certificate student<\/li>\n\n\n\n<li>Emerging Media Masters graduate student<\/li>\n\n\n\n<li>Emerging Media Double Dawg<\/li>\n\n\n\n<li>Something else entirely?<\/li>\n\n\n\n<li>Just taking this class for fun?<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Add what you hope to get out of this course!<\/li>\n<\/ul>\n\n\n\n<p>Here&#8217;s an example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;body&gt; \nI am pursuing the New Media Institute's New Media Certificate, Emerging Media Masters, or just taking this class for fun.&nbsp;I love technology and I'm excited to spend an entire semester learning how to make websites!\n&lt;\/body&gt; <\/code><\/pre>\n\n\n\n<p>Eventually, as you move throughout the semester you&#8217;ll this page will also include links for all your projects and exercises as well as your project reflections. Right now, it&#8217;s totally fine if this page is VERY simple-looking\u2014 after all, we haven&#8217;t talked about how to make things look awesome yet! At some point, you may decide to add some CSS to this page, and that&#8217;s great, but isn&#8217;t required!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"preview\">Previewing files<\/h2>\n\n\n\n<p>Wouldn&#8217;t it be nice to see what this file would look like without all the HTML tags? <br><br>You can use Visual Studio Code&#8217;s HTML Preview extension to do this, but the extension is notoriously buggy and there&#8217;s an easy way to preview html files that will become second nature in no time!<\/p>\n\n\n\n<p>Simply make sure that your file is saved in Visual Studio Code. This step is important and an easy one to skip: use <em>\u2318 + S<\/em>&nbsp;on a Mac to save your file and Ctr + S if you&#8217;re on a PC. (Note: if you&#8217;re previewing multiple files, make sure to Save All!). Then, navigate to your finder window, right-click your file, and select &#8220;Open With&#8221; and &#8220;Chrome.&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"665\" src=\"https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2022\/06\/Screen-Shot-2022-06-12-at-11.47.06-AM-1024x665.png\" alt=\"\" class=\"wp-image-3659\" srcset=\"https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2022\/06\/Screen-Shot-2022-06-12-at-11.47.06-AM-1024x665.png 1024w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2022\/06\/Screen-Shot-2022-06-12-at-11.47.06-AM-300x195.png 300w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2022\/06\/Screen-Shot-2022-06-12-at-11.47.06-AM-768x499.png 768w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2022\/06\/Screen-Shot-2022-06-12-at-11.47.06-AM-1536x998.png 1536w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2022\/06\/Screen-Shot-2022-06-12-at-11.47.06-AM.png 1860w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">An easy, fail-proof way to preview your HTML files! <\/figcaption><\/figure>\n\n\n\n<p>You\u2019ll be previewing pretty much every file you will create in this class, so make note of those keyboard shortcuts. Previewing files in this fashion lets you see a copy of the local version of your file. If you want other people to be able to see this version, you&#8217;ll have to upload it to your server. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Upload<\/strong><\/h2>\n\n\n\n<p>FTP (another word for upload) both index files to the server. <\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Drag your website&#8217;s homepage, index.html, into the public_html folder.<\/li>\n\n\n\n<li>Drag your webdev folder into the public_html folder in Cyberduck. <br><br>Use the following as your guide:<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"247\" src=\"https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2023\/06\/Screenshot-2023-06-13-at-11.04.48-AM-1024x247.png\" alt=\"\" class=\"wp-image-4312\" srcset=\"https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2023\/06\/Screenshot-2023-06-13-at-11.04.48-AM-1024x247.png 1024w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2023\/06\/Screenshot-2023-06-13-at-11.04.48-AM-300x72.png 300w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2023\/06\/Screenshot-2023-06-13-at-11.04.48-AM-768x186.png 768w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2023\/06\/Screenshot-2023-06-13-at-11.04.48-AM-1536x371.png 1536w, https:\/\/nmi.cool\/webdev\/wp-content\/uploads\/sites\/14\/2023\/06\/Screenshot-2023-06-13-at-11.04.48-AM-2048x495.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Note that you have an index.html file at the root of your directory (above the webdev folder) and inside your webdev folder.<\/figcaption><\/figure>\n\n\n\n<p>Congratulations! You just uploaded something to the server for the first time. Test is out at yourdomain.com! (Note: <a href=\"https:\/\/nmi.cool\/webdev\/uploading-to-server\/\" data-type=\"page\" data-id=\"609\">troubleshooting options here<\/a>)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Storage and the server: twins, not sisters<\/h2>\n\n\n\n<p>Your folder and file structure in storage (flash drive, cloud, hard drive, etc.) will mirror what you see on the server. It\u2019s very important for your sanity and mine that these two remain identical. Do not go rogue and start saving files locally (ie, somewhere on your personal computer, on the lab computers, you get the idea).<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It\u2019s time to expand your files and folder knowledge and learn more about index files and the file structure we&#8217;ll be using for this class. You&#8217;ll also create your website&#8217;s homepage. Homepages Homepages operate a little bit differently than other files. Homepage at the root directory If we place a file called index.html in public_html, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-639","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/nmi.cool\/webdev\/wp-json\/wp\/v2\/pages\/639","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nmi.cool\/webdev\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/nmi.cool\/webdev\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/nmi.cool\/webdev\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nmi.cool\/webdev\/wp-json\/wp\/v2\/comments?post=639"}],"version-history":[{"count":19,"href":"https:\/\/nmi.cool\/webdev\/wp-json\/wp\/v2\/pages\/639\/revisions"}],"predecessor-version":[{"id":6219,"href":"https:\/\/nmi.cool\/webdev\/wp-json\/wp\/v2\/pages\/639\/revisions\/6219"}],"wp:attachment":[{"href":"https:\/\/nmi.cool\/webdev\/wp-json\/wp\/v2\/media?parent=639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}