Well, here we are. Migration purely for new content fun.
# generate pagefind index first
hugo && npm_config_yes=true npx pagefind --source "public"
# run local server
hugo server --buildDrafts --disableFastRender
Not in use any more
-
Install Browser Preview (
auchenberg.vscode-browser-preview
) -
Install Chrome: (Credit: How to install Chrome browser properly via command line? - Ask Ubuntu)
cd .. pwd # /workspaces sudo apt-get install libxss1 libappindicator1 libindicator7 wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo apt install ./google-chrome*.deb
-
Configure the extension with:
"browser-preview.chromeExecutable": "/usr/bin/google-chrome", "browser-preview.ignoreHttpsErrors": true, "browser-preview.startUrl": "localhost:1818",
-
Run Hugo server with fixed port: (all options)
hugo server --buildDrafts --port 1818 --baseURL "https://loikein-blog-hugo-w8cj-1818.githubpreview.dev/"
-
Access
https://loikein-blog-hugo-w8cj-1818.githubpreview.dev/
once to log into GitHub. -
Then can access:
localhost:1818
directly from the Browser Preview, orhttps://loikein-blog-hugo-w8cj-1818.githubpreview.dev/
from iPad, etc.
-
Notice that any draft (only exists on local machine) will not show up.