Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
lexoyo committed May 4, 2023
1 parent 234602f commit 3b65a60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 36 deletions.
36 changes: 0 additions & 36 deletions .eleventy.js
Expand Up @@ -46,40 +46,4 @@ module.exports = (eleventyConfig, _options) => {
// Add filters
eleventyConfig.addFilter(`${options.name}_asseturl`, (...args) => directus.getAssetUrl(...args))
eleventyConfig.addFilter(`${options.name}_translate`, (...args) => directus.translate(...args))
// eleventyConfig.addFilter(`${options.name}.alternates`, item => {
// const languages = await this.getLanguages() || [{code: ''}]
// async getAlternates(item) {
// if(!item) throw new Error('Error: canot get alternates of an undefined item')
// const languages = await this.getLanguages()
// return languages.reduce((result, lang) => ({
// ...result,
// [lang.code]: permalink(translate(item, lang), false),
// }), {})
// }
// })

// async getLanguages() {
// try {
// return this.getCollection('languages', {
// ...OPTION_LIMIT(),
// })
// } catch(e) {
// console.warn('Could not get languages', e)
// return null
// }
// }
//
// processCollectionItem
// // add permalink and URL (collection and lang are required for this to work)
// const permalinkedItem = {
// ...translatedItem,
// permalink: permalink(translatedItem),
// url: absolute(permalink(translatedItem)), // used in sitemap
// data: { // backward compat with other file-based collections
// permalink: permalink(translatedItem),
// url: absolute(permalink(translatedItem)),
// },
// }
// return permalinkedItem
// }
}
3 changes: 3 additions & 0 deletions docs/index.md
@@ -0,0 +1,3 @@
# Documentation Directus plugin for Eleventy

[Usage in templates]

0 comments on commit 3b65a60

Please sign in to comment.