How to use hexo-generator-archive - 1 common examples

To help you get started, we’ve selected a few hexo-generator-archive examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ppoffice / hexo-theme-minos / scripts / 10_i18n.js View on Github external
return _.flatten(languages.map((language) => {
        // Filter posts by language considering. Posts without a language is considered of the default language.
        const posts = locals.posts.filter(postFilter(language));
        if (posts.length === 0) {
            return null;
        }
        const routes = archiveGenerator.call(this, Object.assign({}, locals, {
            posts: posts
        }));
        if (isDefaultLanguage(language)) {
            return routes;
        }
        return routes.map(route => {
            const data = Object.assign({}, route.data, {
                base: pathJoin(language, route.data.base),
                current_url: pathJoin(language, route.data.current_url)
            });
            return Object.assign({}, route, {
                path: pathJoin(language, route.path),
                data: data
            });
        });
    }).filter(post => post !== null));

hexo-generator-archive

Archive generator for Hexo.

MIT
Latest version published 2 years ago

Package Health Score

64 / 100
Full package analysis

Popular hexo-generator-archive functions