Skip to content

Commit

Permalink
docs: 'postAsset' option of [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
curbengh committed Aug 22, 2020
1 parent 47d0920 commit d31ce77
Show file tree
Hide file tree
Showing 14 changed files with 119 additions and 1 deletion.
15 changes: 15 additions & 0 deletions source/docs/asset-folders.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,18 @@ The correct way to reference the image will thus be using tag plugin syntax rath
```
This way, the image will appear both inside the post and on index and archive pages.
## Embedding an image using markdown
[hexo-renderer-marked](https://github.com/hexojs/hexo-renderer-marked) 3.1.0 introduced a new option that allows you to embed an image in markdown without using `asset_img` tag plugin.
To enable:
``` yml _config.yml
post_asset_folder: true
marked:
prependRoot: true
postAsset: true
```

Once enabled, an asset image will be automatically resolved to its corresponding post's path. For example, "image.jpg" is located at "/2020/01/02/foo/image.jpg", meaning it is an asset image of "/2020/01/02/foo/" post, `![](image.jpg)` will be rendered as `<img src="/2020/01/02/foo/image.jpg">`.
2 changes: 2 additions & 0 deletions source/docs/tag-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ Include post assets, to be used in conjunction with [`post_asset_folder`](/docs/

### Embed image

_hexo-renderer-marked 3.1.0+ can (optionally) resolves the post's path of an image automatically, refer to [this section](/docs/asset-folders#Embedding-an-image-using-markdown) on how to enable it._

"foo.jpg" is located at `http://yoursite.com/2020/01/02/hello/foo.jpg`.

**Default (no option)**
Expand Down
15 changes: 15 additions & 0 deletions source/ko/docs/asset-folders.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,18 @@ Asset 폴더 관리 기능을 활성화 시켰다면, Hexo는 당신이 `hexo ne
```
이 방법을 통해, 이미지 파일은 포스트 내부나 인덱스 페이지나 아카이브 페이지에서 모두 정상적으로 표시될 것 입니다.
## Embedding an image using markdown
[hexo-renderer-marked](https://github.com/hexojs/hexo-renderer-marked) 3.1.0 introduced a new option that allows you to embed an image in markdown without using `asset_img` tag plugin.
To enable:
``` yml _config.yml
post_asset_folder: true
marked:
prependRoot: true
postAsset: true
```

Once enabled, an asset image will be automatically resolved to its corresponding post's path. For example, "image.jpg" is located at "/2020/01/02/foo/image.jpg", meaning it is an asset image of "/2020/01/02/foo/" post, `![](image.jpg)` will be rendered as `<img src="/2020/01/02/foo/image.jpg">`.
2 changes: 2 additions & 0 deletions source/ko/docs/tag-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ For instance:

### Embed image

_hexo-renderer-marked 3.1.0+ can (optionally) resolves the post's path of an image automatically, refer to [this section](/docs/asset-folders#Embedding-an-image-using-markdown) on how to enable it._

"foo.jpg" is located at `http://yoursite.com/2020/01/02/hello/foo.jpg`.

**Default (no option)**
Expand Down
15 changes: 15 additions & 0 deletions source/pt-br/docs/asset-folders.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,18 @@ A maneira correta de fazer referência à imagem será usando a sintaxe de tag p
{% asset_img "spaced asset.jpg" "spaced title" %}
```
Desta forma, a imagem aparecerá dentro da publicação e nas páginas de índice e arquivo.
## Embedding an image using markdown
[hexo-renderer-marked](https://github.com/hexojs/hexo-renderer-marked) 3.1.0 introduced a new option that allows you to embed an image in markdown without using `asset_img` tag plugin.
To enable:
``` yml _config.yml
post_asset_folder: true
marked:
prependRoot: true
postAsset: true
```

Once enabled, an asset image will be automatically resolved to its corresponding post's path. For example, "image.jpg" is located at "/2020/01/02/foo/image.jpg", meaning it is an asset image of "/2020/01/02/foo/" post, `![](image.jpg)` will be rendered as `<img src="/2020/01/02/foo/image.jpg">`.
2 changes: 2 additions & 0 deletions source/pt-br/docs/tag-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ Incluir assets de postagem.

### Embed image

_hexo-renderer-marked 3.1.0+ can (optionally) resolves the post's path of an image automatically, refer to [this section](/docs/asset-folders#Embedding-an-image-using-markdown) on how to enable it._

"foo.jpg" is located at `http://yoursite.com/2020/01/02/hello/foo.jpg`.

**Default (no option)**
Expand Down
15 changes: 15 additions & 0 deletions source/ru/docs/asset-folders.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,18 @@ post_asset_folder: true
```

При использовании этого способа, изображение появится в самом посте и на главной странице и в архивах.

## Embedding an image using markdown

[hexo-renderer-marked](https://github.com/hexojs/hexo-renderer-marked) 3.1.0 introduced a new option that allows you to embed an image in markdown without using `asset_img` tag plugin.

To enable:

``` yml _config.yml
post_asset_folder: true
marked:
prependRoot: true
postAsset: true
```

Once enabled, an asset image will be automatically resolved to its corresponding post's path. For example, "image.jpg" is located at "/2020/01/02/foo/image.jpg", meaning it is an asset image of "/2020/01/02/foo/" post, `![](image.jpg)` will be rendered as `<img src="/2020/01/02/foo/image.jpg">`.
2 changes: 2 additions & 0 deletions source/ru/docs/tag-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ For instance:

### Embed image

_hexo-renderer-marked 3.1.0+ can (optionally) resolves the post's path of an image automatically, refer to [this section](/docs/asset-folders#Embedding-an-image-using-markdown) on how to enable it._

"foo.jpg" is located at `http://yoursite.com/2020/01/02/hello/foo.jpg`.

**Default (no option)**
Expand Down
14 changes: 14 additions & 0 deletions source/th/docs/asset-folders.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,17 @@ asset folder นี้จะมีชื่อเดียวกันกับ

ดังนั้น รูปภาพจะอยู่ทั้งในโพสต์และในเพจ index กับ archive

## Embedding an image using markdown

[hexo-renderer-marked](https://github.com/hexojs/hexo-renderer-marked) 3.1.0 introduced a new option that allows you to embed an image in markdown without using `asset_img` tag plugin.

To enable:

``` yml _config.yml
post_asset_folder: true
marked:
prependRoot: true
postAsset: true
```

Once enabled, an asset image will be automatically resolved to its corresponding post's path. For example, "image.jpg" is located at "/2020/01/02/foo/image.jpg", meaning it is an asset image of "/2020/01/02/foo/" post, `![](image.jpg)` will be rendered as `<img src="/2020/01/02/foo/image.jpg">`.
2 changes: 2 additions & 0 deletions source/th/docs/tag-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ Post's title and custom text are escaped by default. You can use the `escape` op

### Embed image

_hexo-renderer-marked 3.1.0+ can (optionally) resolves the post's path of an image automatically, refer to [this section](/docs/asset-folders#Embedding-an-image-using-markdown) on how to enable it._

"foo.jpg" is located at `http://yoursite.com/2020/01/02/hello/foo.jpg`.

**Default (no option)**
Expand Down
17 changes: 16 additions & 1 deletion source/zh-cn/docs/asset-folders.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,19 @@ post_asset_folder: true
{% asset_img example.jpg This is an example image %}
```
通过这种方式,图片将会同时出现在文章和主页以及归档页中。
通过这种方式,图片将会同时出现在文章和主页以及归档页中。
## Embedding an image using markdown
[hexo-renderer-marked](https://github.com/hexojs/hexo-renderer-marked) 3.1.0 introduced a new option that allows you to embed an image in markdown without using `asset_img` tag plugin.
To enable:
``` yml _config.yml
post_asset_folder: true
marked:
prependRoot: true
postAsset: true
```

Once enabled, an asset image will be automatically resolved to its corresponding post's path. For example, "image.jpg" is located at "/2020/01/02/foo/image.jpg", meaning it is an asset image of "/2020/01/02/foo/" post, `![](image.jpg)` will be rendered as `<img src="/2020/01/02/foo/image.jpg">`.
2 changes: 2 additions & 0 deletions source/zh-cn/docs/tag-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ content

### Embed image

_hexo-renderer-marked 3.1.0+ can (optionally) resolves the post's path of an image automatically, refer to [this section](/docs/asset-folders#Embedding-an-image-using-markdown) on how to enable it._

"foo.jpg" is located at `http://yoursite.com/2020/01/02/hello/foo.jpg`.

**Default (no option)**
Expand Down
15 changes: 15 additions & 0 deletions source/zh-tw/docs/asset-folders.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,18 @@ Hexo 3 新增了幾個[外掛](/docs/tag-plugins#Include-Assets),讓您更方
{% asset_img slug [title] %}
{% asset_link slug [title] %}
```
## Embedding an image using markdown
[hexo-renderer-marked](https://github.com/hexojs/hexo-renderer-marked) 3.1.0 introduced a new option that allows you to embed an image in markdown without using `asset_img` tag plugin.
To enable:
``` yml _config.yml
post_asset_folder: true
marked:
prependRoot: true
postAsset: true
```

Once enabled, an asset image will be automatically resolved to its corresponding post's path. For example, "image.jpg" is located at "/2020/01/02/foo/image.jpg", meaning it is an asset image of "/2020/01/02/foo/" post, `![](image.jpg)` will be rendered as `<img src="/2020/01/02/foo/image.jpg">`.
2 changes: 2 additions & 0 deletions source/zh-tw/docs/tag-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ For instance:

### Embed image

_hexo-renderer-marked 3.1.0+ can (optionally) resolves the post's path of an image automatically, refer to [this section](/docs/asset-folders#Embedding-an-image-using-markdown) on how to enable it._

"foo.jpg" is located at `http://yoursite.com/2020/01/02/hello/foo.jpg`.

**Default (no option)**
Expand Down

0 comments on commit d31ce77

Please sign in to comment.