Daniel Jimenez Garcia website
Welcome to the source code of my personal website!
The latest version of the site is available at https://danijg.github.io/.
Stack
This website was:
- Built using gatsbyjs and the github.com/Chronoblog/gatsby-theme-chronoblog.
- Published to GitHub pages using GitHub actions.
Changes to the theme
A couple of componets were overriden to avoid breaking the DotNetCurry magazine articles. The original components would remove the www.
prefix from these URLs, which results in broken links.
Github cards
Repo cards are generated with https://gh-card.dev/. Note the repo should have a description!
Development
You can get the site running locally with a few steps:
- Clone this repo
git clone git@github.com:danijg.github.io.git
- cd into the folder where it was cloned
cd danijg.github.io
- Switch to the source branch! This is very important since the master branch contains the generated site!
git checkout source
- Install the dependencies
npm i
- Run the local development server
npm start
Then head to http://localhost:8000 in your browser.
If the port was in use, a different one will be used. Pay attention to the output of the command.
Deployment
The site is deployed to GitHub pages.
Since this is a user repo, the files for the GitHub pages site need to be located in the master branch of the repo. See official docs. (You could switch your "main" branch to a different branch, but then GitHub pages also needs the site files to be located there)
Deployment essentially means:
- run the build command
npm run build
, which generates the files in./public
- switch over to the folder where the static contents are generated
cd ./public
- initialize a new git repo
- force push the contents of the
public
folder to master
Automatic deploy via GitHub actions
By commiting code to the source
branch, you will trigger the configured GitHub action workflow as per the .github/workflows/deploy.yml
file.
The workflow file essentially codifies the steps outlined above.
- Uses Node action to run the
npm
commands that build the site. - Users the community provided github-push action to force push the resulting files to the master branch.
Manual deploy
- Make sure you are in the source branch, and not in master
- Run the deploy script
./deploy.sh