-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from LR-Tech-Blog/image-post-href
- Loading branch information
Showing
14 changed files
with
1,779 additions
and
2,342 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,42 @@ | ||
--- | ||
import type { AuthorProfile } from "../scripts/types/post_types"; | ||
import { AuthorProfileImageType } from "../scripts/types/post_types" | ||
import { AuthorProfileImageType } from "../scripts/types/post_types"; | ||
import { getGravatarImageUrl } from "../scripts/utils"; | ||
import { Image } from 'astro:assets'; | ||
import undefinedImage from "../images/undefined.jpg"; | ||
import { Image } from "astro:assets"; | ||
interface Props { | ||
adm: AuthorProfile | ||
adm: AuthorProfile; | ||
} | ||
const imageSize = 200 | ||
const imageSize = 200; | ||
const { adm } = Astro.props | ||
const { adm } = Astro.props; | ||
//TODO: Add default user image | ||
const imageUrl = adm.profileImageType === AuthorProfileImageType.Gravatar ? getGravatarImageUrl(adm.email, imageSize) : adm.profileImageUrl ?? "" | ||
const imageUrl = | ||
adm.profileImageType === AuthorProfileImageType.Gravatar | ||
? getGravatarImageUrl(adm.email, imageSize) | ||
: adm.profileImageUrl; | ||
const imageAlt = adm.profileImageAlt ?? adm.name; | ||
console.log(imageUrl); | ||
--- | ||
<Image class="rounded-xl object-cover" src={imageUrl} alt={adm.profileImageAlt} | ||
width={imageSize} height={imageSize}> | ||
|
||
{ | ||
imageUrl === null ? ( | ||
<Image | ||
class="rounded-xl object-cover" | ||
src={undefinedImage} | ||
alt={imageAlt} | ||
width={imageSize} | ||
height={imageSize} | ||
/> | ||
) : ( | ||
<Image | ||
class="rounded-xl object-cover" | ||
src={imageUrl} | ||
alt={imageAlt} | ||
width={imageSize} | ||
height={imageSize} | ||
/> | ||
) | ||
} |
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,11 @@ | ||
--- | ||
interface Props { | ||
kbKey: string | ||
} | ||
const { kbKey } = Astro.props | ||
--- | ||
|
||
<kbd class="kdb text-text dark:text-dark_text"> | ||
{kbKey} | ||
</kbd> |
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 |
---|---|---|
@@ -1,9 +1,12 @@ | ||
--- | ||
import { Image } from 'astro:assets'; | ||
import { Image } from "astro:assets"; | ||
import lrLogo from "../images/lr_logo.png" | ||
const logoAlt = "Logo LR Tech Blog" | ||
--- | ||
|
||
<div class="saturate-100 hue-rotate-30 btn btn-ghost h-auto"> | ||
<a href="/"> | ||
<img src="/images/lr_logo.png" alt="logo-blog" class="transition hover:scale-105" width="90"/> | ||
<Image class:list={"transition hover:scale-105"} src={lrLogo} alt={logoAlt} width={90} /> | ||
</a> | ||
</div> |
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,32 @@ | ||
--- | ||
import type { PostImage } from "../scripts/types/post_types"; | ||
interface Props { | ||
image: PostImage; | ||
} | ||
const { image } = Astro.props; | ||
const { src, alt, href } = image; | ||
--- | ||
|
||
{ | ||
href === undefined ? ( | ||
<img | ||
src={src} | ||
alt={alt} | ||
class="relative rounded-xl mb-5 | ||
h-96 w-screen shadow-md object-cover" | ||
transition:animate="slide" | ||
/> | ||
) : ( | ||
<a href={href} target="_blank"> | ||
<img | ||
src={src} | ||
alt={alt} | ||
class="relative rounded-xl mb-5 | ||
h-96 w-screen shadow-md object-cover" | ||
transition:animate="slide" | ||
/> | ||
</a> | ||
) | ||
} |
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
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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