Skip to content

Commit 43e0869

Browse files
committed
docs: prepare docs for canary releases
1 parent 95b1f69 commit 43e0869

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

build/generate-sri.mjs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@ import fs from 'node:fs'
1414
import path from 'node:path'
1515
import { fileURLToPath } from 'node:url'
1616
import sh from 'shelljs'
17+
import pkg from '../package.json' with { type: 'json' }
1718

1819
const __dirname = path.dirname(fileURLToPath(import.meta.url))
1920

2021
sh.config.fatal = true
2122

2223
const configFile = path.join(__dirname, '../hugo.yml')
24+
const isCanaryVersion = pkg.version.includes('canary')
25+
26+
console.log(isCanaryVersion)
2327

2428
// Array of objects which holds the files to generate SRI hashes for.
2529
// `file` is the path from the root folder
@@ -69,12 +73,13 @@ for (const { file, configPropertyName } of files) {
6973
throw error
7074
}
7175

76+
const propertyName = isCanaryVersion ? `canary_${configPropertyName}` : configPropertyName
7277
const algorithm = 'sha384'
7378
const hash = crypto.createHash(algorithm).update(data, 'utf8').digest('base64')
7479
const integrity = `${algorithm}-${hash}`
7580

76-
console.log(`${configPropertyName}: ${integrity}`)
81+
console.log(`${propertyName}: ${integrity}`)
7782

78-
sh.sed('-i', new RegExp(`^(\\s+${configPropertyName}:\\s+["'])\\S*(["'])`), `$1${integrity}$2`, configFile)
83+
sh.sed('-i', new RegExp(`^(\\s+${propertyName}:\\s+["'])\\S*(["'])`), `$1${integrity}$2`, configFile)
7984
})
8085
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<div class="docs-callout docs-callout-info">
2+
<p>
3+
<strong>Canary Releases</strong>
4+
</p>
5+
<p>
6+
CoreUI provides canary releases, enabling you to test new, unreleased features as soon as our team determines that the latest version is ready to ship; however, we want to conduct additional tests before the final release.
7+
</p>
8+
Canary versions provide early access to upcoming changes, enabling developers to experiment with new functionalities before they are officially released. This is a great way to provide feedback to maintainers and ensure that the latest improvements work as expected.
9+
</p>
10+
</div>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{- if $.Site.Params.cdn.canary_css -}}
2+
{{- .Inner | markdownify -}}
3+
{{- end -}}

0 commit comments

Comments
 (0)