Order data in scully-routes.json
angularscullyIn Scully, the scully-routes.json
file lists all the routes that have been generated as static HTML files. By default,
the routes are listed in the order that they were generated.
If you want to change the order of the routes in the scully-routes.json
file, you can do so by modifying the order in
which the routes are generated. For example, you can use the sortRoutesBy
option in the scully.config.js
file to
specify
a sorting function that determines the order in which the routes are generated.
Here’s an example of how you can use the sortRoutesBy
option to sort the routes alphabetically by path:
module.exports = {
sortRoutesBy: (a, b) => a.route.localeCompare(b.route),
routes: {
'/route1': {
type: 'contentFolder',
folder: './src/app/route1',
},
'/route2': {
type: 'contentFolder',
folder: './src/app/route2',
},
},
};
Alternatively, you can use the sortRoutesBy
option to sort the routes by any other criteria, such as the date they
were
created or the title of the page.
Keep in mind that the order of the routes in the scully-routes.json
file does not affect the order in which they are
displayed on the website. To change the order in which the routes are displayed, you will need to modify the navigation
structure of your website.
Other Article on Tag angular
- - angular add bootstrap
- - angular add semantic-ui
- - angular bootstrap navbar example
- - angular call backend api
- - angular install scully
- - angular login and register page example
- - angular login page example
- - angular navbar code example
- - angular scully generate route md file space replace
- - angular upload multiple file
Other Article on Tag scully
- - angular install scully
- - angular scully generate route md file space replace
- - How to generate sitemap by scully
- - Order data in scully-routes.json