Jekyll based website for Codesai.
- Clone the repository
- Navigate to the repository folder in a terminal
- Run
sudo make start - You may access the local website at
localhost:4000 - Start coding and jekyll will automatically build after you save changes
- If you modify
.ymlfiles, you need to either restart the docker container or start another terminal and typedocker exec -it {name} bashto get a terminal inside the container. Once there, typejekyll buildso it will build the site taking the changes to the.ymlfiles. This is because the docker container is executingjekyll servewhich doesn't get the.ymlchanges
Remember: If you experience other problems with jekyll automatic builds you can always start another terminal and run docker exec -it {name} bash. You may now use jekyll build and other jekyll commands on demand.
To check the name of your docker container you can run docker ps, it should be something like {name_of_jekyll_folder}_web_1.
You can check out how it works in the wiki. Althought not recommended you can setup your own environment instead of using Docker.
The site is hosted on Netlify, connected to this GitHub repository. There is no manual deploy step and no GitHub Actions workflow: Netlify watches the repo and deploys on its own.
- Production branch:
main. Every push tomaintriggers an automatic Netlify build that runs a Jekyll build (seebuild_site.sh, which also copies the Spanish posts from_i18n/es/_postsinto_i18n/enbefore building) and publishes the generated_siteto https://www.codesai.com. - The build command and publish directory are configured in the Netlify UI, not in
netlify.toml(that file only holds redirect rules).
- Get your change onto
main(commit directly, or merge your branch / PR intomain). git push origin main.- Open the Netlify dashboard → the Codesai site → Deploys, and wait for the build for your commit to finish (typically 1–3 minutes). The log there shows any build error.
- Verify on https://www.codesai.com.
In Netlify → Deploys, open a previous successful deploy and use Publish deploy to restore it. This does not touch git.
main is the production branch: every push to it deploys to https://www.codesai.com, so it must always be ready to be deployed
Remember to follow the Blog Publications flow inside the Codesai trello
| list | usage |
|---|---|
| Backlog | Post to be written |
| Writing | Post being written |
| Revising | Looking for feedback, typos |
| Polishing | Ensuring the images are compressed, styles, responsiveness |
The first step is to create a new branch from the latest main with a quick name related to the post. Write the post there while it goes through revision and polishing. Periodically rebase or merge main into your branch to pick up the latest updates (styles could change). When the post is ready, open a pull request against main; merging it publishes the post, since every push to main triggers a Netlify deploy (see the Deploy section above).
To create a post, add a new file under _i18n/es/_posts/ named YYYY-MM-DD-name-of-the-post.md; the name becomes the permalink. All posts live in Spanish under _i18n/es/_posts/ — build_site.sh copies them into _i18n/en at build time. At the top of the file you have to write a small yaml specification, the bare minimum to start a post is:
---
layout: post
title: My Post Title nicely written
author: Crazy Cockatoo
---
You can now write your post below, remember that we now use markdown and you can mix in some html if needed. We are now using kramdown as recommended by jekyll, you may prefer this markdown quicksheet.
| variable | usage |
|---|---|
| layout | layout to be applied to the page. For a post it should always be post |
| title | the title of the post, it is recommended to be between double quotes |
| author | there can be multiple authors for a post, ie: Someone and Somebody |
| small_image | the filename (not the full path) of the image to use as preview for the post |
| cross_post_url | when cross-posting, the url of the original post. A note will be added at the end of the post |
| written_in | It's only necessary for cross-posting. By default is set to spanish. If your post is written in English, set it to english |
| date | you can specify a more precise date in the format 2016-12-15 11:25:00.000000000 +01:00 |
| tags | an array of tags tags: [first, second, third] |
| categories | an object of categories |
An example of categories would be:
categories:
- Codesai
- Formación
- Clojure
- Functional Programming
More info on what variables are and how to use them in the Jekyll documentation and the Liquid documentation page.
You should place any images you are going to use in the post inside the assets folder.
Please don't directly add pictures from your phone since they are usually HUGE. The post width is limited to 900px for readability concerns, so we are limiting the image width to 1000px. For faster loading times and a better overall experience for the user, we recommend following these two steps when adding images to a post:
- Reduce the width of your image to a maximum of
1000pxusing any image editor you prefer. - Compress the image, we are using TinyPNG for PNG and JPG compression.
To add one liners or similar, you can use markdown. If you want syntax highlightning and some more lines of code, we recommend adding a public gist inside the github's Codesai account and embed it in the post. This is convenient since you can always edit your gist later without having to edit the post.
To add a youtube video, you can use the published-video template provided in the includes. It will add a responsive, full-width youtube video to the post. Simply replace the src parameter with the one of your video :)
{% include published-video.html video-id="bIr5fPom7B4" speakers="Me" title="Awesome video" %}