diff options
Diffstat (limited to 'src/data/things/news-entry.js')
-rw-r--r-- | src/data/things/news-entry.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/data/things/news-entry.js b/src/data/things/news-entry.js new file mode 100644 index 00000000..43911410 --- /dev/null +++ b/src/data/things/news-entry.js @@ -0,0 +1,27 @@ +import Thing from './thing.js'; + +export class NewsEntry extends Thing { + static [Thing.referenceType] = 'news-entry'; + + static [Thing.getPropertyDescriptors] = () => ({ + // Update & expose + + name: Thing.common.name('Unnamed News Entry'), + directory: Thing.common.directory(), + date: Thing.common.simpleDate(), + + content: Thing.common.simpleString(), + + // Expose only + + contentShort: { + flags: {expose: true}, + + expose: { + dependencies: ['content'], + + compute: ({content}) => content.split('<hr class="split">')[0], + }, + }, + }); +} |