Skip to content

Commit f3370bc

Browse files
authored
Merge pull request #67 from woocommerce/25-04/add-search
Add Algolia Search and tweak sitemap
2 parents cfaf908 + ee164cb commit f3370bc

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docusaurus.config.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,36 @@ const config = {
8484
darkTheme: prismThemes.dracula,
8585
additionalLanguages: ['php', 'bash', 'json', 'yaml', 'makefile'],
8686
},
87+
algolia: {
88+
// The application ID provided by Algolia.
89+
appId: 'XLDNDE9LL2',
90+
// Public API key: it is safe to commit it.
91+
apiKey: '29c11bf5cd152f048721ec14a3adeffd',
92+
indexName: 'qit-woo',
93+
contextualSearch: false,
94+
},
8795
}),
96+
sitemap: {
97+
lastmod: 'date',
98+
changefreq: 'weekly',
99+
priority: 0.5,
100+
ignorePatterns: [],
101+
filename: 'sitemap.xml',
102+
createSitemapItems: async (params) => {
103+
const { defaultCreateSitemapItems, ...rest } = params;
104+
const items = await defaultCreateSitemapItems(rest);
105+
106+
// Force trailing slash on URLs that don't have one:
107+
return items
108+
.map((item) => {
109+
if (!item.url.endsWith('/')) {
110+
item.url = `${item.url}/`;
111+
}
112+
return item;
113+
});
114+
},
115+
},
116+
88117
};
89118

90119
export default config;

0 commit comments

Comments
 (0)