Collaborative working

Since a lot of my work is on the website, which is deliberately built upon quarto and thereof, there are tutorials to be made in advance. Some of these tutorials are from NOAA webpages.

For contents on website (pages)

Edit the .qmd or .md files in the content folder. .qmd files can include code (R, Python, Julia) and lots of Quarto markdown bells and whistles (like call-outs, cross-references, auto-citations and much more). By default, the webpage is set to freeze execution, so usually everything would be compiled locally first.

Each page should start with

---
title: your title
---

and the first header will be the 2nd level, so ##. Note, there are situations where you leave off

---
title: 
<other_config>
---
# First title

and start the qmd file with a level header #, but if using the default title yaml (in the --- fence) is a good habit since it makes it easy for Quarto convert your qmd file to other formats (like into a presentation, though they use Reveal.js).

Add your pages the project

Add the files to _quarto.yml is the usual choice. However, in this work, it would be more preferable to edit the publication page and links from there. Quarto resolver will figure it out by itself, as always.

Do your first publish

The website is already configured, so usually, to publish, simply (if you have quarto installed, otherwise just commit and I will pull the source back and do the publishing), with enough push & pull permission, do

quarto publish gh-pages

If you did not type gh-pages - kind of alright, because Quarto’s CLI GUI will give you options to choose from such. Configure it for the first time so it can type check. Then, simply wait until it is done.

For git and people working on repository

There are two types of repository public or private, that we would be using, especially with collaborative work and remote of such. One of which is GitHub, as we already have, and the second one is GitLab, of which offers a more secure pipeline and organization template. If it is GitHub, for repository without permission (either I did not configure it for you), you can simply fork it while waiting for push permission to be accepted (elevation of roles). Otherwise, if yes, then simply do

git clone repository-link(.git)
cd repository-name
git remote add origin <branch>
git branch --set-upstream-to=<branch>

Then, simply next time you do anything, just do the flow of

git fetch 
git pull # (above command and this is for obtaining updated from GitHub codes)

git add * # (add everything)
git commit -m "<message>"
git push

And usually it would be done, fairly speaking. On GitLab, it is a bit more difficult, but usually git would handle the same way. There is the issue with SSL security code that you would have to set up later for push or pull flow to be accepted, however. This is usually covered in Microsoft official documentation. To do this, and generate, simply do this in cmd or powershell:

ssh-keygen -t ecdsa

# For normal users.
# Get the public key file generated previously on your client.
$authorizedKey = Get-Content -Path $env:USERPROFILE\.ssh\id_ecdsa.pub

# Generate the PowerShell command to run remotely that copies the public key file generated previously on your client to the authorized_keys file on your server.
$remotePowershell = "powershell New-Item -Force -ItemType Directory -Path $env:USERPROFILE\.ssh; Add-Content -Force -Path $env:USERPROFILE\.ssh\authorized_keys -Value '$authorizedKey'"

# Connect to your server and run the PowerShell command by using the $remotePowerShell variable.
ssh username@domain1@contoso.com $remotePowershell

During the process of ssh-keygen specifically, it will ask you for passkey. Either do that or not. And, take the .pub file in the directory that the prompt would give you, which is like

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----         6/3/2021   2:55 PM            464 id_ecdsa
-a----         6/3/2021   2:55 PM            103 id_ecdsa.pub

You can somewhat modify some information of the SSH key. However, do not modify the hash string, or the string of encoded character no one can read.

Back to top