@@ -59,8 +59,8 @@ async function fetchData(props, opt) {
5959 // schema
6060
6161 // utils: filter, tags staff
62- const { mainPath , subPath : topic } = parseURL ( props )
63- const community = akaTranslate ( mainPath )
62+ const { communityPath , subPath : topic } = parseURL ( props )
63+ const community = akaTranslate ( communityPath )
6464 const thread = extractThreadFromPath ( props )
6565
6666 let filter = addTopicIfNeed (
@@ -105,7 +105,7 @@ async function fetchData(props, opt) {
105105
106106export default class HomePage extends React . Component {
107107 static async getInitialProps ( props ) {
108- const { mainPath , subPath } = parseURL ( props )
108+ const { communityPath , threadPath } = parseURL ( props )
109109 const thread = extractThreadFromPath ( props )
110110
111111 let resp
@@ -117,7 +117,7 @@ export default class HomePage extends React.Component {
117117 } else {
118118 return {
119119 statusCode : 404 ,
120- target : mainPath ,
120+ target : communityPath ,
121121 viewing : { community : { } } ,
122122 route : { } ,
123123 }
@@ -154,7 +154,12 @@ export default class HomePage extends React.Component {
154154 repo : { } ,
155155 user : { } ,
156156 } ,
157- route : { mainPath : community . raw , subPath } ,
157+ route : {
158+ communityPath : community . raw ,
159+ mainPath : community . raw ,
160+ threadPath,
161+ subPath : threadPath ,
162+ } ,
158163 tagsBar : { tags : partialTags } ,
159164 } ,
160165 contentsThread
@@ -177,7 +182,7 @@ export default class HomePage extends React.Component {
177182 viewing : { community } ,
178183 route,
179184 } = this . props
180- const { mainPath , subPath } = route
185+ const { communityPath , subPath } = route
181186
182187 const seoTitle =
183188 community . raw === 'home'
@@ -198,7 +203,7 @@ export default class HomePage extends React.Component {
198203 < React . Fragment >
199204 < NextSeo
200205 config = { {
201- url : `${ SITE_URL } /${ mainPath } /${ subPath } ` ,
206+ url : `${ SITE_URL } /${ communityPath } /${ subPath } ` ,
202207 title : seoTitle ,
203208 description : `${ community . desc } ` ,
204209 } }
0 commit comments