Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test] add mermaid support #107

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ To submit a blog post for publication on [wechaty.js.org](https://wechaty.js.org
6. Write your blog in markdown in the file you created in the previous step. If you are not familiar with markdown syntax, you can learn it [here](https://guides.github.com/features/mastering-markdown/)
7. Add related images to [jekyll/assets](./jekyll/assets) folder under `$YEAR/$MONTH-your-blog-slug/` directory
8. Add your info into `jekyll/_contributors/your_github_id.md`
9. Commit your changes using the command `git commit -am "YOUR_BLOG_TITLE"`. `YOUR_BLOG_TITLE` is the title of your blog
10. Push your branch to github using the command `git push origin name-of-blog-branch`.
11. Create new Pull Request(PR)
12. Sign the [CLA](https://en.wikipedia.org/wiki/Contributor_License_Agreement)
13. Wait for the continuous integration workflow run to finish. If it is failing, fix whatever is making it to fail so that CI turns green
14. Wait for @wechaty/editors to review your PR
9. Use mermaid: [URL](/jekyll#use-mermaid)
10. Commit your changes using the command `git commit -am "YOUR_BLOG_TITLE"`. `YOUR_BLOG_TITLE` is the title of your blog
11. Push your branch to github using the command `git push origin name-of-blog-branch`.
12. Create new Pull Request(PR)
13. Sign the [CLA](https://en.wikipedia.org/wiki/Contributor_License_Agreement)
14. Wait for the continuous integration workflow run to finish. If it is failing, fix whatever is making it to fail so that CI turns green
15. Wait for @wechaty/editors to review your PR

That's it!

Expand Down
2 changes: 1 addition & 1 deletion jekyll/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ serve:
docker-serve:
docker run \
--rm \
-v .:/srv/jekyll:z \
-v $(pwd):/srv/jekyll:z \
-p 4000:4000 \
jekyll/jekyll \
jekyll serve --force_polling
14 changes: 14 additions & 0 deletions jekyll/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ wechaty.js.org/ | Repo Folder
1. For news posts (will show in `/news/` URL), add `news` to `tags`
1. For sticky posts, add `sticky` to `tags`

## Use mermaid

````bash
```
title: xxxxx
author: xxxxx
categories: xxxxx
tags:
- xxxxx
image: /assets/2022/xxxxx/logo.webp
mermaid: true
```
````

## Serve from local

Run the Jekyll at localhost for blog preview.
Expand Down
10 changes: 10 additions & 0 deletions jekyll/_includes/mermaid.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script src="https://unpkg.com/mermaid@9.0.0/dist/mermaid.min.js"></script>
<script>
$(document).ready(function () {
mermaid.initialize({
startOnLoad:true,
theme: "default",
});
window.mermaid.init(undefined, document.querySelectorAll('.language-mermaid'));
});
</script>
1 change: 1 addition & 0 deletions jekyll/_posts/2022-04-13-wechaty-gateway-use.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ tags:
- gateway
- wechat4u
image: /assets/2022/04-wechaty-gateway-use/logo.webp
mermaid: true
---

## 前言
Expand Down