Skip to content

Commit

Permalink
(#424) Update build configs for blog on Astro
Browse files Browse the repository at this point in the history
This updates the build config files to build choco-theme for an Astro
site as opposed to a Statiq site. This will take effect on
blog.chocolatey.org.
  • Loading branch information
st3phhays authored and alexaveldanez committed Dec 2, 2024
1 parent 17d669f commit 401add9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 22 deletions.
15 changes: 0 additions & 15 deletions build/choco-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,21 +287,6 @@ const init = async () => {
}));
console.log('✅ Copying of choco-theme complete');

// If blog repository, update Program.cs
if (repository.name === repositoryConfig.blog.name) {
console.log('🚀 Updating Program.cs with AlertText.html...');
await updateContent({
destination: `${repositoryConfig.theme.root}partials/`,
targetFile: 'Program.cs',
targetFileDestination: repository.root,
targetFileContentToReplace: '"TopNoticeText", ""',
replaceWithContent: 'AlertText.html',
replacementContentIsFile: true,
replacementTemplate: '"TopNoticeText", "{0}"'
});
console.log('✅ Program.cs updated');
}

// Change CSS content
// Font Awesome
if (repository.name === repositoryConfig.portal.name || repository.name === repositoryConfig.ccm.name || repository.language === 'astro') {
Expand Down
4 changes: 2 additions & 2 deletions build/data/preview-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export const folderMapping: FolderMapping = {
'--blog': {
folder: 'blog',
port: 5082,
isStatiq: true,
isAstro: false
isStatiq: false,
isAstro: true
},
'--ccm': {
folder: 'choco-licensed-management-ui',
Expand Down
5 changes: 3 additions & 2 deletions build/data/repository-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const astroRepositoryConfig = {
'src/**/*.mdx',
'src/**/*.js',
'src/**/*.ts',
'src/**/*.json',
'public/**/*.js',
'node_modules/choco-astro/src/**/*.astro',
'node_modules/choco-astro/src/**/*.ts'
Expand All @@ -91,9 +92,9 @@ export const astroRepositoryConfig = {

export const repositoryConfig: Record<string, RepositoryConfig> = {
blog: {
...defaultRepositoryConfig,
...astroRepositoryConfig,
name: 'blog',
language: 'hbs'
playwright: 'src/tests/'
},
boxstarter: {
...defaultRepositoryConfig,
Expand Down
4 changes: 2 additions & 2 deletions dist/js/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"--blog": {
folder: "blog",
port: 5082,
isStatiq: true,
isAstro: false
isStatiq: false,
isAstro: true
},
"--boxstarter": {
folder: "boxstarter.org",
Expand Down
2 changes: 1 addition & 1 deletion dist/js/preview.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 401add9

Please sign in to comment.