You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
update comments link](9643100) by andronovhopf
🛠️ [doc-engine: introduce models, refactor node build * Refactor content parsing logic out into "Models"
Models are a way to conceptualize and organize Gatsby API calls for separate
content types like blog posts and doc pages.
A Model is an object whose keys match either the Gatsby Node API or custom calls
defined by other Models. At its core, a Model is a very barebones Gatsby plugin
that can respond to events from other Models.
Models are intended to be a little easier then Gatsby plugins to work with
within a single repo, and they work so similarly to plugins that breaking them
out down the line is no problem.
Change list:
Swap gatsby-node API calls out for Model-based ones where applicable
onCreateNode and createPages are changed
createSchemaCustomization is added
Adapt Blog templates, fragments, and queries to new data shape
Most, if not all queries involving the markdown files are changed to go through the new custom nodes.
Custom nodes' fields are identical to the remark ones for the most part, other than the new node types and frontmatter/fields being hoisted up to the custom node's root.
Resolver-based Remark fields (html/Ast, timeToRead) are accessed by using a fragment on the node's parent.
Change various uses of "edges" to "nodes"
Convert src/gatsby page builders for posts and docs into Models
Move page path generation logic into Models and remove the original function
Define model list and imports in src/gatsby/models
Make MarkdownContent Model that bootstraps other Markdown-based Models
Merge IBlogPostFrontmatter into IBlogPostData
Access nodes in page queries by id instead of slug
Only generate one blog post in dev mode to cut down on image regeneration. (full site can still be built with gatsby build)
Change the feed plugin's query and serialization to use BlogPost nodes
Improve model schema
Added "gatsby-plugin-parent-resolvers", used functional-style and not imported to config. It's a pretty simple plugin, and can be replicated in the repo if need be.
Added resolver builder utils to help with making custom resolvers across similar node types.
createSchemaCustomization is now implemented on Authors, BlogPosts and DocsPages
MD-based custom nodes and ImageSharp nodes are now "id"ed with their relative path.
This is used extensively for the new node relations (I believe it's more performant than fetching the real ID or hopping through a few relations every time)
ImageSharps simply have this added through a Model that uses createNodeField
Custom node fields that used to depend on parent fragments now have built-in root level resolvers on their custom nodes. (html, htmlAst, timeToRead on Markdown-based nodes)
Markdown files that link to other files in their frontmatter now resolve to custom nodes. (blog post -> author)
BlogPost picture and Author avatar now link directly to ImageSharp nodes.
Adapted templates, interfaces, and queries to new data shape.
Basically, anything that used to be in parent, childMarkdownRemark, or childImageSharp is now bumped up to root.
Some uses of Promise.all are made in the blog model in an attempt to better parallelize the page building process (These can be removed if need be)
Add a "posts" field to Authors
By default, this field returns an object with all posts the author
has made sorted by date descending as well as a totalCount.
The field can also be supplied a "limit" argument to limit the amount
of posts returned. This does not affect totalCount.
Fix lint problems after merging with the web ui.
Remove accidental comment paste into gatsby-config
Remove the rest of the accidentally pasted link
Re-introduce frontmatter markdown parsing for BlogPost descriptions and picture comments.
Fix a require that inconsistently lacked an extension.
Clean up docs/onCreateNode
Move the "special exemption" comment to where it's more appropriate.
Rename pagePath to slug to keep with this project's conventions.
Change the Model API builder into a simple reusable wrapper.
This is before places that use the builder are updated, so this commit doesn't work.
Update models/markdown-content/index
Re-do docs/comments in a more understandable fashion.
Adapt to the new API runner and omit pluginOptions in the custom API.
Fix a misnamed arg in asyncCallOnAll
Simplify Model API internals and improve comments
Since the functional Gatsby hook builder was received poorly, I flattened out
the signature of buildModelApi and turned it into runOnModels, an async
function with only one layer of signature and, by virtue of being async, can be
cleanly used in gatsby-node.
Remove the options parameter from Model signatures, since we don't use it currently.
This was to match Gatsby's (api, options) signature and this change makes Models
deviate from plugins slightly more, but re-adding it in the case of making a Model
into a Plugin would be nearly effortless so the change was made for aesthetics.
onCreateMarkdownContentNode hooks are now named after the custom hook
instead of onCreateNode.
Completely rewrote docs for Model runner
Make blog page limiter work on an env variable
Initialize dotenv in gatsby-node to ensure it's loaded for all models.
Make the Blog Page limiter in the blog/createPages module trigger only
when LIMIT_BLOG_PAGES is truthy.
Capitalize "Model" in markdown content doc comment
Remove unnecessary index ternary from blog slug.
Remove unnecessary explicit {models} on onCreateNode call
Rename internal model runner name to match usage convention
Add custom foreign-key Node resolvers that operate on trimmed frontmatter fields.
The old resolvers were built around the MD content not changing, but given the
greenlight to change the Markdown, these new resolvers can both simplify the
resolver implementation logic as well as make linking images nicer for editors.
For editors:
author avatar is now relative to "static/uploads/avatars"
authors no longer have the "path" frontmatter field
blog post picture is now relative to "static/uploads/images"
blog post author is now relative to "content/authors" and doesn't use an extension.
Beyond the immediate implications, these custom resolvers allow us to change how
these fields are resolved behind the scenes to adapt to any future circumstances
like content relocation.
Change all existing content frontmatter to work with the new resolvers.
This commit brought to you by Sed.
Straight up callOnModels to have the same name everywhere.
Here's the Weekly Digest for iterative/dvc.org:
ISSUES
Last week 16 issues were created.
Of these, 6 issues have been closed and 10 issues are still open.
OPEN ISSUES
💚 #1184 link-check: trim exclusions, by casperdcl
💚 #1183 SEO Improvements, by rogermparent
💚 #1182 Rebuilds caching, by shcheklein
💚 #1179 analytics: we should strip queries, by shcheklein
💚 #1177 rss: no title, no image in the feed for new posts, by shcheklein
💚 #1175 metrics: update docs per changes, by jorgeorpinel
💚 #1174 Regular updates (Apr 21), by jorgeorpinel
💚 #1173 document multistage dvcfile, by skshetry
💚 #1172 mention
.dvcignore
doesn't apply to external dependencies., by benjamintanweihao💚 #1169 test: link-check: misc fixes, by casperdcl
CLOSED ISSUES
❤️ #1181 Fix feed titles (mostly), by rogermparent
❤️ #1180 Fix share buttons by importing slug via GraphQL, by rogermparent
❤️ #1178 blog social share buttons do not work properly, by shcheklein
❤️ #1176 Restyle community gems draft april '20, by restyled-io[bot]
❤️ #1171 Move image captions styles to documentation's Markdown component styles file, by pavelgrinchenko
❤️ #1170 [accessibility] hide the mobile menu on desktop from keyboard users., by nisarhassan12
LIKED ISSUE
👍 #1170 [accessibility] hide the mobile menu on desktop from keyboard users., by nisarhassan12
It received 👍 x1, 😄 x0, 🎉 x0 and ❤️ x0.
NOISY ISSUE
🔈 #1173 document multistage dvcfile, by skshetry
It received 4 comments.
PULL REQUESTS
Last week, 12 pull requests were created, updated or merged.
UPDATED PULL REQUEST
Last week, 4 pull requests were updated.
💛 #1183 SEO Improvements, by rogermparent
💛 #1182 Rebuilds caching, by shcheklein
💛 #1174 Regular updates (Apr 21), by jorgeorpinel
💛 #1166 [docs]: fix the RightPanel to work correctly with browser history., by nisarhassan12
MERGED PULL REQUEST
Last week, 8 pull requests were merged.
💜 #1181 Fix feed titles (mostly), by rogermparent
💜 #1180 Fix share buttons by importing slug via GraphQL, by rogermparent
💜 #1171 Move image captions styles to documentation's Markdown component styles file, by pavelgrinchenko
💜 #1170 [accessibility] hide the mobile menu on desktop from keyboard users., by nisarhassan12
💜 #1160 Regular updates (Apr 16), by jorgeorpinel
💜 #1155 community gems draft april '20, by andronovhopf
💜 #1145 Custom Node Types and big Gatsby refactor, by rogermparent
💜 #1054 cmd-ref: document checkout displaying changes, by skshetry
COMMITS
Last week there were 14 commits.
🛠️ fonts: update files to support eastern eur languages by shcheklein
🛠️ blog: fix a broken link by shcheklein
🛠️ [Fix feed titles (mostly) (#1181) * Fix share buttons by importing slug via GraphQL
I overlooked the slug when the schema changed in the Models update.
Also remove frontmatter application since the nodes don't have it anymore
I need to improve this more but it's a partial fix](e9ccdfa) by rogermparent
🛠️ Fix share buttons by importing slug via GraphQL (#1180) I overlooked the slug when the schema changed in the Models update. by rogermparent
🛠️ Merge pull request #1054 from iterative/skshetry/checkout-pr cmd-ref: document checkout displaying changes by jorgeorpinel
🛠️ Update content/docs/command-reference/checkout.md by jorgeorpinel
🛠️ use cases: add checkout output per https://github.com/iterative/dvc.org/pull/1054#issuecomment-611806881 by jorgeorpinel
🛠️ Merge branch 'master' into skshetry/checkout-pr by jorgeorpinel
🛠️ cmd ref: clarify about checkout output and --summary option desc. per https://github.com/iterative/dvc.org/pull/1054#pullrequestreview-395924744 by jorgeorpinel
🛠️ [community gems April '20 (#1155) * community gems draft
revisions
revisions 2
prettied it?
update picture URL
Update author img url
update comments link](9643100) by andronovhopf
🛠️ [doc-engine: introduce models, refactor node build * Refactor content parsing logic out into "Models"
Models are a way to conceptualize and organize Gatsby API calls for separate
content types like blog posts and doc pages.
A Model is an object whose keys match either the Gatsby Node API or custom calls
defined by other Models. At its core, a Model is a very barebones Gatsby plugin
that can respond to events from other Models.
Models are intended to be a little easier then Gatsby plugins to work with
within a single repo, and they work so similarly to plugins that breaking them
out down the line is no problem.
Change list:
gatsby build
)Added "gatsby-plugin-parent-resolvers", used functional-style and not imported to config. It's a pretty simple plugin, and can be replicated in the repo if need be.
Added resolver builder utils to help with making custom resolvers across similar node types.
createSchemaCustomization
is now implemented on Authors, BlogPosts and DocsPagesMD-based custom nodes and ImageSharp nodes are now "id"ed with their relative path.
This is used extensively for the new node relations (I believe it's more performant than fetching the real ID or hopping through a few relations every time)
ImageSharps simply have this added through a Model that uses
createNodeField
Custom node fields that used to depend on parent fragments now have built-in root level resolvers on their custom nodes. (html, htmlAst, timeToRead on Markdown-based nodes)
Markdown files that link to other files in their frontmatter now resolve to custom nodes. (blog post -> author)
BlogPost picture and Author avatar now link directly to ImageSharp nodes.
Adapted templates, interfaces, and queries to new data shape.
Basically, anything that used to be in
parent
,childMarkdownRemark
, orchildImageSharp
is now bumped up to root.Some uses of Promise.all are made in the blog model in an attempt to better parallelize the page building process (These can be removed if need be)
By default, this field returns an object with all posts the author
has made sorted by date descending as well as a totalCount.
The field can also be supplied a "limit" argument to limit the amount
of posts returned. This does not affect totalCount.
Fix lint problems after merging with the web ui.
Remove accidental comment paste into gatsby-config
Remove the rest of the accidentally pasted link
Re-introduce frontmatter markdown parsing for BlogPost descriptions and picture comments.
Fix a require that inconsistently lacked an extension.
Clean up docs/onCreateNode
This is before places that use the builder are updated, so this commit doesn't work.
Fix a misnamed arg in asyncCallOnAll
Simplify Model API internals and improve comments
Since the functional Gatsby hook builder was received poorly, I flattened out
the signature of
buildModelApi
and turned it intorunOnModels
, an asyncfunction with only one layer of signature and, by virtue of being async, can be
cleanly used in
gatsby-node
.Remove the options parameter from Model signatures, since we don't use it currently.
This was to match Gatsby's
(api, options)
signature and this change makes Modelsdeviate from plugins slightly more, but re-adding it in the case of making a Model
into a Plugin would be nearly effortless so the change was made for aesthetics.
onCreateMarkdownContentNode
hooks are now named after the custom hookinstead of
onCreateNode
.Completely rewrote docs for Model runner
Initialize dotenv in
gatsby-node
to ensure it's loaded for all models.Make the Blog Page limiter in the blog/createPages module trigger only
when LIMIT_BLOG_PAGES is truthy.
Capitalize "Model" in markdown content doc comment
Remove unnecessary index ternary from blog slug.
Remove unnecessary explicit {models} on onCreateNode call
Rename internal model runner name to match usage convention
Add custom foreign-key Node resolvers that operate on trimmed frontmatter fields.
The old resolvers were built around the MD content not changing, but given the
greenlight to change the Markdown, these new resolvers can both simplify the
resolver implementation logic as well as make linking images nicer for editors.
For editors:
Author frontmatters go from this:
to:
And for blog frontmatters, this:
to this:
Beyond the immediate implications, these custom resolvers allow us to change how
these fields are resolved behind the scenes to adapt to any future circumstances
like content relocation.
This commit brought to you by Sed.
I replaced all instances of "runOnModels" and "asyncCallOnAll" to "callOnModels"](7f15bc9) by rogermparent
🛠️ Merge pull request #1160 from iterative/2020-04-16 Regular updates (Apr 16) by jorgeorpinel
🛠️ Move image captions styles to documentation's Markdown component styles file (#1171) Co-authored-by: Pavel Grinchenko [email protected] by pavelgrinchenko
🛠️ [accessibility] hide the mobile menu on desktop from keyboard users. (#1170) by nisarhassan12
CONTRIBUTORS
Last week there were 6 contributors.
👤 shcheklein
👤 rogermparent
👤 jorgeorpinel
👤 andronovhopf
👤 pavelgrinchenko
👤 nisarhassan12
STARGAZERS
Last week there were 3 stagazers.
⭐ iryek219
⭐ oraziogallo
⭐ yoshi1011
You all are the stars! 🌟
RELEASES
Last week there were no releases.
That's all for last week, please 👀 Watch and ⭐ Star the repository iterative/dvc.org to receive next weekly updates. 😃
You can also view all Weekly Digests by clicking here.
The text was updated successfully, but these errors were encountered: