/
githubmirror
/
bootstrap
Обзор
Документация
Войти
/
githubmirror
/
bootstrap
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
site/src/libs/bootstrap.ts
48 строк
1 KB
Julien Déramond
Docs: migration from Hugo to Astro (#41251)
15 апр 2025, 19:37
Не верифицирован
15 апр 2025, 19:37
a8ab199
Код
Авторство
О чём код?
import type { HTMLAttributes } from 'astro/types' import { getConfig } from '@libs/config' import { getVersionedDocsPath } from '@libs/path' export function getVersionedBsCssProps(direction: 'rtl' | undefined) { let bsCssLinkHref = '/dist/css/bootstrap' if (direction === 'rtl') { bsCssLinkHref = `${bsCssLinkHref}.rtl` } if (import.meta.env.PROD) { bsCssLinkHref = `${bsCssLinkHref}.min` } bsCssLinkHref = `${bsCssLinkHref}.css` const bsCssLinkProps: HTMLAttributes<'link'> = { href: getVersionedDocsPath(bsCssLinkHref), rel: 'stylesheet' } if (import.meta.env.PROD) { bsCssLinkProps.integrity = direction === 'rtl' ? getConfig().cdn.css_rtl_hash : getConfig().cdn.css_hash } return bsCssLinkProps } export function getVersionedBsJsProps() { let bsJsScriptSrc = '/dist/js/bootstrap.bundle' if (import.meta.env.PROD) { bsJsScriptSrc = `${bsJsScriptSrc}.min` } bsJsScriptSrc = `${bsJsScriptSrc}.js` const bsJsLinkProps: HTMLAttributes<'script'> = { src: getVersionedDocsPath(bsJsScriptSrc) } if (import.meta.env.PROD) { bsJsLinkProps.integrity = getConfig().cdn.js_bundle_hash } return bsJsLinkProps }