@@ -59,8 +59,8 @@ async function fetchData(props, opt) {
5959 const { asPath } = props
6060 // schema
6161
62- const { mainPath , subPath : topic } = parseURL ( props )
63- const community = akaTranslate ( mainPath )
62+ const { communityPath , threadPath : topic } = parseURL ( props )
63+ const community = akaTranslate ( communityPath )
6464 const thread = extractThreadFromPath ( props )
6565
6666 let filter = addTopicIfNeed (
@@ -105,9 +105,9 @@ async function fetchData(props, opt) {
105105
106106export default class CommunityPage extends React . Component {
107107 static async getInitialProps ( props ) {
108- if ( ! isServerSide ( ) ) return { }
108+ if ( ! isServerSide ) return { }
109109
110- const { mainPath , subPath } = parseURL ( props )
110+ const { communityPath , threadPath } = parseURL ( props )
111111 const thread = extractThreadFromPath ( props )
112112
113113 let resp
@@ -119,7 +119,7 @@ export default class CommunityPage extends React.Component {
119119 } else {
120120 return {
121121 statusCode : 404 ,
122- target : mainPath ,
122+ target : communityPath ,
123123 viewing : { community : { } } ,
124124 route : { } ,
125125 }
@@ -156,7 +156,12 @@ export default class CommunityPage extends React.Component {
156156 repo : { } ,
157157 user : { } ,
158158 } ,
159- route : { mainPath : community . raw , subPath } ,
159+ route : {
160+ communityPath : community . raw ,
161+ mainPath : community . raw ,
162+ threadPath,
163+ subPath : threadPath ,
164+ } ,
160165 tagsBar : { tags : partialTags } ,
161166 } ,
162167 contentsThread
@@ -179,7 +184,7 @@ export default class CommunityPage extends React.Component {
179184 viewing : { community } ,
180185 route,
181186 } = this . props
182- const { mainPath , subPath } = route
187+ const { communityPath , threadPath } = route
183188
184189 const seoTitle =
185190 community . raw === 'home'
@@ -200,7 +205,7 @@ export default class CommunityPage extends React.Component {
200205 < React . Fragment >
201206 < NextSeo
202207 config = { {
203- url : `${ SITE_URL } /${ mainPath } /${ subPath } ` ,
208+ url : `${ SITE_URL } /${ communityPath } /${ threadPath } ` ,
204209 title : seoTitle ,
205210 description : `${ community . desc } ` ,
206211 } }
0 commit comments