@@ -112,6 +112,10 @@ export const SidebarArticles = ({ items, sortType, articleState }: Props) => {
112112 </ span >
113113 </ summary >
114114 < ul >
115+ { Object . values ( node . children )
116+ . sort ( ( a , b ) => a . name . localeCompare ( b . name ) )
117+ . map ( ( child ) => renderNode ( child , `${ path } /${ child . name } ` ) ) }
118+
115119 { node . items . sort ( cmp ) . map ( ( item ) => (
116120 < li key = { item . items_show_path } >
117121 < Link css = { articlesListItemStyle } to = { item . items_show_path } >
@@ -127,10 +131,6 @@ export const SidebarArticles = ({ items, sortType, articleState }: Props) => {
127131 </ Link >
128132 </ li >
129133 ) ) }
130-
131- { Object . values ( node . children )
132- . sort ( ( a , b ) => a . name . localeCompare ( b . name ) )
133- . map ( ( child ) => renderNode ( child , `${ path } /${ child . name } ` ) ) }
134134 </ ul >
135135 </ details >
136136 </ li >
@@ -144,6 +144,10 @@ export const SidebarArticles = ({ items, sortType, articleState }: Props) => {
144144 < span css = { articleSectionTitleCountStyle } > { items . length } </ span >
145145 </ summary >
146146 < ul >
147+ { Object . values ( roots )
148+ . sort ( ( a , b ) => a . name . localeCompare ( b . name ) )
149+ . map ( ( r ) => renderNode ( r , r . name ) ) }
150+
147151 { topLevelItems . length > 0 &&
148152 topLevelItems . sort ( compare [ sortType ] ) . map ( ( item ) => (
149153 < li key = { item . items_show_path } >
@@ -160,10 +164,6 @@ export const SidebarArticles = ({ items, sortType, articleState }: Props) => {
160164 </ Link >
161165 </ li >
162166 ) ) }
163-
164- { Object . values ( roots )
165- . sort ( ( a , b ) => a . name . localeCompare ( b . name ) )
166- . map ( ( r ) => renderNode ( r , r . name ) ) }
167167 </ ul >
168168 </ details >
169169 ) ;
0 commit comments