Skip to content

Commit

Permalink
add image shortcode and update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
alidevjimmy committed Sep 30, 2024
1 parent 151d235 commit 76cc680
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,16 @@ Make sure to fill all the fields carefully as they are important for SEO and use
After creating the file, you can start writing your blog post.\
You can see your blog post in `http://localhost:1313/blog/your-post-slug`

### Images and static assets
For adding images and other static assets, you can use the `assets` directory.
### Images
For adding images, you can use the `assets/images` directory.

### Image optmization
For optimizing images in markdown files use image shortcode: \
`{{< image url="/images/image.png" optimize="1000x webp q50">}}`


### Static assets
For adding static assets, you can use the `static` directory.

### Translations in markdowon
For using translation in markdown files, you can use the `{{<translate "dict.download.welcome">}}` shortcode. translations are in [i18n](./i18n/) directory.
Expand Down
3 changes: 3 additions & 0 deletions layouts/shortcodes/image.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{ $image := resources.Get (.Get "url") }}
{{ $resized := $image.Resize (.Get "optimize") }}
{{ $resized.RelPermalink }}
6 changes: 3 additions & 3 deletions static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -3718,6 +3718,9 @@ html:has(.drawer-toggle:checked) {
.h-5 {
height: 1.25rem;
}
.h-56 {
height: 14rem;
}
.h-\[23px\] {
height: 23px;
}
Expand All @@ -3733,9 +3736,6 @@ html:has(.drawer-toggle:checked) {
.h-full {
height: 100%;
}
.h-56 {
height: 14rem;
}
.max-h-full {
max-height: 100%;
}
Expand Down

0 comments on commit 76cc680

Please sign in to comment.