-
-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add showcase shortcode - Add style for showcase shortcode = Add test page for showcase shortcode - Auto disable PWA in development environment - TODO: Further adjust the style of the shortcode - TODO: Add documentation for the shortcode
- Loading branch information
1 parent
3306a42
commit 90f7f84
Showing
8 changed files
with
181 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
$avatar-border-color: #f0f0f0; | ||
$avatar-border-color-dark: #363636; | ||
$avatar-border-color-black: #363636; | ||
|
||
$friend-link-background-color: #f8f8f8; | ||
$friend-link-background-color-dark: #252627; | ||
$friend-link-background-color-black: #111111; | ||
|
||
$friend-link-color: #2d96bd; | ||
$friend-link-color-dark: #a9a9b3; | ||
$friend-link-color-black: #d9d9d9; | ||
|
||
$friend-link-hover-color: #ef3982; | ||
$friend-link-hover-color-dark: #ffffff; | ||
$friend-link-hover-color-black: #ffffff; | ||
|
||
.showcase-box { | ||
height: 370px; | ||
margin-top: 2%; | ||
margin-left: 1%; | ||
width: 48%; | ||
display: inline-block !important; | ||
background: $friend-link-background-color; | ||
position: relative; | ||
border-radius: 5px; | ||
[theme=dark] & { | ||
background: $friend-link-background-color-dark; | ||
} | ||
[theme=black] & { | ||
background: $friend-link-background-color-black; | ||
} | ||
} | ||
|
||
.showcase-image img { | ||
width: 96%; | ||
margin: 2%; | ||
margin-bottom: 0; | ||
border-radius: 5px; | ||
height: 200px; | ||
object-fit: cover; | ||
&:hover { | ||
-webkit-transition: transform 0.4s ease; | ||
-moz-transition: transform 0.4s ease; | ||
-o-transition: transform 0.4s ease; | ||
transition: transform 0.4s ease; | ||
transform: scale(1.01); | ||
} | ||
} | ||
|
||
.showcase-title { | ||
text-overflow: ellipsis; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
position: absolute; | ||
top: 210px; | ||
width: 96%; | ||
margin: 3%; | ||
margin-left: 2%; | ||
font-size: 1.25rem; | ||
line-height: 140%; | ||
} | ||
|
||
.showcase-title a { | ||
color: black; | ||
&:hover { | ||
color: $friend-link-hover-color; | ||
} | ||
[theme=dark] & { | ||
color: $friend-link-color-dark; | ||
&:hover { | ||
color: $friend-link-hover-color-dark; | ||
} | ||
} | ||
[theme=black] & { | ||
color: $friend-link-color-black; | ||
&:hover { | ||
color: $friend-link-hover-color-black; | ||
} | ||
} | ||
} | ||
|
||
.showcase-summary { | ||
display: -webkit-box; | ||
position: absolute; | ||
width: 96%; | ||
margin-left: 2%; | ||
margin-top: 2%; | ||
text-overflow: ellipsis; | ||
overflow: hidden; | ||
height: 70px; | ||
top: 250px; | ||
-webkit-box-orient: vertical; | ||
} | ||
|
||
.showcase-link { | ||
position: absolute; | ||
bottom: 2%; | ||
left: 2%; | ||
} | ||
|
||
@media screen and (max-width: 600px) { | ||
.showcase-box { | ||
width: 100%; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
exampleSite/content/posts/tests/showcase-tests/index.en.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
title: "Showcase test" | ||
subtitle: "" | ||
date: 2021-05-26T15:30:49+01:00 | ||
lastmod: 2021-05-26T15:30:49+01:00 | ||
draft: false | ||
description: "Showcase shortcode test" | ||
categories: [Tests] | ||
hiddenFromHomePage: true | ||
toc: false | ||
pageStyle: normal | ||
--- | ||
|
||
<!--more--> | ||
|
||
{{< showcase title="Theme Documentation - Basics" summary="Discover what the Hugo - DoIt theme is all about and the core-concepts behind it." image="/theme-documentation-basics/featured-image.webp" link="/theme-documentation-basics" >}} | ||
|
||
{{< showcase title="Theme Documentation - Content" summary="Find out how to create and organize your content quickly and intuitively in DoIt theme." image="/theme-documentation-content/featured-image.webp" link="/theme-documentation-content" >}} | ||
|
||
{{< showcase title="Theme Documentation - Built-in Shortcodes" summary="Hugo provides multiple built-in shortcodes for author convenience and to keep your markdown content clean." image="/theme-documentation-built-in-shortcodes/featured-image.webp" link="/theme-documentation-built-in-shortcodes" >}} | ||
|
||
{{< showcase title="Theme Documentation - Extended Shortcodes" summary="DoIt theme provides multiple shortcodes on top of built-in ones in Hugo." image="/theme-documentation-extended-shortcodes/featured-image.webp" link="/theme-documentation-extended-shortcodes" >}} | ||
|
||
{{< showcase title="Seal!" summary="Awww" image="https://i.pinimg.com/originals/b8/75/9a/b8759a1b9575a1f938a16f7b5c5287fe.jpg" link="https://i.pinimg.com/originals/b8/75/9a/b8759a1b9575a1f938a16f7b5c5287fe.jpg" >}} | ||
|
||
{{< showcase title="Cat!" summary="Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ Miaow~ " image="https://img.webmd.com/dtmcms/live/webmd/consumer_assets/site_images/article_thumbnails/other/cat_relaxing_on_patio_other/1800x1200_cat_relaxing_on_patio_other.jpg" link="https://img.webmd.com/dtmcms/live/webmd/consumer_assets/site_images/article_thumbnails/other/cat_relaxing_on_patio_other/1800x1200_cat_relaxing_on_patio_other.jpg" >}} |
2 changes: 1 addition & 1 deletion
2
...leSite/resources/_gen/assets/scss/css/style.scss_d75fd08668b4bae707167bbce4d8ca46.content
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{{ if .IsNamedParams }} | ||
{{- $image := .Get "image" -}} | ||
{{- $title := .Get "title" -}} | ||
{{- $link := .Get "link" -}} | ||
<div class="showcase-box"> | ||
<div class="showcase-image"> | ||
<a href={{ $link }}> | ||
{{- dict "Src" $image "Height" "200" "Width" "400" "Title" $title | partial "plugin/image.html" -}} | ||
</a> | ||
</div> | ||
<h1 class="showcase-title"> | ||
<a href={{ $link }}>{{ $title }}</a> | ||
</h1> | ||
<p class="showcase-summary"> | ||
{{ .Get "summary" }} | ||
</p> | ||
<a class="showcase-link" href={{ $link }}> | ||
Read more... | ||
</a> | ||
</div> | ||
{{- else -}} | ||
{{ end }} |