-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add templates to doc pages and give docs home one #1268
Merged
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
5cb2e40
Add templates to doc pages and give docs home one
rogermparent e9cfb7f
Merge branch 'master' of https://github.com/iterative/dvc.org into ne…
rogermparent d3fd5ed
Add "card" and "cards" custom components to Docs
rogermparent 5aa9d39
Create some example content with the new custom card components
rogermparent 2f97d93
Resolve TS issues in example
rogermparent de378f2
Remove doc home template and example images
rogermparent 543ada9
Add example images to all home cards, and remove example heading.
rogermparent 25f94d0
Remove images from cards in doc home content
rogermparent 3945026
Improve Cards and add href feature.
rogermparent 3d1f4e1
Change doc home content
rogermparent 37a303c
Change hover animation to background-color
rogermparent aa188aa
index: simplify and update content
shcheklein f10b5aa
Restyled by prettier (#1335)
restyled-io[bot] e5ea3a6
home page, get started - fix the link
shcheklein 93ad8ea
docs index - change oder, cards should go first
shcheklein 3fdb763
home index: return use cases
shcheklein f847055
card style: less contrast for the heading
shcheklein dcff6cd
docs home page: update cards text
shcheklein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,48 @@ | ||
import React from 'react' | ||
import { graphql } from 'gatsby' | ||
import { Node } from 'unist' | ||
import { getItemByPath } from '../utils/shared/sidebar' | ||
|
||
import SEO from '../components/SEO' | ||
|
||
import Documentation from '../components/Documentation' | ||
|
||
interface IDocPageProps { | ||
data: { | ||
page: { | ||
htmlAst: Node | ||
} | ||
} | ||
pageContext: { | ||
slug: string | ||
headings: [] | ||
} | ||
} | ||
shcheklein marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
const DocPage: React.FC<IDocPageProps> = ({ | ||
data, | ||
pageContext: { slug, headings } | ||
}) => { | ||
const { | ||
page: { htmlAst } | ||
} = data | ||
|
||
const { label } = getItemByPath(slug) | ||
|
||
return ( | ||
<> | ||
<SEO title={label} /> | ||
<Documentation htmlAst={htmlAst} path={slug} headings={headings} /> | ||
</> | ||
) | ||
} | ||
|
||
export default DocPage | ||
|
||
export const pageQuery = graphql` | ||
query DocPage($id: String!) { | ||
page: docsPage(id: { eq: $id }) { | ||
htmlAst | ||
} | ||
} | ||
` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like we made
cards
general enough, do we need a separate template now?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I expected to need to do something in another component but everything went fine with the new custom components in the body.
I'll remove this template frontmatter and the existing home template. We may need a unique template in the future, but we'll add it when that time comes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey, any update to this? are we removing the template?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I totally can, and quite quickly, but considering we don't know the exact direction this page is going I haven't committed a change to it yet.
Given my comment on the home issue, I think the best course of action is to temporarily go all-in on the home template and make it a standalone component. This allows us to not be limited in design and get the docs home we want up quickly.
My current plan is that once I get the design I'll make the template that's a React component implementing that design, and once that makes the Docs page match what we want, we merge to master- this first step of the plan lets us get a great docs home out before the important DVC 1.0 events around the corner because the implementation is already here and React components are the easiest to port to any other method down the line.
After we have a page we want made in a simple React component template, we can later quite easily port the page content to something more dev/editor friendly that lets editors change the page in MD.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rogermparent I would be happy if we can get something simple and clean like this - https://cube.dev/docs . I don't think we need something too complicated/custom at this point. Does it help to make a decision?
Also, we can take design ideas there (except icons of course :) ) . I'll ask designer after that to make us icons.