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

feat: Add circle shortcode #158

Merged
merged 1 commit into from
May 22, 2020
Merged
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
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}