mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-05 16:42:29 +03:00
Docs: migration from Hugo to Astro (#41251)
Co-authored-by: HiDeoo <494699+HiDeoo@users.noreply.github.com> Co-authored-by: Mark Otto <markdotto@gmail.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { getConfig } from '../libs/config.ts'
|
||||
|
||||
/**
|
||||
* Vite plugin to replace placeholder values in search.js with actual configuration values
|
||||
*/
|
||||
export function algoliaPlugin() {
|
||||
const config = getConfig()
|
||||
|
||||
return {
|
||||
name: 'algolia-config-replacer',
|
||||
transform(code, id) {
|
||||
if (id.includes('search.js')) {
|
||||
return code
|
||||
.replace(/__API_KEY__/g, config.algolia.api_key)
|
||||
.replace(/__INDEX_NAME__/g, config.algolia.index_name)
|
||||
.replace(/__APP_ID__/g, config.algolia.app_id)
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { getConfig } from '../libs/config.ts'
|
||||
|
||||
/**
|
||||
* Vite plugin to replace placeholder values in stackblitz.js with actual configuration values
|
||||
*/
|
||||
export function stackblitzPlugin() {
|
||||
const config = getConfig()
|
||||
|
||||
return {
|
||||
name: 'stackblitz-config-replacer',
|
||||
transform(code, id) {
|
||||
if (id.includes('stackblitz.js')) {
|
||||
return code
|
||||
.replace(/__CSS_CDN__/g, config.cdn.css)
|
||||
.replace(/__JS_BUNDLE_CDN__/g, config.cdn.js_bundle)
|
||||
.replace(/__DOCS_VERSION__/g, config.docs_version)
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user