How to set up environment to edit memo
Set up SSH key
SSH key is a secure authentication method which includes a public key and a private key.
- The public key is shared with others (like GitHub), while the private key is kept secret on your Mac.
- When you connect to a server (like GitHub) using SSH, the server verifies your identity by comparing a fingerprint derived from your public key with the key it has on record.
During SSH authentication, the server you’re connecting to (like GitHub) checks the fingerprint of your public key against the one it has on record. If they match, and you provide the correct passphrase to unlock your private key (if you set one), the connection is established securely.
To generate your SSH key, please follow this instruction. The process including 3 steps:
- Create ssh key pair (public, private)
- Save private key to your computer
- Submit public key to github
Install the Visual Studio Code
Firstly, you have to install Visual Studio Code, here
Install the Devbox
- Open the Terminal on VScode
You can use the shortcut
Control + ~
to open Terminal.
Then run this command in the Terminal to install Devbox: curl -fsSL https://get.jetpack.io/devbox | bash
.
Pull the Github Source to your local disk
You have 2 ways to pull the Github source to the local disk:
Method 1: Use the terminal
- Run the
xcode-select
command:
xcode-select
- Install git-credential-manager. For Apple-silicon Macs, download the gcm-osx-arm64-2.4.1.pkg file and run it. Otherwise, select the gcm-osx-x64-2.4.1.pkg package.
- Run these 2 commands seperately in Terminal to connect the Github account to the VScode:
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
- Run this command in Terminal to clone the repository:
git clone https://github.com/dwarvesf/memo.d.foundation
Method 2: Link VScode with your Github account
Before you can clone the repo, you should connect your github account with the VScode. Then follow these steps:
- Choose option Clone Repositories
- Choose Clone from Github
- Search repo
https://github.com/dwarvesf/memo.d.foundation
ormemo.d.foundation
and select to clone it
Setup the environment on your laptop
- Open the repository
memo.d.foundation
by directing to the destination of folder note.d.foundation that you have saved when clone the repo.
- Run submodule update by running these 3 commands in order and seperately:
git submodule update --init --recursive
git submodule update --recursive --remote
git submodule foreach --recursive 'git checkout main || git checkout master'
- Create folder “content” under node.d.foundation folder
- To preview all the changes on website, open devbox by running command
devbox shell
in Terminal. Then use commandmake watch-run
to rebuilt the website.
- After the command
make watch-run
finished, a localhost link would be generated. You need to open the link byCmd + click
to that link and you will have a preview of all changes you have made without affecting the main page memo.d.foundation
Note: If the localhost link has error, please run devbox shell
and make watch-run
again
On the next post, we will talk about how to push content on memo.d.foundation.