Welcome To My World

how2
Author

José R. Ferrer-Paris

Published

April 5, 2025

This is the typical Hello World! post in my new and wonderful blog. Welcome!

So this is basically here to test if the whole thing works.

To get started I first installed quarto.1

Then, once I decided how to name my blog, I ran:

quarto create project website code-4-iNat

Then I started to prepare the content and structure of my initial posts, modified the text in the qmd files and the configuration in the _quarto.yml and ran quarto render to render all files in the project.

I started to keep track of changes with git:2

cd code-4-iNat
git init

I switch between VS-code, Rstudio, Jupyter (see below) and the terminal to organise my files, and kept working on this until I got something I wanted to preview:

quarto preview code-4-iNat

Here some random notes about the process

icons

For some reason I though these would fontsawesome icons, but the help prompt in VS-code pointed out:

Name of bootstrap icon (e.g. github, twitter, share). See https://icons.getbootstrap.com/ for a list of available icons

Also, it turns out we can add emojis to the text of a post using this in the front-matter of the file:

---
title: "My Document"
from: markdown+emoji
---

This is a handy demonstration of all emojis: https://gist.github.com/rxaviers/7360908

To add bootstrap icons in the text, activate this extension:

quarto install extension shafayetShafee/bsicons

Freeze

The posts directory has a _metadata.yml file with the freeze option activated by default.

_site folder

In the quarto documentation they recommend to add it to the .gitignore file, so as to keep the raw content and code in version control, but the output served in a different workflow (either with quarto.pub or GitHub actions).

Secrets

There are certain environment variables that need to be specified in order to render the posts in this blog. I created an _environment.required file with the list of required variables and empty values.

_environment.required
FLICKR_API_KEY=
MAPBOX_TOKEN=
STADIA_API_KEY=
THUNDERFOREST_API_KEY=

For local development, I defined these variables in the _environment.local file and ignore this file in version control by adding /_*.local in .gitignore.

Engine

Some code is running with RStudio / VScode and R , some code with Python and Jupyter.

For python, I created a virtual environment in the project directory.

python3 -m venv .venv

Then activate the environment

source .venv/bin/activate    

Update pip, install other packages with:

pip install --upgrade pip
pip install jupyterlab
pip install pyinaturalist numpy matplotlib owslib
pip install basemap plotly altair
pip install geopandas rasterio geopandas fiona folium 

Plotly might need a reinstall, until this is solved: https://github.com/quarto-dev/quarto-cli/discussions/5264

pip install --force-reinstall plotly=="5.24"

To make this environment reproducible, we create a requirements.txt using pip

python3 -m pip freeze > requirements.txt

Then we can reproduce this environment on another machine by creating an empty environment, activating it, and then:

python3 -m pip install -r requirements.txt

In MacOSX we might need to do this to install the certificates:

open /Applications/Python\ 3.12/Install\ Certificates.command

Publish / Code

On Github

I created an empty repo in GitHub and then added it as a remote:

git remote add origin git@github.com:{...}/{...}.git
git branch -M dont-panic
git push -u origin dont-panic

Now the source code and git history is available at: https://github.com/jrfep/code-4-iNat

Comments through Giscus

Note

Still in my to-do list

How to get comments powered by GitHub Discussions and the giscus app?

  1. Enable the Discussions feature in the GitHub repo
  2. Install the giscus app in the GitHub account
  3. Enable comments in the _quarto.yml file:
---
website:
  comments:
    giscus: 
      repo: jrfep/code-4-iNat
---

Quarto Pub

I am preparing this site for my quarto.pub profile. From the directory where this project is located, I executed the quarto publish command for Quarto Pub:

quarto publish quarto-pub

And then followed instructions at quarto.org.

Easy!

Footnotes

  1. Well to be honest, it all started with a operating system, then installing lots of packages, and R and Python, and … but let’s keep it short.↩︎

  2. If we do this before rendering or preview of the site, quarto will create a .gitignore file with the line /.quarto/.↩︎