Requirements
- golang version should be 1.22>=
- Hugo extended
Important Points to remember
- DO NOT COMMIT TO THE MAIN BRANCH DIRECTLY.
- DO NOT EDIT hugo.toml FILE
-
The theme content is in labs directory.
-
Edit hugo.toml file and modify base url to localhost with port on which hugo is running. (Don't push this change to remote repo)
-
Use the following command from the labs directory to serve it locally
hugo serve
-
Use the following command to create markdown file for your challenge. Run the following command from the labs directory.
hugo new content/docs/<category_name>/n.md
Replace
category_name
with the category name available in the repo andn
with any number not in use currently. Use the numbers sequentially not randomly. -
Once the markdown file has been created, at the top modify title.
-
We follow the following syntax to contribute.
{{< tabs tabTotal="2">}}
The above tag defines the total number of tabs to be adding in the challenges
{{% tab tabName="Challenge" %}}
The above tag starts the first tab and set the tab name to
Challenge
{{% /tab %}}
The above tag stops the tab content.
{linenos=true,anchorlinenos=true}
The above tag after triple backticks will show the line number, we can also add
hl_lines
to highlight line numbers. Check the below example to see what it might look like. Here is a complete example of what a final markdown file will look like.--- weight: 999 title: "SQLi 1" description: "" icon: "article" date: "2023-12-14T14:34:57+05:30" lastmod: "2023-12-14T14:34:57+05:30" draft: false toc: true --- Challenge description {{< tabs tabTotal="2">}} {{% tab tabName="Challenge" %}} ````js {linenos=true,anchorlinenos=true} challenge snippet ```` {{% /tab %}} {{% tab tabName="Solution" %}} Solution steps or description ````js {linenos=table,hl_lines=[3,"5-7"],anchorlinenos=true} solution snippet ```` {{% /tab %}} {{< /tabs >}}
-
Run it locally and once done, commit to another branch and raise a merge request to main branch.
-
Request review from the team.
And we are done :D Thank you for reading.