|
1 | 1 | const assert = require('assert')
|
2 | 2 |
|
3 | 3 | class ContentTree {
|
4 |
| - constructor() {} |
| 4 | + constructor(tree) { |
| 5 | + this.tree = tree |
| 6 | + } |
5 | 7 | }
|
6 | 8 |
|
7 | 9 | class ContentTreeEntry {
|
8 |
| - constructor({ name, pathway, timestamp, content, children }) { |
9 |
| - this.name = assert(typeof name === 'string') || name |
10 |
| - this.pathway = assert(pathway instanceof Array) || pathway |
11 |
| - this.timestamp = assert(Number.isInteger(timestamp)) || timestamp |
12 |
| - this.content = assert(!content || typeof content ==='string') || content |
13 |
| - this.children = assert(!children || children instanceof Array) || children |
| 10 | + constructor({ type, data, subTree }) { |
| 11 | + this.type = assert(typeof type === 'string') || type |
| 12 | + this.data = assert(data instanceof Array) || data |
| 13 | + this.subTree = assert(Number.isInteger(subTree)) || subTree |
14 | 14 | }
|
15 | 15 | }
|
16 | 16 |
|
17 | 17 | module.exports = {
|
18 | 18 | ContentTree,
|
19 | 19 | ContentTreeEntry,
|
20 | 20 | }
|
21 |
| - |
22 |
| -const postsJSON = [ |
23 |
| - { |
24 |
| - "type": "text", |
25 |
| - "title": "Olay ve Olasılık", |
26 |
| - "cover": "/turkce/olay-ve-olasilik/sorgular.jpg", |
27 |
| - "media": "", |
28 |
| - "summary": "<h3>Ağaç sorguları</h3>\n<p>Ağaçlarda kendimizi görebiliriz. Sınırsız şekillerde dallar her göz için farklı kesişir.\nAkla basit gelen bir dizi genetik kuralın sonucu olarak bu ağaçlar bizi farklı düşlere koyar.\n", |
29 |
| - "tags": [ |
30 |
| - { |
31 |
| - "tag": "deneme", |
32 |
| - "slug": "deneme", |
33 |
| - "permalink": "/tags/deneme" |
34 |
| - } |
35 |
| - ], |
36 |
| - "date": "2022-12-31, 00:43", |
37 |
| - "coverAlt": "Ağaçlar olasılıklarını dallarıyla olaya döker", |
38 |
| - "coverShape": "roundTop", |
39 |
| - "coverPosition": "center bottom", |
40 |
| - "musiclist": [ |
41 |
| - "Boards of Canada - Sunshine Recorder", |
42 |
| - "Massive Attack - Pray for Rain", |
43 |
| - "Massive Attack - I Against I", |
44 |
| - "Duman - Dibine Kadar" |
45 |
| - ], |
46 |
| - "slug": "olay-ve-olasilik", |
47 |
| - "permalink": "/turkce/olay-ve-olasilik", |
48 |
| - "category": { |
49 |
| - "name": "Türkçe", |
50 |
| - "permalink": "/turkce" |
51 |
| - }, |
52 |
| - "path": "Türkçe/Olay ve Olasılık/post.md", |
53 |
| - "handle": "Türkçe/Olay ve Olasılık", |
54 |
| - "foldered": true, |
55 |
| - "localAssets": [ |
56 |
| - { |
57 |
| - "name": "ben.jpg", |
58 |
| - "path": "Türkçe/Olay ve Olasılık/ben.jpg", |
59 |
| - "depth": 2, |
60 |
| - "extension": ".jpg", |
61 |
| - "isFolder": false, |
62 |
| - "type": "localAsset" |
63 |
| - }, |
64 |
| - { |
65 |
| - "name": "sorgular.jpg", |
66 |
| - "path": "Türkçe/Olay ve Olasılık/sorgular.jpg", |
67 |
| - "depth": 2, |
68 |
| - "extension": ".jpg", |
69 |
| - "isFolder": false, |
70 |
| - "type": "localAsset" |
71 |
| - } |
72 |
| - ], |
73 |
| - "publishDate": "2022-12-30T21:43:00.000Z", |
74 |
| - "publishDateUTC": "Fri, 30 Dec 2022 21:43:00 GMT", |
75 |
| - "publishDateFull": "Saturday, December 31, 2022", |
76 |
| - "publishDateLong": "December 31, 2022", |
77 |
| - "publishDateMedium": "Dec 31, 2022", |
78 |
| - "publishDateShort": "12/31/22", |
79 |
| - "links": { |
80 |
| - "previousPost": { |
81 |
| - "title": "Herhangi bir text post", |
82 |
| - "permalink": "/turkce/herhangi-bir-text-post.html" |
83 |
| - }, |
84 |
| - "relevantPosts": [], |
85 |
| - "mentionedTo": [], |
86 |
| - "mentionedBy": [] |
87 |
| - } |
88 |
| - } |
89 |
| -] |
90 |
| - |
91 |
| -const linksJSON = [ |
92 |
| - { |
93 |
| - "url": "https://www.smashingmagazine.com/2018/04/best-practices-grid-layout", |
94 |
| - "title": "Best Practices With CSS Grid Layout", |
95 |
| - "tags": [ |
96 |
| - "css", |
97 |
| - "grid", |
98 |
| - "frontend" |
99 |
| - ], |
100 |
| - "datePublished": 1532221014000 |
101 |
| - }, |
102 |
| - { |
103 |
| - "url": "https://www.wikiwand.com/en/Emergence", |
104 |
| - "title": "Emergence", |
105 |
| - "tags": [ |
106 |
| - "philosophy", |
107 |
| - "science", |
108 |
| - "art", |
109 |
| - "wiki" |
110 |
| - ], |
111 |
| - "datePublished": 1532255602000 |
112 |
| - } |
113 |
| -] |
0 commit comments