OHHAKO / reatsby

React + Gatsby :smile:
https://ohhako.github.io/react-app/
1 stars 0 forks source link

feat: create separate page to show article body #14

Open kkyueing opened 4 years ago

kkyueing commented 4 years ago

Clicking a title of an article in a list should load a new page containing a body of the article. This should be done after we finish #12 and #13.

This tutorial would be useful: Programmatically create pages from data

OHHAKO commented 4 years ago

ok i will check that link. thank you!

so it will exist two list once is categories of article and another is bodies of each articles that appear by click. am i right?

kkyueing commented 4 years ago

I guess there will be a page showing a list of boards, and each board will contain a list of articles. When a user clicks one of those articles, then the second page will be opened. The second page should show a body of the article just clicked.

If there are two boards, and each board contains two articles, logical structure of data would be like this:

- board_id: 0
  board_title: Board A
  articles:
  - article_id: 0
    title: Blah
    body: Blah
  - article_id: 1
    title: Blah
    body: Blah
- board_id: 1
  board_title: Board B
  articles:
  - article_id: 2
    title: Blah
    body: Blah
  - article_id: 3
    title: Blah
    body: Blah

And there will be two url patterns:

What do you think? :)