-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support static pages from Contentful
Static pages can be defined in Contentful: Implementation details: - Contentful pages are preferred over local static files - To avoid excessive API calls to contentful, a list of valid paths that contentful has defined every 5 mins - Slow fetch interval for contentful to reduce API usage when in dev (resets will still trigger API calls) to 15-30 min - Add preview api key to support previewing unpublished contentful pages - uses a hardcoded value for now - Contentful pages are accessed via GraphQL - Add postcss-inherit to have css classes inherit other properites from other css classes (for markdown) Supported Contentful Models: - Markdown - Html - Paragraph Supported Contentful Data Types: - Rich Text Field Refactors: - Move at-at's pool to a component that is shared Limitations: - Paths must be still specified in storefront's routing before new pages can be visible from contentful - Code embed in rich text isn't supported - No visual difference between inline / block embed of assets + entries. - Paragraphs (rich text content modules) can only nest once.
- Loading branch information
Showing
17 changed files
with
603 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
@import 'basscss-typography'; | ||
@import 'custom-typography.css'; | ||
@import 'basscss-margin'; | ||
@import 'custom-margin.css'; | ||
@import 'basscss-padding'; | ||
@import 'custom-padding.css'; | ||
@import 'basscss-border'; | ||
@import 'custom-border.css'; | ||
@import 'basscss-addons/modules/colors'; | ||
@import 'custom-colors.css'; | ||
@import 'basscss-addons/modules/border-colors'; | ||
@import 'custom-border-colors.css'; | ||
|
||
.content-markdown a:link { | ||
@inherit: .p-color, .button-font-2, .border-bottom, .border-width-2, .border-p-color; | ||
} | ||
.content-markdown { | ||
font: 13px/18px var(--font-family-proxima); | ||
line-height: 26px; | ||
} | ||
.content-markdown ul, .content-markdown ol { @inherit: .mb2, .content-2; } | ||
.content-markdown p { @inherit: .content-2, .mb2; } | ||
.content-markdown li { @inherit: .content-2, .my1; } | ||
.content-markdown h1 { @inherit: .title-2.canela, .my3; } | ||
.content-markdown h2 { @inherit: .title-2.canela, .my3; } | ||
.content-markdown h3 { @inherit: .title-3.canela, .my3; } | ||
.content-markdown b { @inherit: .bold; } | ||
.content-markdown table { | ||
border-collapse: collapse; | ||
table-layout: fixed; | ||
margin: 10px 0; | ||
width: 100%; | ||
border: 2px solid var(--gray-mask); | ||
} | ||
.content-markdown table tr { | ||
border-bottom: 1px solid var(--cool-gray); | ||
} | ||
.content-markdown table th { | ||
@inherit: .content-3, .p1, .bold; | ||
background: var(--cool-gray); | ||
} | ||
.content-markdown table td:first-child { | ||
border-left: 0; | ||
} | ||
.content-markdown table td { | ||
@inherit: .p1; | ||
border-left: 1px solid var(--cool-gray); | ||
margin: 0; | ||
vertical-align: top; | ||
} | ||
|
||
:root { | ||
--gray-mask: rgba(204, 204, 204, 0.1); | ||
--cool-gray: #eeefef; | ||
--medium-font-weight: 400; | ||
--font-weight: var(--medium-font-weight); | ||
--font-family-proxima: 'Proxima Nova', Arial, sans-serif; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
query($preview: Boolean) { | ||
staticPageCollection(preview: $preview) { | ||
items { | ||
sys { id } | ||
path | ||
title | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
fragment Subcontent on Entry { | ||
sys { | ||
id | ||
} | ||
__typename | ||
...on Markdown { | ||
title | ||
content | ||
} | ||
...on Html { | ||
html | ||
} | ||
...on Paragraph { | ||
title | ||
textAlignment | ||
text { | ||
json | ||
links { | ||
entries { | ||
inline { | ||
sys { | ||
id | ||
} | ||
# graphql does not allow recursive queries | ||
# ...Content | ||
} | ||
block { | ||
sys { | ||
id | ||
} | ||
# graphql does not allow recursive queries | ||
# ...Content | ||
} | ||
} | ||
assets { | ||
# hyperlink {} | ||
block { | ||
sys { id } | ||
title | ||
url | ||
width | ||
height | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
fragment Content on Entry { | ||
sys { | ||
id | ||
} | ||
__typename | ||
...on Markdown { | ||
title | ||
content | ||
} | ||
...on Html { | ||
html | ||
} | ||
...on Paragraph { | ||
title | ||
textAlignment | ||
text { | ||
json | ||
links { | ||
entries { | ||
inline { | ||
# graphql does not allow recursive queries - so we can step one down | ||
...Subcontent | ||
} | ||
block { | ||
# graphql does not allow recursive queries - so we can step one down | ||
...Subcontent | ||
} | ||
} | ||
assets { | ||
# hyperlink {} | ||
block { | ||
sys { id } | ||
title | ||
url | ||
width | ||
height | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
query($preview: Boolean, $path: String) { | ||
staticPageCollection(preview: $preview, limit: 1, where: {path: $path}) { | ||
items { | ||
path | ||
title | ||
content { | ||
json | ||
links { | ||
entries { | ||
inline { | ||
...Content | ||
} | ||
block { | ||
...Content | ||
} | ||
} | ||
assets { | ||
# hyperlink {} | ||
block { | ||
sys { id } | ||
url | ||
title | ||
width | ||
height | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.