Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

New, static site starting from Gatsby starter kit #14

Merged
merged 15 commits into from
May 3, 2017

Conversation

shilman
Copy link
Contributor

@shilman shilman commented Apr 28, 2017

Issue: #5

What I did

Ported the old CRA app to gatsby so that the site would be statically generated and indexable from Google. Gatsby and CRA work a bit differently, so I had to hack around to get things working properly.

Major differences from old site:

  • Now, instead of authoring .js files for content, we author .md files, which is more user-friendly. They also render properly in Github source code tree.
  • In old site, URLs were of the form /docs/cat/section/item. In the new site, /docs/cat/section/item/.
  • In the old site, you could navigate to /docs/cat/section and it would dynamically pick out the first item in the section. In the new site, that is handled in the navigation, so all links navigate to specific articles/items. Linking to /docs/cat/ or /docs/cat/section will 404.
  • In the old site there were multiple categories. In the new site, there is a single category, react-storybook, for now.
  • Removed category navigation at the top of the docs page for now.

introduction_-_react_storybook

Still needed

  • favicon
  • Use react-router Link instead of a

How to test

npm install
npm run storybook
npm run develop

Deploying

Deployment is handled using the gh-pages package, that was used by the Gatsby starter kit. I haven't tested it yet.

Work in progress: ported storybooks content

Still needs:
- two-level nav hierarchy
- styling improvements
- stories ;-)
@usulpro
Copy link
Member

usulpro commented Apr 28, 2017

@shilman It the great start! I like the gatsby! I'd be happy to help with it 👍

@shilman
Copy link
Contributor Author

shilman commented Apr 29, 2017

Thanks @usulpro! Let's coordinate with @mnmtanish who is also going to help. Since @mnmtanish worked on the original CRA app, he may have some strong opinions about the transition. I just wanted to get things going because currently https://storybooks.js.org is not getting indexed by Google.

The biggest missing items from the old site right now are:

  • two-level menus on the left + responsive behavior
  • styling
  • edit on github link
  • storybook 😄

shilman added 4 commits May 1, 2017 16:49
Use index.md so that images show properly in github, e.g.:

```md
![Login Form](../static/login_form.png)
```
@usulpro
Copy link
Member

usulpro commented May 1, 2017

a few more issues with the old site:

  • wrong navigation menu behavior on Chrome Android
  • missing section with full API description
  • missing section with Storybook related publications/media

@arunoda
Copy link
Contributor

arunoda commented May 1, 2017

This is pretty cool.

@shilman
Copy link
Contributor Author

shilman commented May 2, 2017

@usulpro @mnmtanish finally figured out how to merge the old code with gatsby, so hold off on contributing until I check in my latest iteration.

@usulpro I think those issues with previous site probably deserve to be standalone issues. Let's work it out as soon as I am back to parity with the original site. 😸

- get rid of sections concept temporarily
- markdown is already parsed to HTML by gatsby
@shilman
Copy link
Contributor Author

shilman commented May 2, 2017

@usulpro @mnmtanish Got it working with some hackery! Please check it out and let me know wha you think. You can now run storybooks. I think we can merge with a little more work.

shilman added 3 commits May 2, 2017 17:30
Resolve conflicts merging source changes

# Conflicts:
#	components/Docs/Container/index.js
#	src/docs/react-storybook/configurations/custom-webpack-config.js
Copy link
Member

@usulpro usulpro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! In general, everything runs fine. Should we merge it and consistently solve issues?

@usulpro
Copy link
Member

usulpro commented May 2, 2017

I tried to test deploying by this steps:

npm run build
gh-pages -r https://github.com/UsulPro/storytest.github.io.git -d public -o origin -b master

Everything passed without any errors. Result is https://usulpro.github.io/storytest.github.io/
But at this moment available only the home page

html.js Outdated
@@ -5,6 +5,7 @@ import DocumentTitle from 'react-document-title'
import { prefixLink } from 'gatsby-helpers'
import typography from './utils/typography'
import { colors } from 'utils/colors'
import favicon from './design/homepage/storybook-icon.png'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@usulpro seems unused?

html.js Outdated
@@ -28,7 +28,7 @@ class HTML extends Component {
content="width=device-width, initial-scale=1.0"
/>
<title>{title}</title>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="icon" href={favicon} type="image/x-icon" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is exactly what I mean! Sorry, I made a typo yesterday
funny that it doesn't cause an error in console since you added favicon.ico to the project root

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for figuring it out!

@shilman shilman merged commit 007f548 into source May 3, 2017
@shilman
Copy link
Contributor Author

shilman commented May 3, 2017

@usulpro regarding your test deploy, there is a variable linkPrefix = "/" in config.toml that you can adjust if you are deploying to another location. I'm not sure I respect it properly in the code because I was trying to reuse as much of the previous site as possible.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

3 participants