{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/Docusaurus/issues/705","repository_url":"https://api.github.com/repos/facebook/Docusaurus","labels_url":"https://api.github.com/repos/facebook/Docusaurus/issues/705/labels{/name}","comments_url":"https://api.github.com/repos/facebook/Docusaurus/issues/705/comments","events_url":"https://api.github.com/repos/facebook/Docusaurus/issues/705/events","html_url":"https://github.com/facebook/Docusaurus/pull/705","id":326753691,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkwNzUxMTYy","number":705,"title":"Enable sub-directories in docs/ ","user":{"login":"endiliey","id":17883920,"node_id":"MDQ6VXNlcjE3ODgzOTIw","avatar_url":"https://avatars3.githubusercontent.com/u/17883920?v=4","gravatar_id":"","url":"https://api.github.com/users/endiliey","html_url":"https://github.com/endiliey","followers_url":"https://api.github.com/users/endiliey/followers","following_url":"https://api.github.com/users/endiliey/following{/other_user}","gists_url":"https://api.github.com/users/endiliey/gists{/gist_id}","starred_url":"https://api.github.com/users/endiliey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endiliey/subscriptions","organizations_url":"https://api.github.com/users/endiliey/orgs","repos_url":"https://api.github.com/users/endiliey/repos","events_url":"https://api.github.com/users/endiliey/events{/privacy}","received_events_url":"https://api.github.com/users/endiliey/received_events","type":"User","site_admin":false},"labels":[{"id":952265999,"node_id":"MDU6TGFiZWw5NTIyNjU5OTk=","url":"https://api.github.com/repos/facebook/Docusaurus/labels/:white_check_mark:%20test%20plan","name":":white_check_mark: test plan","color":"fafafa","default":false},{"id":630651545,"node_id":"MDU6TGFiZWw2MzA2NTE1NDU=","url":"https://api.github.com/repos/facebook/Docusaurus/labels/CLA%20Signed","name":"CLA Signed","color":"009900","default":false},{"id":952277388,"node_id":"MDU6TGFiZWw5NTIyNzczODg=","url":"https://api.github.com/repos/facebook/Docusaurus/labels/major%20change","name":"major change","color":"ffff00","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2018-05-26T17:17:29Z","updated_at":"2018-07-24T10:06:24Z","closed_at":"2018-06-07T14:41:29Z","author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/facebook/Docusaurus/pulls/705","html_url":"https://github.com/facebook/Docusaurus/pull/705","diff_url":"https://github.com/facebook/Docusaurus/pull/705.diff","patch_url":"https://github.com/facebook/Docusaurus/pull/705.patch"},"body":"## Motivation\r\n\r\nResolves #323\r\n\r\n### Have you read the [Contributing Guidelines on pull requests](https://github.com/facebook/Docusaurus/blob/master/CONTRIBUTING.md#pull-requests)?\r\n\r\nYes\r\n\r\n### Want to test live example ?\r\n1. Website with translation + subdirectories\r\nhttps://endiliey.com/docs/ko/docusaurus/introduction.html\r\nhttps://endiliey.com/docs/id-ID/projectA/readme.html\r\nhttps://endiliey.com/docs/zh-CN/projectA/docs/contributors.html\r\n\r\n2. Website with versioning + subdirectories\r\nhttps://docusaurus-airutgnkay.now.sh/docs/en/next/projectA/docs/architecture.html\r\nhttps://docusaurus-airutgnkay.now.sh/docs/en/1.1.6/docusaurus/about.html\r\nhttps://docusaurus-airutgnkay.now.sh/docs/en/docusaurus/about.html\r\n\r\n## Test Plan\r\n**1. Prepare test docs**\r\nNote that we are mixing flat & subdirectory docs hierarchy. This is to prove that this PR is backward compatible & still allow flat docs hierarchy in addition of sub-directories hierarchy\r\n```\r\n// ......\r\n├── api-commands.md\r\n├── api-doc-markdown.md\r\n├── api-pages.md\r\n├── api-site-config.md\r\n├── projectA\r\n│   ├── docs\r\n│   │   ├── architecture.md\r\n│   │   └── contributors.md\r\n│   └── README.md\r\n└── projectB\r\n    └── guides\r\n        └── install.md\r\n\r\n4 directories, 19 files\r\n```\r\n\r\n**2. Modify sidebars.json**\r\n\r\n```js\r\n{\r\n    // ........\r\n    \"API\": [\r\n      \"commands\",\r\n      \"doc-markdown\",\r\n      \"api-pages\",\r\n      \"site-config\"\r\n    ],\r\n    \"Project A\": [\r\n      \"projectA/readme\",\r\n      \"projectA/docs/architecture\",\r\n      \"projectA/docs/contributors\"\r\n    ],\r\n    \"Project B\": [\r\n      \"projectB/guides/install\"\r\n    ]\r\n  }\r\n}\r\n```\r\n\r\n**3. Test development**\r\n```\r\ncd website\r\nyarn start\r\n```\r\n\r\nCheck that sidebar is correct\r\nhttp://localhost:3000/docs/en/next/installation.html\r\n<img width=\"559\" alt=\"3 correct_sidebar\" src=\"https://user-images.githubusercontent.com/17883920/40773028-41563ea0-64f4-11e8-89ba-2d89bec26349.png\">\r\n\r\nCheck that docs in subdirectory can be accessed\r\nhttp://localhost:3000/docs/en/next/projectA/readme.html\r\n<img width=\"796\" alt=\"4 subdir working\" src=\"https://user-images.githubusercontent.com/17883920/40773128-8493c4a8-64f4-11e8-91fc-09d87ba7b34a.PNG\">\r\n\r\nCheck that next and previous button is working\r\nhttp://localhost:3000/docs/en/next/projectA/readme.html\r\n<img width=\"594\" alt=\"5 next-and-prev is working\" src=\"https://user-images.githubusercontent.com/17883920/40773237-d8d02e80-64f4-11e8-8dcc-6c81db48a9d3.png\">\r\n\r\nCheck that docs in subdirectory of subdirectory can be accessed (not just one level deep)\r\nhttp://localhost:3000/docs/en/next/projectA/docs/contributors.html\r\n<img width=\"832\" alt=\"6 deeper than 1 level still work\" src=\"https://user-images.githubusercontent.com/17883920/40773310-1a09de6e-64f5-11e8-8963-3bddb446a815.PNG\">\r\n\r\n**4. Test production build with python SimpleHttpServer**\r\n```\r\ncd website\r\nyarn build\r\ncd build/Docusaurus\r\npython -m SimpleHTTPServer 8000\r\n```\r\n\r\n1. Doc still works & sidebar is correct\r\nhttp://localhost:8000/docs/en/next/custom-pages.html\r\n<img width=\"769\" alt=\"nodoc\" src=\"https://user-images.githubusercontent.com/17883920/40799895-6b471444-6541-11e8-8225-b252c3ef9af6.PNG\">\r\n\r\n\r\n2. Subdir docs is working & sidebar is correct\r\nhttp://localhost:8000/docs/en/next/projectA/docs/contributors.html\r\n<img width=\"813\" alt=\"subdir sidebar\" src=\"https://user-images.githubusercontent.com/17883920/40797158-c967e8f8-6539-11e8-91af-3231d0019067.PNG\">\r\n\r\n**5. Check generated build files**\r\n```\r\ncd website\r\nyarn build\r\ntree -a -I \"css|CNAME|.circleci|img|js\" build/Docusaurus/docs/ > build.txt\r\n```\r\n\r\nResults are expected\r\nFull generated files structure can be seen at https://gist.github.com/endiliey/a8492aee8e761d079a779f5010219bad\r\n\r\nNotice that `.html` files are built for docs in subdirectory\r\n```\r\nbuild/Docusaurus/docs/\r\n├── en\r\n│   ├── api-pages.html\r\n│   ├── blog.html\r\n│   ├── commands.html\r\n│   ├── custom-pages.html\r\n│   ├── doc-markdown.html\r\n│   ├── installation.html\r\n│   ├── navigation.html\r\n│   ├── next\r\n│   │   ├── api-pages.html\r\n│   │   ├── blog.html\r\n│   │   ├── commands.html\r\n│   │   ├── custom-pages.html\r\n│   │   ├── doc-markdown.html\r\n│   │   ├── installation.html\r\n│   │   ├── navigation.html\r\n│   │   ├── projectA\r\n│   │   │   ├── docs\r\n│   │   │   │   ├── architecture.html\r\n│   │   │   │   └── contributors.html\r\n│   │   │   └── readme.html\r\n│   │   ├── projectB\r\n│   │   │   └── guides\r\n│   │   │       └── install.html\r\n│   │   ├── publishing.html\r\n│   │   ├── search.html\r\n│   │   ├── site-config.html\r\n│   │   ├── site-creation.html\r\n│   │   ├── site-preparation.html\r\n│   │   ├── translation.html\r\n│   │   └── versioning.html\r\n│   ├── publishing.html\r\n│   ├── search.html\r\n│   ├── site-config.html\r\n│   ├── site-creation.html\r\n│   ├── site-preparation.html\r\n│   ├── translation.html\r\n│   └── versioning.html\r\n├── installation.html\r\n├── navigation.html\r\n├── next\r\n│   ├── api-pages.html\r\n│   ├── blog.html\r\n│   ├── commands.html\r\n│   ├── custom-pages.html\r\n│   ├── doc-markdown.html\r\n│   ├── installation.html\r\n│   ├── navigation.html\r\n│   ├── projectA\r\n│   │   ├── docs\r\n│   │   │   ├── architecture.html\r\n│   │   │   └── contributors.html\r\n│   │   └── readme.html\r\n│   ├── projectB\r\n│   │   └── guides\r\n│   │       └── install.html\r\n│   ├── publishing.html\r\n│   ├── search.html\r\n│   ├── site-config.html\r\n│   ├── site-creation.html\r\n│   ├── site-preparation.html\r\n│   ├── translation.html\r\n│   └── versioning.html\r\n```\r\n\r\n**6. Versioned docs test !!**\r\n```\r\ncd website\r\nyarn run version 1.1.6\r\n```\r\n\r\nMake some changes on `projectA/readme.md`\r\n```\r\nyarn run version 1.1.7\r\n```\r\n\r\nLook at generated versioned_docs. It works :)\r\n<img width=\"168\" alt=\"versioning wohooooooooo\" src=\"https://user-images.githubusercontent.com/17883920/40845827-62e40600-65ea-11e8-9611-6f2ec4da0274.PNG\">\r\n\r\nVersion 1.1.6 projectA/README\r\n<img width=\"812\" alt=\"1 1 6 readme\" src=\"https://user-images.githubusercontent.com/17883920/40845979-d86ca760-65ea-11e8-9adf-eed419e7a3ee.PNG\">\r\n\r\nVersion 1.1.7 projectA/README\r\n<img width=\"811\" alt=\"1 1 7 readme\" src=\"https://user-images.githubusercontent.com/17883920/40845986-df0b355a-65ea-11e8-8f33-0dd4f4cdc817.PNG\">\r\n\r\n**7. Translation test**\r\nAs docusaurus main website does not have a translation ready, I used my own site to test this feature.\r\n\r\nMy doc structures:\r\n```\r\ndocs/\r\n├── docusaurus\r\n│   ├── about.md\r\n│   └── introduction.md\r\n├── projectA\r\n│   ├── docs\r\n│   │   ├── architecture.md\r\n│   │   └── contributors.md\r\n│   └── README.md\r\n└── projectB\r\n    └── guides\r\n        └── install.md\r\n\r\n5 directories, 6 files\r\n```\r\n\r\nhttps://endiliey.com/docs/ko/docusaurus/introduction.html\r\n<img width=\"922\" alt=\"korean\" src=\"https://user-images.githubusercontent.com/17883920/40886988-27a42cec-6774-11e8-89f6-5b2d8928e19c.PNG\">\r\n\r\nhttps://endiliey.com/docs/zh-CN/projectA/readme.html\r\n<img width=\"939\" alt=\"china\" src=\"https://user-images.githubusercontent.com/17883920/40887006-5498d838-6774-11e8-9452-a9ecba6d9649.png\">\r\n\r\n## Credits\r\n@ryanwilsonperkin for helping me to testing it out previously"},"comment":{"url":"https://api.github.com/repos/facebook/Docusaurus/issues/comments/407353366","html_url":"https://github.com/facebook/Docusaurus/pull/705#issuecomment-407353366","issue_url":"https://api.github.com/repos/facebook/Docusaurus/issues/705","id":407353366,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzM1MzM2Ng==","user":{"login":"jsprklst","id":1721525,"node_id":"MDQ6VXNlcjE3MjE1MjU=","avatar_url":"https://avatars2.githubusercontent.com/u/1721525?v=4","gravatar_id":"","url":"https://api.github.com/users/jsprklst","html_url":"https://github.com/jsprklst","followers_url":"https://api.github.com/users/jsprklst/followers","following_url":"https://api.github.com/users/jsprklst/following{/other_user}","gists_url":"https://api.github.com/users/jsprklst/gists{/gist_id}","starred_url":"https://api.github.com/users/jsprklst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsprklst/subscriptions","organizations_url":"https://api.github.com/users/jsprklst/orgs","repos_url":"https://api.github.com/users/jsprklst/repos","events_url":"https://api.github.com/users/jsprklst/events{/privacy}","received_events_url":"https://api.github.com/users/jsprklst/received_events","type":"User","site_admin":false},"created_at":"2018-07-24T10:06:24Z","updated_at":"2018-07-24T10:06:24Z","author_association":"NONE","body":"@endiliey thanks for your reply. I already tried your suggestion but the problem there is that the images won't display when previewing markdown files. Referencing images using `../assets/subdir/blabla.png` breaks when using translations as it will resolve to `docs/en/assets/subdir/blabla.png` instead of `docs/assets/subdir/blabla.png`. Any suggestions?"}}
{"actor":{"display_login":"jsprklst"}}