Guide for authors
As an author contributing to this project, it's essential to follow a consistent structure to ensure that your article is easy to read and understand. This guide outlines the typical structure, file organization, and best practices for writing articles that align with the project's standards.
Files and folders
All articles are stored in the /docs/src
folder.
If the article doesn't include images (or other assets), if should be a markdown file with the .md
extension, and named after the topic it covers.
Navigation panel
For the article to be included in the navigation panel, it should be added to the config.mts
file, in the sidebar
array, with the following structure:
{
"text": 'Category',
"items": [
{
"text": 'Article without images',
"link": '/.../category/topic.md',
},
{
"text": 'Article with images',
"link": '/.../category/topic/index.md',
}
]
}
A category can be a container for articles, and/or be a container for other categories, and include (or not) an index.md
file to provide a brief introduction to the category. For the latter, the structure goes like this:
{
"text": 'Category',
"link": '/.../index.md'
"items": [
// ...
Content structure
A typical article in this project follows a three-part structure:
- Theory: provides an introduction to the topic, adds context, explains the concepts and ideas behind it.
- Practice: delves into the practical aspects: step-by-step explanations and examples, with commands and code snippets. This part should include, whenever possible, a tabs block with one tab for Unix-like commands, and another for Windows commands.
- Resources: lists the sources that helped build the article, and additional resources that one can use to further their learning (e.g. articles, blogposts, whitepapers, videos)
Writing style
When writing your article, one should keep the following tone & voice.
- Professional and Authoritative: The content should maintain a professional tone, suitable for a technical audience familiar with cybersecurity concepts.
- Instructional and Informative: The writing aims to educate the reader, with clear instructions and explanations. It avoids being overly casual, focusing instead on delivering detailed, technical knowledge.
Block Types
The project uses a variety of block types to organize and present content. While this guide focuses on the main blocks used in this project, additionnal blocks are listed in the official VitePress docs.
Code
Use triple backticks to delimit code blocks, specifying the language after the first set of backticks. VitePress supports extended usage of code blocks such as syntax highlighting, line highlighting, line focus, colored diffs, errors and warnings highlighting, line numbers, code groups.
But it can be as simple as that:
```python
print('hello world')
```
Giving the following output
print('hello world')
Tabs
Input
:::tabs
== tab a
Some content
== tab b
b content
:::
Output
Some content
Callouts
THR uses GitHub-flavored alerts to render most callouts. The most common callouts in The Hacker Recipes are:
NOTE
Note from the author, not critical to the main content. To calrify, offer references, add content or background.
TIP
Offer helpful advice or best practices. Providing shortcut or expert recommandation.
WARNING
Alert the reader to potentiel dangers. Provide OPSEC advice.
CAUTION
When there's critical information the reader needs to be aware of.
SUCCESS
When the author wants to highlight a successful outcome or scenario.
Details
Details blocks can also be used
The input for this goes like this:
> [!NOTE] NOTE
> Note from the author, not critical to the main content. To calrify, offer references, add content or background.
> [!TIP] TIP
> Offer helpful advice or best practices. Providing shortcut or expert recommandation.
> [!WARNING] WARNING
> Alert the reader to potentiel dangers. Provide OPSEC advice.
> [!CAUTION] CAUTION
> When there's critical information the reader needs to be aware of.
> [!SUCCESS] SUCCESS
> When the author wants to highlight a successful outcome or scenario.
::: details
Details blocks can also be used
:::
The title of a callout is optionnal.
> [!NOTE]
The title of a callout is optionnal.
Images and links
As simple as [title](link)
for links and ![](path/to/image)
for images.
If there are spaces in the image path, either spaces need to be URL-encded (%20
), or the following structure can be used (recommended): ![](<path/to/some image>)
Images can also be given a caption
![](path/to/image)
Some caption{.caption}
Which will output the following
To embed a YouTube link, use the following tag format:
> [!YOUTUBE] https://www.youtube.com/watch?v=example
This will create a clickable link that directs users to the specified YouTube video.
Which will output the following
Ensure you provide the full YouTube link, as using a shortened link will cause the tag to malfunction.
Others
Block | Description |
---|---|
Links | Internal links (to other articles, or to anchor points) |
Tables | Tables (like this one) |
Emojis | Emojis 🎉 |
### Quotes
> "Someone said something important and it should be highlighted in the article? Please quote it and attribute it to the initial author."
>
> _(Author, date, [source](#))_
```markdown
> "Someone said something important and it should be highlighted in the article? Please quote it and attribute it to the initial author."
>
> _(Author, date, [source](#))_
Article template
An article template is available for a quick start: Template.
Highlighting contributors
For contributors to be listed, they need to be listed in the authors
property of the frontmatter configuration of the corresponding page(s).
When contributing to a page, an author must add its GitHub username to it:
---
authors: author1, author2, ...
---
Get started 🚀
- Fork the repository (https://github.com/The-Hacker-Recipes/The-Hacker-Recipes/fork)
- (optionnal) create a new branch in your fork, if you plan on working on different topics
- Create your content using this guide, and the template if needed
- Make sure the content builds fine with
npm install && npm run docs:dev
- Make a Pull Request (https://github.com/The-Hacker-Recipes/The-Hacker-Recipes/compare)