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 draftwebsite
You 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:1313
or whatever number you get from the previous step. The website draft should appear. -
Click on
Lab Links
on 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 Page
and 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.md
and the folder you just created in/media/shareX/Website/content/test-password
and - Edit the
index.md
to reflect the content of the page
- In the folder you would like to place the page, copy over file