Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion gulp.d/tasks/build-preview-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ const yaml = require('js-yaml')

const ASCIIDOC_ATTRIBUTES = { experimental: '', icons: 'font', sectanchors: '', 'source-highlighter': 'highlight.js' }

const algoliaTestKeys = {
algoliaAppId: 'R2IYF7ETH7',
algoliaIndexName: 'docsearch',
algoliaApiKey: '599cec31baffa4868cae4e79f180729b',
}

module.exports = (src, previewSrc, previewDest, sink = () => map()) => (done) =>
Promise.all([
loadSampleUiModel(previewSrc),
Expand All @@ -37,7 +43,7 @@ module.exports = (src, previewSrc, previewDest, sink = () => map()) => (done) =>
for (const component of baseUiModel.site.components) {
for (const version of component.versions || []) version.asciidoc = asciidoc
}
baseUiModel = { ...baseUiModel, env: process.env }
baseUiModel = { ...baseUiModel, env: process.env, site: { ...baseUiModel.site, keys: algoliaTestKeys } }
delete baseUiModel.asciidoc
return [baseUiModel, layouts]
})
Expand Down
10 changes: 5 additions & 5 deletions gulp.d/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ module.exports = (src, dest, preview) => () => {
}),
postcssUrl([
{
filter: (asset) => new RegExp('^[~][^/]*(?:font|typeface)[^/]*/.*/files/.+[.](?:ttf|woff2?)$').test(asset.url),
filter: (asset) => new RegExp('.+[.](?:ttf|woff2?)(?:\\?[^\\s]*)?$').test(asset.url),
url: (asset) => {
const relpath = asset.pathname.substr(1)
let relpath = asset.pathname
if (relpath.includes('lucide')) relpath = `lucide-static/font/${relpath}`
if (relpath.includes('~@fontsource')) relpath = relpath.replace('~', '')
const abspath = require.resolve(relpath)
const basename = ospath.basename(abspath)
const destpath = ospath.join(dest, 'font', basename)
Expand All @@ -57,9 +59,7 @@ module.exports = (src, dest, preview) => () => {
// only run tailwindcss in preview, datastax-docs-site repo has it's own tailwind cli step
preview ? tailwindcss(tailwindconfig) : () => {},
postcssAdvancedVars,
postcssVar({ preserve: preview }),
// NOTE to make vars.css available to all top-level stylesheets, use the next line in place of the previous one
//postcssVar({ importFrom: path.join(src, 'css', 'vars.css'), preserve: preview }),
postcssVar({ preserve: true }),
preview ? postcssCalc : () => {}, // cssnano already applies postcssCalc
autoprefixer,
preview
Expand Down
Loading
Loading