-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8bf1c80
commit 18c9ffb
Showing
3 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` | ||
|
||
:: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |