-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(guide): move custom-templates docs and translate it (#196)
- Loading branch information
1 parent
8a3ad1a
commit bdb2d51
Showing
3 changed files
with
61 additions
and
35 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,60 @@ | ||
--- | ||
title: Custom Post Templates | ||
title_zh-CN: 自定义文章模板 | ||
categories: | ||
- Custom | ||
end: false | ||
--- | ||
|
||
::: zh-CN | ||
Valaxy 使用 [ejs](https://ejs.co/) 作为模板生成助手,你可以按照以下方式定义自己的模板: | ||
::: | ||
|
||
::: en | ||
Valaxy uses [ejs](https://ejs.co/) as its template generating helper, you can define your | ||
own templates as below: | ||
::: | ||
|
||
## 在项目根目录中创建 scaffold 文件夹 {lang="zh-CN"} | ||
|
||
## Create a scaffold folder in your project root {lang="en"} | ||
|
||
```shell | ||
$ mkdir scaffolds | ||
``` | ||
|
||
## 在 scaffolds 文件夹中创建自己的模板 {lang="zh-CN"} | ||
|
||
## Create your own template to the scaffolds folder {lang="en"} | ||
|
||
<div lang="zh-CN"> | ||
|
||
> **提示** | ||
> 你要创建的文件名将与使用命令创建文件时所需的布局名称相同: | ||
> `valaxy new --layout [layout] [filename]` | ||
</div> | ||
|
||
<div lang="en"> | ||
|
||
> **Note** | ||
> The filename you are going to create is going to be the same | ||
with the layout name you need when you creating file with command: | ||
|
||
> `valaxy new --layout [layout] [filename]` | ||
</div> | ||
|
||
```shell | ||
$ touch scaffolds/post.md | ||
$ cat <<EOF > scaffolds/post.md | ||
--- | ||
layout: <%=layout%> | ||
title: <%=title%> | ||
date: <%=date%> | ||
--- | ||
Some additional descriptions | ||
EOF | ||
``` |
bdb2d51
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
valaxy-docs-dev – ./
valaxy-docs-dev-yunyoujun.vercel.app
valaxy-docs-dev-git-main-yunyoujun.vercel.app
dev.valaxy.site
valaxy-docs-dev.vercel.app
beta.valaxy.site
bdb2d51
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Published on https://yun.valaxy.site as production
🚀 Deployed on https://641a70242d11a52fa24ed9d0--valaxy.netlify.app