/
githubmirror
/
bootstrap
Обзор
Документация
Войти
/
githubmirror
/
bootstrap
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
site/src/components/shortcodes/Placeholder.astro
27 строк
565 B
Julien Déramond
Docs: migration from Hugo to Astro (#41251)
15 апр 2025, 19:37
Не верифицирован
15 апр 2025, 19:37
a8ab199
Код
Авторство
О чём код?
--- import { getPlaceholder, type PlaceholderOptions } from '@libs/placeholder' type Props = Partial<PlaceholderOptions> const { options: { background, color, showText, showTitle, text, title }, props, type } = getPlaceholder(Astro.props) --- { type === 'img' ? ( <img {...props} /> ) : ( <svg {...props}> {showTitle && <title>{title}</title>} <rect width="100%" height="100%" fill={background} /> {showText && ( <text x="50%" y="50%" fill={color} dy=".3em"> {text} </text> )} </svg> ) }