Tutorial
How to create and publish your blogpost ?
The blogpost builds upon Hugo and Markdown.
For markdown you can easily find a cheat sheet here.
Setup: you need to have a GitHub Account, a terminal and a text editor of your choice (e.g.VSCode, nano, gedit)
Install Hugo on your laptop. Hugo is available for all operating systems. You can find the installation guide here. Be careful, you need at least Hugo version 0.120 otherwise, this will not work! To verify your version
hugo version
For Ubuntu, the default version is not the correct one, please download it directly from their github.
- Download the
hugo_extended_0.121.2_linux-amd64.deb
. - Using the terminal, go to the folder where the file is
- Then
sudo apt install ./hugo_extended_0.121.2_linux-amd64.deb
Go to the following repository and
fork
it.Open a terminal
Clone the forked repository of the course using the following command
git clone --recurse-submodules https://....
Replace the https://
with your forked repository url.
- With the terminal, navigate in the cloned repository
cd responsible-ai-datascience-ipParis.github.io
- Run the hugo server command and visit http://localhost:1313 in your browser.
hugo server
- Let’s create a new blog post by running the following command. Once again, please replace
choose-a-name
by a name close to your article.
hugo new posts/choose-a-name.md
- This will create a markdown file named
my-first-blog.md
in theblog
folder underneath thecontent
folder.
If you open this file, you will see that it is not empty. Hugo automatically created some metadata. Hugo has prefilled the title field from the name of the Markdown file, the timestamp of when the file was created, and it has automatically put the file into draft mode.
Change the draft status to false (by default it is set to true) in the newly created file.
Write your blogpost by modifying the markdown file create during step 7. This step should take you long enough ! Once again, to visualise the result of your progress, simply run the hugo server command and visit http://localhost:1313 in your browser. For illustrations or image, create your own folder to avoid filenames confusion with other groups.
DO NOT touch anything else !
Note: regularly commit to your repository to save backups.
- Once you are satisfied with your blogpost you can do the final push of your work !
git add .
git commit -m "i'm done'"
git push origin
- Time to merge your forked repository with the original one !
- First, you need to update your fork by clinking on
Sync fork
button from github. - Then, click on
Contribute
thenopen pull request
!
- While waiting for CD/GitHub Pages to deploy the update, let’s update our local repo.
git checkout main
git pull
After a few minutes the website is updated and you can check your blogpost in the blog page of the website. There is no need on your side to update the index page to list your blog post, this will be done by the supervisors of the course at the very end.
Remark: This tutorial is a small part of the tutorial used to set up the blogpost website link for which a detailed youtube video is available.