diff --git a/DEVLOG.md b/DEVLOG.md index 6c06062..ffe213a 100644 --- a/DEVLOG.md +++ b/DEVLOG.md @@ -11,3 +11,14 @@ Added a new `Server Observations` forecast screen that blends Linux server telem - added the screen to the initial progress display list and tightened the progress screen typography so the extra row fits cleanly - updated navigation handling to safely work with sparse display arrays introduced by the new nav slot - updated the frontend build so generated CSS is copied to the development-served stylesheet path as well + +## Linux News: LWN + +Added a new `Linux News: LWN` screen that pulls current stories from the LWN homepage and presents them as readable, TV-friendly pages in the forecast rotation. + +- added `/api/linux-news` to fetch `https://lwn.net/` and parse homepage headlines, blurbs, and article links +- created a new `linuxnews` display module, EJS partial, and SCSS styling +- paginated the LWN feed into 4 screens with 2 stories per page and enabled the display by default +- registered the new screen in the main display deck and included it in the startup/progress screen list +- tightened the story card layout to prevent page bleed and overlapping text between stacked pages +- shortened LWN blurbs and reduced headline/body typography so long top-slot stories fit cleanly inside the 512x250 content box diff --git a/gulp/publish-frontend.mjs b/gulp/publish-frontend.mjs index 0a42030..3ff65cf 100644 --- a/gulp/publish-frontend.mjs +++ b/gulp/publish-frontend.mjs @@ -87,6 +87,8 @@ const mjsSources = [ 'server/scripts/modules/progress.mjs', 'server/scripts/modules/media.mjs', 'server/scripts/modules/custom-scroll-text.mjs', + 'server/scripts/modules/serverobservations.mjs', + 'server/scripts/modules/linuxnews.mjs', 'server/scripts/index.mjs', ]; diff --git a/index.mjs b/index.mjs index e00b588..0f5e1e8 100644 --- a/index.mjs +++ b/index.mjs @@ -14,6 +14,70 @@ import devTools from './src/com.chrome.devtools.mjs'; const execAsync = promisify(exec); +const decodeHtml = (text) => text + .replace(/ /g, ' ') + .replace(/&/g, '&') + .replace(/"/g, '"') + .replace(/'/g, "'") + .replace(/’/g, "'") + .replace(/‘/g, "'") + .replace(/“/g, '"') + .replace(/”/g, '"') + .replace(/—/g, '-') + .replace(/–/g, '-') + .replace(/…/g, '...') + .replace(/(\d+);/g, (_, code) => String.fromCharCode(Number(code))); + +const stripHtml = (text) => decodeHtml(text + .replace(/ + <% } %> @@ -137,6 +138,9 @@