diff --git a/build/choco-theme.ts b/build/choco-theme.ts index 283174d0..e9d15a52 100644 --- a/build/choco-theme.ts +++ b/build/choco-theme.ts @@ -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') { diff --git a/build/data/preview-config.ts b/build/data/preview-config.ts index 489f9e87..c59d49a4 100644 --- a/build/data/preview-config.ts +++ b/build/data/preview-config.ts @@ -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', diff --git a/build/data/repository-config.ts b/build/data/repository-config.ts index 3844a13a..b82e2914 100644 --- a/build/data/repository-config.ts +++ b/build/data/repository-config.ts @@ -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' @@ -91,9 +92,9 @@ export const astroRepositoryConfig = { export const repositoryConfig: Record = { blog: { - ...defaultRepositoryConfig, + ...astroRepositoryConfig, name: 'blog', - language: 'hbs' + playwright: 'src/tests/' }, boxstarter: { ...defaultRepositoryConfig, diff --git a/dist/js/preview.js b/dist/js/preview.js index 779b3d54..69f0eaee 100644 --- a/dist/js/preview.js +++ b/dist/js/preview.js @@ -28,8 +28,8 @@ "--blog": { folder: "blog", port: 5082, - isStatiq: true, - isAstro: false + isStatiq: false, + isAstro: true }, "--boxstarter": { folder: "boxstarter.org", diff --git a/dist/js/preview.min.js b/dist/js/preview.min.js index 252b9b71..42412bae 100644 --- a/dist/js/preview.min.js +++ b/dist/js/preview.min.js @@ -3,7 +3,7 @@ * Copyright 2020-2024 Chocolatey Software * Licensed under MIT (https://github.com/chocolatey/choco-theme/blob/main/LICENSE) */ -(()=>{document.querySelectorAll(".dropdown-theme").forEach(o=>{o.querySelectorAll(".dropdown-toggle").forEach(r=>{r.addEventListener("hide.bs.dropdown",()=>{document.querySelectorAll("main").forEach(t=>{t.classList.remove("z-0")})}),r.addEventListener("show.bs.dropdown",()=>{document.querySelectorAll("main").forEach(t=>{t.classList.add("z-0")})})})});var a={"--blog":{folder:"blog",port:5082,isStatiq:!0,isAstro:!1},"--boxstarter":{folder:"boxstarter.org",port:5083,isStatiq:!0,isAstro:!1},"--community":{folder:"community.chocolatey.org",port:55881,isStatiq:!1,isAstro:!1,root:"/chocolatey/Website"},"--design":{folder:"choco-design-system",port:5085,isStatiq:!0,isAstro:!1},"--docs":{folder:"docs",port:5086,isStatiq:!1,isAstro:!0},"--fest":{folder:"chocolateyfest",port:5084,isStatiq:!0,isAstro:!1},"--org":{folder:"chocolatey.org",port:5081,isStatiq:!0,isAstro:!1},"--portal":{folder:"licensing-services",protocol:"https",port:44362,isStatiq:!1,isAstro:!1,root:"/source/LicensingServices"},"--zendesk":{folder:"copenhagen_theme",isStatiq:!1,isAstro:!1}};var p=document.querySelector("#tableMonitorPorts tbody"),f=document.querySelector("#templateMonitorPorts");Object.keys(a).forEach(e=>{let o=a[e],r=document.importNode(f.content,!0),t=r.querySelectorAll("td");t[1].querySelector(".badge").textContent=o.port?"Waiting":"N/A",t[2].textContent=o.port?o.port.toString():"N/A",t[3].textContent=o.folder,t[4].textContent=e;let c=r.querySelector(".monitor-link");if(o.port){let s=o.protocol?o.protocol:"http";c.href=`${s}://localhost:${o.port}`}for(let s of t)s.setAttribute("data-monitor-option",e);p.appendChild(r)});var i=new WebSocket("ws://localhost:8081");i.addEventListener("open",e=>{i.send("Hello Server!",e.data),console.log("Connected to WebSocket server")});i.addEventListener("message",e=>{let o=JSON.parse(e.data);for(let[r,t]of Object.entries(o)){let c=Object.entries(a).find(([,d])=>d.port===parseInt(r)),s=document.querySelector(`[data-monitor-option="${c[0]}"] .monitor-link`),n=document.querySelector(`[data-monitor-option="${c[0]}"].monitor-status .badge`);n.textContent=t,t==="open"?(n.classList.remove("text-bg-secondary"),n.classList.add("text-bg-success")):(n.classList.remove("text-bg-success"),n.classList.add("text-bg-secondary"));let l=s.classList.contains("opacity-0");t==="open"&&l?(s.classList.remove("opacity-0"),s.classList.remove("disabled")):t==="closed"&&!l&&(s.classList.add("opacity-0"),s.classList.add("disabled"))}});i.addEventListener("error",e=>{console.error("WebSocket error:",e)});i.addEventListener("close",()=>{console.log("Disconnected from WebSocket server")});})(); +(()=>{document.querySelectorAll(".dropdown-theme").forEach(o=>{o.querySelectorAll(".dropdown-toggle").forEach(r=>{r.addEventListener("hide.bs.dropdown",()=>{document.querySelectorAll("main").forEach(t=>{t.classList.remove("z-0")})}),r.addEventListener("show.bs.dropdown",()=>{document.querySelectorAll("main").forEach(t=>{t.classList.add("z-0")})})})});var a={"--blog":{folder:"blog",port:5082,isStatiq:!1,isAstro:!0},"--boxstarter":{folder:"boxstarter.org",port:5083,isStatiq:!0,isAstro:!1},"--community":{folder:"community.chocolatey.org",port:55881,isStatiq:!1,isAstro:!1,root:"/chocolatey/Website"},"--design":{folder:"choco-design-system",port:5085,isStatiq:!0,isAstro:!1},"--docs":{folder:"docs",port:5086,isStatiq:!1,isAstro:!0},"--fest":{folder:"chocolateyfest",port:5084,isStatiq:!0,isAstro:!1},"--org":{folder:"chocolatey.org",port:5081,isStatiq:!0,isAstro:!1},"--portal":{folder:"licensing-services",protocol:"https",port:44362,isStatiq:!1,isAstro:!1,root:"/source/LicensingServices"},"--zendesk":{folder:"copenhagen_theme",isStatiq:!1,isAstro:!1}};var p=document.querySelector("#tableMonitorPorts tbody"),f=document.querySelector("#templateMonitorPorts");Object.keys(a).forEach(e=>{let o=a[e],r=document.importNode(f.content,!0),t=r.querySelectorAll("td");t[1].querySelector(".badge").textContent=o.port?"Waiting":"N/A",t[2].textContent=o.port?o.port.toString():"N/A",t[3].textContent=o.folder,t[4].textContent=e;let c=r.querySelector(".monitor-link");if(o.port){let s=o.protocol?o.protocol:"http";c.href=`${s}://localhost:${o.port}`}for(let s of t)s.setAttribute("data-monitor-option",e);p.appendChild(r)});var i=new WebSocket("ws://localhost:8081");i.addEventListener("open",e=>{i.send("Hello Server!",e.data),console.log("Connected to WebSocket server")});i.addEventListener("message",e=>{let o=JSON.parse(e.data);for(let[r,t]of Object.entries(o)){let c=Object.entries(a).find(([,d])=>d.port===parseInt(r)),s=document.querySelector(`[data-monitor-option="${c[0]}"] .monitor-link`),n=document.querySelector(`[data-monitor-option="${c[0]}"].monitor-status .badge`);n.textContent=t,t==="open"?(n.classList.remove("text-bg-secondary"),n.classList.add("text-bg-success")):(n.classList.remove("text-bg-success"),n.classList.add("text-bg-secondary"));let l=s.classList.contains("opacity-0");t==="open"&&l?(s.classList.remove("opacity-0"),s.classList.remove("disabled")):t==="closed"&&!l&&(s.classList.add("opacity-0"),s.classList.add("disabled"))}});i.addEventListener("error",e=>{console.error("WebSocket error:",e)});i.addEventListener("close",()=>{console.log("Disconnected from WebSocket server")});})(); /*! * Configuration for repositories to be used by preview commands. * Copyright 2020-2024 Chocolatey Software