Add support for preview images #2
This commit is contained in:
parent
6e2fc7da5c
commit
c242520c60
BIN
content/subprojects/blog/duckling.jpg
Normal file
BIN
content/subprojects/blog/duckling.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 233 KiB |
@ -4,6 +4,8 @@ title = "Blogs"
|
||||
description = "Duckling offers the blogs feature borrowed from Duckquill 🦆"
|
||||
[taxonomies]
|
||||
tags = ["Demo", "Test"]
|
||||
[extra]
|
||||
preview = "duckling.jpg"
|
||||
+++
|
||||
|
||||
Check out the [sample blog](/blog) to see the blogging feature in action!
|
||||
|
||||
@ -5,7 +5,7 @@ description = "No need for a separate documentation page - coming soon!"
|
||||
[taxonomies]
|
||||
tags = ["Demo", "Test"]
|
||||
[extra]
|
||||
featured = true
|
||||
preview = "pond.jpg"
|
||||
+++
|
||||
|
||||
This feature is not yet implemented. Coming soon!
|
||||
|
||||
BIN
content/subprojects/docs/pond.jpg
Normal file
BIN
content/subprojects/docs/pond.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 538 KiB |
BIN
content/subprojects/subproject/duckling.jpg
Normal file
BIN
content/subprojects/subproject/duckling.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 520 KiB |
@ -4,6 +4,8 @@ title = "Subprojects"
|
||||
description = "Showcase parts of your project!"
|
||||
[taxonomies]
|
||||
tags = ["Demo", "Test"]
|
||||
[extra]
|
||||
preview = "duckling.jpg"
|
||||
+++
|
||||
|
||||
I'm an example for a subproject!
|
||||
|
||||
@ -2,6 +2,12 @@
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
#article-list {
|
||||
article {
|
||||
padding: 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
#article-list, #subproject-list {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
@ -11,11 +17,10 @@
|
||||
--bg-overlay: var(--accent-color-alpha);
|
||||
position: relative;
|
||||
transition: var(--transition);
|
||||
border-radius: var(--rounded-corner);
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
background-color: var(--fg-contrast-soft);
|
||||
padding: 1.5rem;
|
||||
border-radius: var(--rounded-corner);
|
||||
overflow: hidden;
|
||||
|
||||
&:hover {
|
||||
|
||||
@ -103,7 +103,7 @@ video {
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
img:not(.preview) {
|
||||
transition: var(--transition-longer);
|
||||
|
||||
&:not(
|
||||
|
||||
@ -6,6 +6,19 @@
|
||||
width: calc(50% - 0.5rem);
|
||||
min-width: 300px;
|
||||
flex-grow: 1;
|
||||
|
||||
img {
|
||||
margin: 0;
|
||||
border-bottom-left-radius: 0px;
|
||||
border-bottom-right-radius: 0px;
|
||||
box-shadow: none;
|
||||
object-fit: cover;
|
||||
height: 200px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#subproject-info {
|
||||
padding: 1.5rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -24,10 +24,15 @@
|
||||
{{- article_string -}}
|
||||
</span>
|
||||
{%- endif %}
|
||||
<h3>{{ page.title }}</h3>
|
||||
{%- if page.description %}
|
||||
{{ page.description | markdown | safe }}
|
||||
{%- endif %}
|
||||
{%- if page.extra.preview -%}
|
||||
<img class="preview" src="{{ current_url ~ page.slug ~ "/" ~ page.extra.preview }}" {% if config.markdown.lazy_async_image %}decoding="async" loading="lazy"{% endif %} />
|
||||
{%- endif -%}
|
||||
<div id="subproject-info">
|
||||
<h3>{{ page.title }}</h3>
|
||||
{%- if page.description %}
|
||||
{{ page.description | markdown | safe }}
|
||||
{%- endif %}
|
||||
</div>
|
||||
</article>
|
||||
{%- endfor %}
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user