-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve prose components and optmize lessons images
- Loading branch information
1 parent
e8aaf03
commit 9b86c58
Showing
6 changed files
with
409 additions
and
19 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
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,6 +1,6 @@ | ||
<template> | ||
<code | ||
class="rounded border border-zinc-200 bg-zinc-50 px-[6px] py-[1px] font-mono text-sm font-semibold break-all" | ||
class="rounded border border-zinc-200 bg-zinc-50 px-[6px] py-[1px] font-mono text-sm font-semibold" | ||
><slot | ||
/></code> | ||
</template> |
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,39 @@ | ||
<script setup lang="ts"> | ||
import { withTrailingSlash, withLeadingSlash, joinURL } from "ufo"; | ||
const { | ||
src = "", | ||
alt = "", | ||
width = "undefined", | ||
height = "undefined", | ||
} = defineProps<{ | ||
src?: string; | ||
alt?: string; | ||
width?: string | number | undefined; | ||
height?: string | number | undefined; | ||
}>(); | ||
const refinedSrc = computed(() => { | ||
if (src?.startsWith("/") && !src.startsWith("//")) { | ||
const _base = withLeadingSlash( | ||
withTrailingSlash(useRuntimeConfig().app.baseURL) | ||
); | ||
if (_base !== "/" && !src.startsWith(_base)) { | ||
return joinURL(_base, src); | ||
} | ||
} | ||
return src; | ||
}); | ||
</script> | ||
|
||
<template> | ||
<nuxt-img | ||
format="webp" | ||
quality="80" | ||
:src="refinedSrc" | ||
:alt="alt" | ||
:width="width" | ||
:height="height" | ||
densities="x1 x1" | ||
/> | ||
</template> |
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
Oops, something went wrong.