Skip to content

Commit

Permalink
chore: create new tutorial template
Browse files Browse the repository at this point in the history
  • Loading branch information
itsacoyote committed May 30, 2024
1 parent 8bf1c80 commit 18c9ffb
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ and you can use components available from [Nuxt UI](https://ui.nuxt.com/componen

### Create a new section for your guide

We have a template tutorial folder you can start from!
You can copy the `/content/tutorials/_new-tutorial-template` to make setting up a new tutorial easy.

Your new guide should have its own folder under `/content/tutorials`. The minimum files your directory should have are
the `_dir.yml` and a `10.index.md`.

Expand Down
114 changes: 114 additions & 0 deletions content/tutorials/_new-tutorial-template/10.index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
title: Header for the first page of the tutorial
description: You can optionally add a small description here.
---

This tutorial shows you how to add a new tutorial to the Code Community project!

## Prerequisites

- [Fork this project on GitHub](https://github.com/zkSync-Community-Hub/community-code) and create a branch to track your work.
- Make sure you have set up your project following the [README](https://github.com/zkSync-Community-Hub/community-code/blob/main/README.md).
- Spend some time getting to know the available tools that are available.
- [Nuxt Content](https://content.nuxt.com/)
- [Nuxt UI & Nuxt UI Pro](https://ui.nuxt.com/)
- and more in our [CONTRIBUTING](https://github.com/zkSync-Community-Hub/community-code/blob/main/CONTRIBUTING.md)

## Create a new tutorial

This template tutorial is designed to help you get a quick start at setting up a new tutorial for Code Community.

1. Make a copy of this folder and paste it into the `/content` directory.

1. Rename the folder in dash-case format.
The actual name of the folder isn't too important to what's displayed on the website.

1. Fill out the `_dir.yml` metadata for your tutorial.

1. Update this `10.index.md` file with your tutorial!

## Adding additional pages

You are free to add more pages for your tutorial.
To create a new page, create a new markdown file and prefix the name of your file with a two digit number.

```txt
20.second-page.md
```

The two-digit number is crucial for Nuxt to detect and manage the ordering of pages for navigation.

## Markdown formatting

This project uses markdown files for tutorials.
You should not need anything more than the markdown syntax when writing your content.
For more complicated UI, you should see if there are any Nuxt UI components available to use.

Please avoid writing custom html and css in your tutorials.

### UI components

You can use Nuxt UI components in your markdown file!
Component syntax however is a little different in markdown.
Learn more in the Contributing page for
[Using UI components](https://github.com/zkSync-Community-Hub/community-code/blob/main/CONTRIBUTING.md#using-ui-components).

::callout{icon="i-heroicons-light-bulb"}
Want to call something out? Use the callout component!
::

## Displaying code

We have a variety of Nuxt UI components available for use though the most important one
will likely the code component.

The standard markdown syntax of the backtick will work for displaying formatted code.

You can customize the display of the code block with a header using the following format:

```ts
```ts [sample-file.ts]
const foo = 'bar';
```
```

```ts [sample-file.ts]
const foo = 'bar';
```

Code blocks can also have a tabbed view using the [Code Group](https://ui.nuxt.com/pro/prose/code-group) component.

```ts

::code-group

```bash [pnpm]
pnpm add @package
```

```bash [yarn]
yarn add @package
```

```bash [npm]
npm install @package
```
::

```

::code-group

```bash [pnpm]
pnpm add @package
```

```bash [yarn]
yarn add @package
```

```bash [npm]
npm install @package
```

::
17 changes: 17 additions & 0 deletions content/tutorials/_new-tutorial-template/_dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: New tutorial example
authors:
- name: Jane Doe
url: https://google.com
avatar: https://i.pravatar.cc/300
github_repo: https://github.com
tags:
- smart contracts
summary: Provide a tweet-sized summary that describes the tutorial.
description:
Provide a brief description of the tutorial. This description should be a few sentences long and should give the
reader an idea of what the tutorial is about.
what_you_will_learn:
- How to write a tutorial
updated: 2024-05-09
tools:
- code-community

0 comments on commit 18c9ffb

Please sign in to comment.