Skip to content

Commit

Permalink
fix(all): pages handling, links and other serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
kuus committed Sep 28, 2022
1 parent 97acb01 commit f009f03
Show file tree
Hide file tree
Showing 86 changed files with 3,252 additions and 2,967 deletions.
191 changes: 97 additions & 94 deletions __mocks__/.kjam/byRoute.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
{
"spaces": {
"projects": {
"en": {
"dir": "spaces",
"dir": "projects",
"locale": "en",
"body": "",
"excerpt": "",
"data": {},
"id": "spaces",
"templateSlug": "spaces",
"slug": "spaces",
"url": "/spaces"
"id": "projects",
"templateSlug": "projects",
"slug": "projects",
"url": "/projects"
},
"it": {
"dir": "spaces",
"dir": "projects",
"locale": "it",
"body": "",
"excerpt": "",
"data": {},
"id": "spaces",
"templateSlug": "spazi",
"slug": "spazi",
"url": "/spazi"
"id": "projects",
"templateSlug": "progetti",
"slug": "progetti",
"url": "/progetti"
}
},
"projects": {
"spaces": {
"en": {
"dir": "projects",
"dir": "spaces",
"locale": "en",
"body": "",
"excerpt": "",
"data": {},
"id": "projects",
"templateSlug": "projects",
"slug": "projects",
"url": "/projects"
"id": "spaces",
"templateSlug": "spaces",
"slug": "spaces",
"url": "/spaces"
},
"it": {
"dir": "projects",
"dir": "spaces",
"locale": "it",
"body": "",
"excerpt": "",
"data": {},
"id": "projects",
"templateSlug": "progetti",
"slug": "progetti",
"url": "/progetti"
"id": "spaces",
"templateSlug": "spazi",
"slug": "spazi",
"url": "/spazi"
}
},
"events/another-event": {
Expand Down Expand Up @@ -81,78 +81,17 @@
"id": "events/event-name",
"templateSlug": "events/nome-evento",
"slug": "nome-evento",
"url": "/eventi/nome-evento"
}
},
"spaces/hospitality": {
"en": {
"dir": "spaces/hospitality",
"locale": "en",
"body": "",
"excerpt": "",
"data": {},
"id": "spaces/hospitality",
"templateSlug": "spaces/hospitality",
"slug": "hospitality",
"url": "/spaces/hospitality"
},
"it": {
"dir": "spaces/hospitality",
"locale": "it",
"body": "\n# Links\n\n- Test [link](../indoor/kitchen)\n- Test [link](https://raw.githubusercontent.com///main/spaces/indoor/kitchen)\n- Test [link](/spaces/indoor/kitchen)\n- Test [link](https://example.com)\n- Test [link](#hash-test)\n- Test [link](//example.com)\n- Test [link spanningon multiple lines](https://raw.githubusercontent.com///main/spaces/indoor/kitchen)\n",
"excerpt": "- Test link- Test link- Test link- Test link- Test link- Test link- Test link spanningon multiple lines",
"data": {},
"id": "spaces/hospitality",
"templateSlug": "spaces/ospitalita",
"slug": "ospitalita",
"url": "/spazi/ospitalita"
"url": "/events/nome-evento"
}
},
"spaces/outdoor": {
"en": {
"dir": "spaces/outdoor",
"locale": "en",
"body": "",
"excerpt": "",
"data": {},
"id": "spaces/outdoor",
"templateSlug": "spaces/living-outside",
"slug": "living-outside",
"url": "/spaces/living-outside"
},
"it": {
"dir": "spaces/outdoor",
"locale": "it",
"body": "",
"excerpt": "",
"data": {},
"id": "spaces/outdoor",
"templateSlug": "spaces/all-aperto",
"slug": "all-aperto",
"url": "/spazi/all-aperto"
}
},
"about": {
"en": {
"dir": "pages/about",
"locale": "en",
"body": "",
"excerpt": "",
"data": {},
"id": "about",
"templateSlug": "about-us",
"slug": "about-us",
"url": "/about-us"
}
},
"events": {
"pages/events": {
"en": {
"dir": "pages/events",
"locale": "en",
"body": "",
"excerpt": "",
"data": {},
"id": "events",
"id": "pages/events",
"templateSlug": "events",
"slug": "events",
"url": "/events"
Expand All @@ -163,24 +102,40 @@
"body": "",
"excerpt": "",
"data": {},
"id": "events",
"id": "pages/events",
"templateSlug": "eventi",
"slug": "eventi",
"url": "/eventi"
}
},
"home": {
"pages/about": {
"en": {
"dir": "pages/about",
"locale": "en",
"body": "\n[A relative link to the events page](/events)\n",
"excerpt": "A relative link to the events page",
"data": {
"link": "/events",
"link2": "[link](/events)"
},
"id": "pages/about",
"templateSlug": "about-us",
"slug": "about-us",
"url": "/about-us"
}
},
"pages/home": {
"en": {
"dir": "pages/home",
"locale": "en",
"body": "",
"excerpt": "",
"data": {
"attachment": "https://raw.githubusercontent.com///main/some/relative/file.pdf",
"attachment2": "https://raw.githubusercontent.com///main/pages/home/another/file.ogg",
"attachment3": "https://raw.githubusercontent.com///main/pages/third/file.mp3"
"attachment": "https://api.test/username/repo/branch/some/relative/file.pdf",
"attachment2": "https://api.test/username/repo/branch/pages/home/another/file.ogg",
"attachment3": "https://api.test/username/repo/branch/pages/third/file.mp3"
},
"id": "home",
"id": "pages/home",
"templateSlug": "",
"slug": "",
"url": "/"
Expand All @@ -191,7 +146,7 @@
"body": "",
"excerpt": "",
"data": {},
"id": "home",
"id": "pages/home",
"templateSlug": "",
"slug": "",
"url": "/"
Expand Down Expand Up @@ -221,6 +176,54 @@
"url": "/progetti/titolo-progetto"
}
},
"spaces/hospitality": {
"en": {
"dir": "spaces/hospitality",
"locale": "en",
"body": "",
"excerpt": "",
"data": {},
"id": "spaces/hospitality",
"templateSlug": "spaces/hospitality",
"slug": "hospitality",
"url": "/spaces/hospitality"
},
"it": {
"dir": "spaces/hospitality",
"locale": "it",
"body": "\n# Links\n\n- Test [link](/spazi/indoor/cucina)\n- Test [link](https://api.test/username/repo/branch/spaces/indoor/kitchen)\n- Test [link](/spazi/indoor/cucina)\n- Test [link](https://example.com)\n- Test [link](#hash-test)\n- Test [link](//example.com)\n- Test [link spanningon multiple lines](https://api.test/username/repo/branch/spaces/indoor/kitchen)\n",
"excerpt": "- Test link- Test link- Test link- Test link- Test link- Test link- Test link spanningon multiple lines",
"data": {},
"id": "spaces/hospitality",
"templateSlug": "spaces/ospitalita",
"slug": "ospitalita",
"url": "/spazi/ospitalita"
}
},
"spaces/outdoor": {
"en": {
"dir": "spaces/outdoor",
"locale": "en",
"body": "",
"excerpt": "",
"data": {},
"id": "spaces/outdoor",
"templateSlug": "spaces/living-outside",
"slug": "living-outside",
"url": "/spaces/living-outside"
},
"it": {
"dir": "spaces/outdoor",
"locale": "it",
"body": "",
"excerpt": "",
"data": {},
"id": "spaces/outdoor",
"templateSlug": "spaces/all-aperto",
"slug": "all-aperto",
"url": "/spazi/all-aperto"
}
},
"spaces/indoor/hall": {
"en": {
"dir": "spaces/indoor/hall",
Expand Down Expand Up @@ -389,4 +392,4 @@
"url": "/spazi/all-aperto/stagioni/inverno"
}
}
}
}
10 changes: 5 additions & 5 deletions __mocks__/.kjam/entries/__en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"body": "",
"excerpt": "",
"data": {
"attachment": "https://raw.githubusercontent.com///main/some/relative/file.pdf",
"attachment2": "https://raw.githubusercontent.com///main/pages/home/another/file.ogg",
"attachment3": "https://raw.githubusercontent.com///main/pages/third/file.mp3"
"attachment": "https://api.test/username/repo/branch/some/relative/file.pdf",
"attachment2": "https://api.test/username/repo/branch/pages/home/another/file.ogg",
"attachment3": "https://api.test/username/repo/branch/pages/third/file.mp3"
},
"id": "home",
"id": "pages/home",
"templateSlug": "",
"slug": "",
"url": "/"
}
}
4 changes: 2 additions & 2 deletions __mocks__/.kjam/entries/__it.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"body": "",
"excerpt": "",
"data": {},
"id": "home",
"id": "pages/home",
"templateSlug": "",
"slug": "",
"url": "/"
}
}
13 changes: 8 additions & 5 deletions __mocks__/.kjam/entries/about-us__en.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"dir": "pages/about",
"locale": "en",
"body": "",
"excerpt": "",
"data": {},
"id": "about",
"body": "\n[A relative link to the events page](/events)\n",
"excerpt": "A relative link to the events page",
"data": {
"link": "/events",
"link2": "[link](/events)"
},
"id": "pages/about",
"templateSlug": "about-us",
"slug": "about-us",
"url": "/about-us"
}
}
11 changes: 0 additions & 11 deletions __mocks__/.kjam/entries/about__en.json

This file was deleted.

4 changes: 2 additions & 2 deletions __mocks__/.kjam/entries/eventi__it.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"body": "",
"excerpt": "",
"data": {},
"id": "events",
"id": "pages/events",
"templateSlug": "eventi",
"slug": "eventi",
"url": "/eventi"
}
}
2 changes: 1 addition & 1 deletion __mocks__/.kjam/entries/events/another-event__en.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
"templateSlug": "events/another-event",
"slug": "another-event",
"url": "/events/another-event"
}
}
2 changes: 1 addition & 1 deletion __mocks__/.kjam/entries/events/event-name__en.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
"templateSlug": "events/event-name",
"slug": "event-name",
"url": "/events/event-name"
}
}
4 changes: 2 additions & 2 deletions __mocks__/.kjam/entries/events/event-name__it.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"id": "events/event-name",
"templateSlug": "events/nome-evento",
"slug": "nome-evento",
"url": "/eventi/nome-evento"
}
"url": "/events/nome-evento"
}
4 changes: 2 additions & 2 deletions __mocks__/.kjam/entries/events/nome-evento__it.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"id": "events/event-name",
"templateSlug": "events/nome-evento",
"slug": "nome-evento",
"url": "/eventi/nome-evento"
}
"url": "/events/nome-evento"
}
4 changes: 2 additions & 2 deletions __mocks__/.kjam/entries/events__en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"body": "",
"excerpt": "",
"data": {},
"id": "events",
"id": "pages/events",
"templateSlug": "events",
"slug": "events",
"url": "/events"
}
}
Loading

0 comments on commit f009f03

Please sign in to comment.