diff --git a/cal/src/CalList.vue b/cal/src/CalList.vue
index 391111db..82027788 100644
--- a/cal/src/CalList.vue
+++ b/cal/src/CalList.vue
@@ -8,13 +8,14 @@ import dayjs from 'dayjs'
// components:
import EventSummary from './EventSummary.vue'
import DateDivider from './DateDivider.vue'
+import NewsItem from './NewsItem.vue'
// support:
import { fetchRange } from './calList.js'
import helpers from './calHelpers.js'
import siteConfig from './siteConfig.js'
export default {
- components: { EventSummary, DateDivider },
+ components: { EventSummary, DateDivider, NewsItem },
emits: [ 'pageLoaded' ],
// called before the component is fully created
// ( doesnt have access to `this` )
@@ -70,7 +71,7 @@ export default {
class="c-day"
:data-date="day.date">
-
+
+
Social
diff --git a/cal/src/NewsItem.vue b/cal/src/NewsItem.vue
new file mode 100644
index 00000000..45079ea7
--- /dev/null
+++ b/cal/src/NewsItem.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/cal/src/calMain.js b/cal/src/calMain.js
index e43a5126..fa34770b 100644
--- a/cal/src/calMain.js
+++ b/cal/src/calMain.js
@@ -18,11 +18,12 @@ import CalBeta from './CalBeta.vue'
// the source of records displayed by CalList.
import sourcePool from './sources/sourcePool.js'
-import socialSource from './sources/socialSource.js'
+// import socialSource from './sources/socialSource.js'
import eventSource from './sources/eventSource.js'
import festivalSource from './sources/festivalSource.js'
+import newsSource from './sources/newsSource.js'
-sourcePool.register(/*socialSource, */eventSource, festivalSource);
+sourcePool.register(/*socialSource, */eventSource, festivalSource, newsSource);
// the router reads and writes the user's address bar
const router = createRouter({
diff --git a/cal/src/sources/eventSource.js b/cal/src/sources/eventSource.js
index efaa2d64..b6e30ed1 100644
--- a/cal/src/sources/eventSource.js
+++ b/cal/src/sources/eventSource.js
@@ -10,7 +10,7 @@ export default {
// eventData includes { pagination: {}, events: [] }
const eventData = await dataPool.getRange(start, end);
return eventData.events.map(evt => Object.assign(evt, {
- uid: `caldaily-${evt.id}`,
+ uid: evt.id,
// moment --> added by the event munge already
type: 'caldaily',
}));
diff --git a/cal/src/sources/newsSource.js b/cal/src/sources/newsSource.js
new file mode 100644
index 00000000..832a8299
--- /dev/null
+++ b/cal/src/sources/newsSource.js
@@ -0,0 +1,32 @@
+/**
+ */
+import dayjs from 'dayjs'
+const newsData = fetch("/news/index.json").then((response) => response.json());
+
+export default {
+ name: "newsSource",
+ // news records look like: {
+ // "name": "bridge-closure",
+ // "startdate": "2025-06-16",
+ // "title": "Bridge Closure!",
+ // "url": "/news/bridge-closure/"
+ // }
+ async getRange(start, end) {
+ const news = await newsData;
+ // the filter removes empty records
+ return news.filter(n => !!n).map(n => {
+ const d = dayjs(n.startdate).startOf('day');
+ const inRange = !d.isBefore(start) && !d.isAfter(end);
+ // returns an empty record if out of range
+ // otherwise, returns the info needed for the news item
+ return inRange && {
+ uid: n.name,
+ type: 'news',
+ moment: d,
+ nudge: Number.MIN_VALUE,
+ title: n.title,
+ url: n.url,
+ }
+ });
+ }
+}
diff --git a/cal/src/sources/sourcePool.js b/cal/src/sources/sourcePool.js
index ee1e6bbb..b9b91681 100644
--- a/cal/src/sources/sourcePool.js
+++ b/cal/src/sources/sourcePool.js
@@ -7,7 +7,7 @@ export default {
// [{uid, type, moment, title}]
//
// at a minimum, each record should contain:
- // uid: some globally unique id
+ // uid: some id unique per type
// type: used by the display to know how to render the record
// moment: a dayjs object
//
diff --git a/site/content/news/_index.md b/site/content/news/_index.md
new file mode 100644
index 00000000..bd821a36
--- /dev/null
+++ b/site/content/news/_index.md
@@ -0,0 +1,5 @@
+---
+# rendered by layout "list.json.json"
+# creates a listing of all pages in the directory
+outputs: ['json']
+---
\ No newline at end of file
diff --git a/site/content/news/bridge-closure.md b/site/content/news/bridge-closure.md
new file mode 100644
index 00000000..cd8aa0c5
--- /dev/null
+++ b/site/content/news/bridge-closure.md
@@ -0,0 +1,7 @@
+---
+title: Bridge Closure!
+description: Mobilizing bikes for the community
+startdate: 2025-06-16
+layout: news
+---
+Words words. **The Bridge** is closing.
diff --git a/site/content/news/testing.md b/site/content/news/testing.md
new file mode 100644
index 00000000..6d7702d6
--- /dev/null
+++ b/site/content/news/testing.md
@@ -0,0 +1,7 @@
+---
+startdate: 2025-06-16
+title: Testing!
+description: Mobilizing bikes for the community
+layout: news
+---
+Test!
diff --git a/site/layouts/_default/list.json.json b/site/layouts/_default/list.json.json
new file mode 100644
index 00000000..2b3ab73d
--- /dev/null
+++ b/site/layouts/_default/list.json.json
@@ -0,0 +1,11 @@
+{{- $s := slice }}
+{{- range .Pages }}
+ {{- $d := dict
+ "name" .File.ContentBaseName
+ "title" .Title
+ "url" .RelPermalink
+ "startdate" .Params.startdate
+ }}
+ {{- $s = $s | append $d }}
+{{- end }}
+{{- $s | jsonify (dict "prefix" " " "indent" " ") }}
diff --git a/site/layouts/_default/news.html b/site/layouts/_default/news.html
new file mode 100644
index 00000000..a9f49d83
--- /dev/null
+++ b/site/layouts/_default/news.html
@@ -0,0 +1 @@
+{{.Content}}
\ No newline at end of file