diff options
author | Rise <8315221+AmazingRise@users.noreply.github.com> | 2020-07-29 10:20:42 +0300 |
---|---|---|
committer | Rise <8315221+AmazingRise@users.noreply.github.com> | 2020-07-29 10:20:42 +0300 |
commit | 08f38b5ca06c3fd4a1f3ec99c759d839a692a431 (patch) | |
tree | bdecf3087c6cdb94af9f1f22537f5733bfd46aaf /Inserting-Figures.md | |
parent | 954f5a9d6088977527bf851bbdee966df310aed4 (diff) |
Created Inserting Figures (markdown)
Diffstat (limited to 'Inserting-Figures.md')
-rw-r--r-- | Inserting-Figures.md | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Inserting-Figures.md b/Inserting-Figures.md new file mode 100644 index 0000000..066550d --- /dev/null +++ b/Inserting-Figures.md @@ -0,0 +1,20 @@ +Inspired by [this issue](https://github.com/AmazingRise/hugo-theme-diary/issues/55), I ported a shortcode from [cupper-hugo-theme](https://github.com/zwbetz-gh/cupper-hugo-theme). +Thanks for [zwbetz-gh](https://github.com/zwbetz-gh)'s code. + +Additionally, I add a property `align`, for defining how figure aligns. + +``` +{{< insertFigure +img="resource_name" +caption="This is an example figure. For details, view [here](https://github.com/AmazingRise/hugo-theme-diary/issues/55)." +command="Resize" +align="Right" +options="700x" >}} +``` + +NOTE: +- `img` must be a resource name. [How to define a source?](https://gohugo.io/content-management/page-resources/#resources-metadata-example) +- Possible value for align: `Left`, `Right`, `Center`, `Justify` (it is not case-sensitive). +- The value of command must be one of `Fit`, `Fill`, `Resize`, `Original`. +- In fact, this is a shortcut of [Image processing methods](https://gohugo.io/content-management/image-processing/#image-processing-methods). See code for details. + |