Instructions for password-protecting a page
Last Updated 2019-05-09 by Adam Lu
-
Connect to the server fishfish via a graphical desktop (either VNC or X2Go).
-
Open a terminal:
-
Navigate to
/media/shareX/Website/ -
Start a draft version of the website locally by typing one of the following commands:
# -D means "include drafts" hugo -D server # This is an alias for the above command draftwebsiteYou should see an output like this:
Web Server is available at //localhost:1313/
-
-
Open a Web browser (either Firefox or the Web Browser icon on the bottom):
-
Type in
localhost:1313or whatever number you get from the previous step. The website draft should appear. -
Click on
Lab Linkson the top menu bar. -
Under
For Website Building, click onPassword Test Page. -
Enter the password you would like to use and hit
Enter. You should seewrong password
which is normal behavior.
-
Copy the number after the hash (#) in the site address and make a folder named by that number under
/media/shareX/Website/content/test-password. -
Copy over the file
index.md(this page prints out a success string) from other similarly named folders and modify the content to reflect the new password. -
Go back to the
Password Test Pageand enter your password. The success page should show up now.
-
-
Finally, create the page:
- In the folder you would like to place the page, copy over file
_index.mdand the folder you just created in/media/shareX/Website/content/test-passwordand - Edit the
index.mdto reflect the content of the page
- In the folder you would like to place the page, copy over file