Skip to content

Commit

Permalink
feat: Add circle shortcode (#158)
Browse files Browse the repository at this point in the history
cf. #152
  • Loading branch information
peaceiris authored May 22, 2020
1 parent 17a7fd0 commit acd2b3f
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 10 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Hugo IRIS Theme
- [Netlify](#netlify)
- [GitHub Pages using Actions](#github-pages-using-actions)
- [Shortcodes](#shortcodes)
- [circle](#circle)
- [button](#button)
- [li](#li)
- [mermaid](#mermaid)
Expand Down Expand Up @@ -194,6 +195,16 @@ jobs:
## Shortcodes
### circle
If your logo image is located at `static/images/logo.jpg`.

```md
{{< circle src="/images/logo.jpg" alt="hugo-theme-iris logo" >}}
```

<img width="500px" src="https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/master/exampleSite/static/images/shortcode_circle.jpg" alt="Shortcode mermaid">

### button

```md
Expand Down
9 changes: 0 additions & 9 deletions assets/theme/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,3 @@
pre {
margin: 1rem 0rem;
}

figure.image {
margin: 2rem 0rem;

figcaption {
margin: 1rem 0rem;
}
}

2 changes: 2 additions & 0 deletions exampleSite/content/en/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ date: 2020-01-01T23:00:00.000Z

## About Hugo IRIS Theme

{{< circle src="/images/logo.jpg" alt="hugo-theme-iris logo" >}}

View source code on GitHub.

<br>
Expand Down
Binary file modified exampleSite/static/images/logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exampleSite/static/images/shortcode_circle.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions layouts/shortcodes/circle.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{ $src := .Get "src" }}
{{ $alt := .Get "alt" }}

<br>
<figure class="image is-180x180 container">
<img
class="is-rounded"
src="{{ $src | absURL }}"
alt="{{ $alt | safeHTML }}"
decoding="async"
loading="lazy"
/>
</figure>
<br>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pre{margin:1rem 0}figure.image{margin:2rem 0}figure.image figcaption{margin:1rem 0}
pre{margin:1rem 0}

0 comments on commit acd2b3f

Please sign in to comment.