2. Add your New Page to the Navigation
To navigate to your new "About Me" page, a link to it must be included in the navigation bar. Links for the navigation are edited in the pages.json
file in the pages
folder.
To add a link to the "About Me" page:
- Open the
pages.json
file. - Find the last list item- currently
"template-page": []
- and add a comma to the end of the line, so that it reads "template-page": [],
. Then press return to make a new line. - Type in
"about-me": []
in the new line.Make sure the the string in quotes matches the file name of the page you're linking to. In this demo, the file for the "About Me" page is called about-me.js
.
Once you save your work, a new "About Me" link will pop up in the navigation!
- Commas matter here! If you are adding to the middle of the list, end your new line with a comma. If you are adding to the end of the list, the last list item should not end with a comma. When you encounter errors adding to the
pages
folder, check comma placement first. - You can nest navigation links, so that a parent link opens up below a list of child links inside the navigation bar. You will need a folder inside the
pages
folder with the same name as the "parent" link, with the pages of the "children" links inside. To add this to the navigation:- Use the above instructions to add a line to the
pages.json
file for the parent folder name. - Add the file names of the "children" links into the brackets. Separate multiple file with commas.
- Save your work. If errors occur, check your commas in the file (detailed above).