diff --git a/website/node/news.mjs b/website/node/news.mjs
index 39328508..3d82c37d 100644
--- a/website/node/news.mjs
+++ b/website/node/news.mjs
@@ -4,6 +4,8 @@ import {randomUUID} from 'node:crypto';
import {readFile} from 'node:fs/promises';
import {json} from './game-link.mjs';
import {OFFICIAL_ACCOUNT} from './official-account.mjs';
+export const BETA_NEWS_SOURCE='announcement:beta-1-0-0-0';
+export const BETA_NEWS_ARTWORK='assets/happy-beta-launch.png';
export const NEWS_CATEGORIES={world:'World',news:'NEWS',maintenance:'Maintenance',changelogs:'Changelogs',events:'Events',community:'Community',unis_blog:"Uni’s Blog"};
export function publicNewsExcerpt(body){return String(body||'').replace(/!\[[^\]]*\]\([^)]*\)/g,'').replace(/\[([^\]]+)\]\([^)]*\)/g,'$1').replace(/^\s*#{1,6}\s+/gm,'').replace(/[*_`]/g,'').replace(/\s+/g,' ').trim().slice(0,220);}
export async function initializeNews(db){
@@ -28,11 +30,11 @@ export function createPublicNews(db){return async request=>{
try{return json(await nativeForumFeed(page));}catch{return json({message:'Forum updates are temporarily unavailable.'},503);}
}
const match=url.pathname.match(/^\/api\/news\/([0-9a-f-]{36})$/i);
- if(match){const post=await db.prepare("SELECT p.id,p.title,p.body,p.category,p.published_at,c.label,c.artwork,COALESCE(a.display_name,a.username,'DuneRealms') AS author_name FROM website_posts p JOIN website_post_categories c ON c.category_key=p.category LEFT JOIN site_accounts a ON a.id=p.author_id WHERE p.id=? AND p.status='published' AND p.published_at<=?").bind(match[1],Date.now()).first();return post?json({post:(await forumLinks(db,[{...post,publisher:GAZETTE_NAME}]))[0]}):json({message:'Post not found'},404);}
+ if(match){const post=await db.prepare("SELECT p.id,p.title,p.body,p.category,p.published_at,c.label,CASE WHEN p.source_key='announcement:beta-1-0-0-0' THEN 'assets/happy-beta-launch.png' ELSE c.artwork END AS artwork,COALESCE(a.display_name,a.username,'DuneRealms') AS author_name FROM website_posts p JOIN website_post_categories c ON c.category_key=p.category LEFT JOIN site_accounts a ON a.id=p.author_id WHERE p.id=? AND p.status='published' AND p.published_at<=?").bind(match[1],Date.now()).first();return post?json({post:(await forumLinks(db,[{...post,publisher:GAZETTE_NAME}]))[0]}):json({message:'Post not found'},404);}
if(url.pathname!=='/api/news')return json({message:'Not found'},404);
const page=Number(url.searchParams.get('page')||1),archive=url.searchParams.get('surface')==='archive',size=archive?25:5;
if(!Number.isSafeInteger(page)||page<1||page>1000000)return json({message:'Invalid page'},400);
const count=await db.prepare("SELECT COUNT(*) AS count FROM website_posts WHERE status='published' AND published_at<=?").bind(Date.now()).first();
- const {results}=await db.prepare("SELECT p.id,p.title,p.body,p.category,p.published_at,c.label,c.artwork,COALESCE(a.display_name,a.username,'DuneRealms') AS author_name FROM website_posts p JOIN website_post_categories c ON c.category_key=p.category LEFT JOIN site_accounts a ON a.id=p.author_id WHERE p.status='published' AND p.published_at<=? ORDER BY p.published_at DESC,p.id DESC LIMIT ? OFFSET ?").bind(Date.now(),size,(page-1)*size).all();
+ const {results}=await db.prepare("SELECT p.id,p.title,p.body,p.category,p.published_at,c.label,CASE WHEN p.source_key='announcement:beta-1-0-0-0' THEN 'assets/happy-beta-launch.png' ELSE c.artwork END AS artwork,COALESCE(a.display_name,a.username,'DuneRealms') AS author_name FROM website_posts p JOIN website_post_categories c ON c.category_key=p.category LEFT JOIN site_accounts a ON a.id=p.author_id WHERE p.status='published' AND p.published_at<=? ORDER BY p.published_at DESC,p.id DESC LIMIT ? OFFSET ?").bind(Date.now(),size,(page-1)*size).all();
return json({posts:await forumLinks(db,results.map(p=>({...p,publisher:GAZETTE_NAME,body:publicNewsExcerpt(p.body)}))),page,pages:Math.max(1,Math.ceil(Number(count.count)/size)),total:Number(count.count)});
};}
diff --git a/website/node/search-visibility.mjs b/website/node/search-visibility.mjs
index c7a1404f..478533ce 100644
--- a/website/node/search-visibility.mjs
+++ b/website/node/search-visibility.mjs
@@ -1,5 +1,5 @@
import {renderNewsBody} from './news-format.mjs';
-import {forumLinks,NEWS_CATEGORIES} from './news.mjs';
+import {forumLinks,NEWS_CATEGORIES,BETA_NEWS_SOURCE,BETA_NEWS_ARTWORK} from './news.mjs';
import {SHARED_HEADER,SHARED_HEAD} from '../scripts/portal-navigation.mjs';
const base='https://www.dunerealms.com';
const esc=v=>String(v??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
@@ -13,7 +13,7 @@ const pages={
'/staff.html':['DuneRealms Staff & Contributors','Meet the DuneRealms community staff and project contributors.']
};
export const newsPath=p=>'/news/'+p.title.toLowerCase().normalize('NFKD').replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'').slice(0,75)+'-'+p.id;
-const published="SELECT p.id,p.title,p.body,p.category,p.published_at,p.updated_at,COALESCE(a.display_name,a.username,'DuneRealms') author_name FROM website_posts p LEFT JOIN site_accounts a ON a.id=p.author_id WHERE p.status='published' AND p.published_at<=?";
+const published="SELECT p.id,p.source_key,p.title,p.body,p.category,p.published_at,p.updated_at,COALESCE(a.display_name,a.username,'DuneRealms') author_name FROM website_posts p LEFT JOIN site_accounts a ON a.id=p.author_id WHERE p.status='published' AND p.published_at<=?";
const ld=data=>'';
function metadata(html,{title,description,canonical,type='website',image=base+'/assets/dunerealms-season-logo-v2.png',structured}){
html=html.replace(/
[\s\S]*?<\/title>/i,'').replace(/]*(?:name=["'](?:description|robots|twitter:[^"']+)["']|property=["']og:[^"']+["']))[^>]*>/gi,'').replace(/]*rel=["']canonical["'])[^>]*>/gi,'');
@@ -37,7 +37,7 @@ export function createSearchVisibility(db){
const p=await db.prepare(published+' AND p.id=?').bind(Date.now(),id).first();if(!p)return new Response('News post not found',{status:404,headers:{'X-Robots-Tag':'noindex'}});
const path=newsPath(p);if(legacy||u.pathname!==path)return Response.redirect(base+path,301);
const description=p.body.replace(/\s+/g,' ').slice(0,160),date=new Date(Number(p.published_at)).toISOString();
- const art='/assets/news-'+(['world','news','maintenance','changelogs','events','community'].includes(p.category)?p.category:'news')+'.webp';
+ const art=p.source_key===BETA_NEWS_SOURCE?'/'+BETA_NEWS_ARTWORK:'/assets/news-'+(['world','news','maintenance','changelogs','events','community'].includes(p.category)?p.category:'news')+'.webp';
const linked=(await forumLinks(db,[p]))[0],byline='