Skip to content

Commit

Permalink
Group reference sections with navigation entries
Browse files Browse the repository at this point in the history
  • Loading branch information
imacrayon committed Mar 3, 2024
1 parent d98ba5b commit 24075e7
Show file tree
Hide file tree
Showing 17 changed files with 1,181 additions and 790 deletions.
14 changes: 13 additions & 1 deletion docs/eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ module.exports = function (eleventyConfig) {

eleventyConfig.addGlobalData('APLINE_AJAX_VERSION', () => process.env.npm_package_version)

eleventyConfig.on("eleventy.before", async () => {
eleventyConfig.addFilter('sort', (collection, path = '') => {
let keys = path.split('.')
let value = (entry) => keys.reduce((v, k) => v?.[k], entry)

return collection.slice().sort((a, b) => value(a) - value(b))
})

eleventyConfig.on('eleventy.before', async () => {
await esbuild.build({
entryPoints: ['js/main.js'],
bundle: true,
Expand All @@ -67,4 +74,9 @@ module.exports = function (eleventyConfig) {
eleventyConfig.setServerOptions({
watch: ['_sites/**/*.js'],
})

return {
markdownTemplateEngine: 'njk',
htmlTemplateEngine: "njk",
}
}
Loading

0 comments on commit 24075e7

Please sign in to comment.