First of all, thank you for sharing your ideas, knowledge, opinions ๐ŸŽ‰๐ŸŽ‰ You are awesome and we love you ๐Ÿ˜๐Ÿ˜

โค๏ธ๐Ÿงก๐Ÿ’›๐Ÿ’š๐Ÿ’™๐Ÿ’œ๐Ÿ–ค

The following is a set of guidelines for contributing to our blog. We tried to be as comprehensive as possible, but if you feel that there is more to this, please feel free to propose changes to this in a pull request.

Table of Content

Contribute as an author

Contribute as a translator

Bonus: Fancy author profile

Doubts and questions

I. Contribute as an author

Step-by-step guide for your new post to be on TheCodeCousins

Setting up local env

Start by forking this repository and then clone it recursively to your local workspace

git clone https://github.com/YOUR-USERNAME/thecodecousins --recursive
cd thecodecousins/

Check if you have hugo installed by running hugo version. If you haven’t already installed hugo, please follow the instruction on their site.

Start a new post

Generate a new post from our theme template by running

hugo new posts/YOUR-POST-NAME/index.md # we will explain why index.md in the next section

Fill in all the necessary fields:

  • title: try to keep it short and captivating.
  • date: must be in ISO-8601 format, this timestamp generator might come handy for such.
  • authors: A collection (array) of post authors’ full/pen names. For fancy authors’ profiles, head down to bonus section
  • cover: image that will be shown in preview and at the top of your post
  • tags: topics of your post
  • keywords: same as tags but can be more specific
  • description: a short summary of your post to be shown in preview
  • showFullContent: please keep this as false to share blog’s estate with other authors

Write your blog post in markdown with an enhanced flavor from hugo. If you are intending to do more than just standard mardown (md), checkout hugo docs to learn more.

Static assets

We intend to use leaf bundle organisation for all posts on TheCodeCousins, which is the reason why you were asked to create a folder with your post name and an index.md for post content. Your final product with some static assets would look something like this

Example source tree

Then your assets can be included in the post using the full path with content folder as root (i.e. /posts/test-posts/img/cover.jpg is the needed path to include the cover image).

Letting us know ๐ŸŽ‰๐ŸŽ‰

After you are done with your post, please open a Pull Request labelled post on our repository and your post will be up in no time. ๐Ÿฅณ๐Ÿฅณ

II. Contribute as a translator

Step-by-step to make your contribution by translating someone else’s post on TheCodeCousins

Seeking permission from original author

Open an issue labelled translation with a link in description to the original post on our repo. We will connect with the original author and help you obtain their permission ๐Ÿ‘Œ๐Ÿ‘Œ.

Setting up local env

Start by forking this repository and then clone it recursively to your local workspace

git clone https://github.com/YOUR-USERNAME/thecodecousins --recursive
cd thecodecousins/

Check if you have hugo installed by running hugo version. If you haven’t already installed hugo, please follow the instruction on their site.

Create the post in target language

Identify the post’s ID by locating what the containing folder name is (i.e. if the path to markdown file is /content/posts/example/index.md then the post’s ID is example). Create the post in target language with the following command after identifying target language’s key from our config file (i.e. vi for Viet)

# For English as target language, there's no need for language key
# as English is the default language
hugo new posts/<POST-ID>/index.<LANGUAGE-KEY>.md

Fill in all the necessary fields:

  • title: translation from original post
  • date: must be in ISO-8601 format, this timestamp generator might come handy for such.
  • authors: A collection (array) of post authors’ full/pen names. For fancy authors’ profiles, head down to bonus section
  • cover: same as original post’s
  • tags: same as or translated from original post’s
  • keywords: same as or translated from original post’s
  • description: translation from original post
  • showFullContent: please keep this as false to share blog’s estate with other authors

Start the post with link to original post and attribution to the original author. For example, your translated post can be started with “This post was translated from our example post by Stanley Nguyen”.

Write your blog post in markdown with an enhanced flavor from hugo. If you are intending to do more than just standard mardown (md), checkout hugo docs to learn more.

Letting us know ๐ŸŽ‰๐ŸŽ‰

After you are done with your post, please open a Pull Request labelled post and translation on our repository and your post will be up in no time. ๐Ÿฅณ๐Ÿฅณ

III. Bonus: Fancy author profile

This section is for anyone who’s looking for a fancier Author profile page rather than just a page with your list of posts when readers click on your post’s author name.

Create an author data for yourself, we recommend using your Github handle as an identifier for consistency and to avoid collision among our contributors

touch data/authors/YOUR-USERNAME.yaml

There are 3 fields that you can provide in your author data file:

  • name: self-explanatory ๐Ÿ˜๐Ÿ˜†
  • img: your profile picture (also use your Github handle for naming), can be put inside /static folder and referred from root of TheCodeCousins site (i.e. location /static/stanleynguyen.jpg, referred as /stanleynguyen.jpg in author data file)
  • url: link to your online profile
  • bio: short intro of yourself, please keep it under 100 characters

Use the corresponding identifier for the values in authors field of your post. (i.e., my author data file is stanleynguyen.yaml then my post’s authors field should include stanleynguyen)

IV. Doubts and questions

Please shoot us a new issue labelled question on our repo.