Add links to news items
authorVik Fearing <vik@chouppes.com>
Mon, 28 Aug 2023 11:50:55 +0000 (13:50 +0200)
committerVik Fearing <vik@chouppes.com>
Mon, 28 Aug 2023 11:50:55 +0000 (13:50 +0200)
static/js/pgdayuk.js

index 1802395e21b4f7686b13be418ab125c5d5c056a0..01a9444da2dd517dba07f9ffe2665d9add5c3684 100644 (file)
@@ -12,9 +12,13 @@ async function update_frontpage_news(url) {
            let article = document.createElement('article');
            article.className = 'newsWrapper';
 
+           let link = document.createElement('a');
+           link.href = n.url;
+           link.innerText = n.title;
+
            let title = document.createElement('h1');
            title.className = 'newsTitle';
-           title.innerText = n.title;
+           title.appendChild(link);
            article.appendChild(title);
 
            let dateandbyline = document.createElement('p');