0

とを使用するオンラインの例を見つけました。コードは次のようになります。collectionspermalinks

Metalsmith(__dirname)
    .use(collections({
        pages: {
            pattern: 'content/pages/*.md'
        },
        posts: {
            pattern: 'content/posts/*.md',
            sortBy: 'date',
            reverse: true
        }
    }))
    .use(markdown())
    .use(permalinks({
        pattern: ':collection/:title'
    }))
    .use(templates('handlebars'))
    .destination('./build')
    .build()

このファイル構造を変換するもの:

src/
    index.md
    content/
        pages/
            aboud.md
            blog.md
        posts/
            first-post.md

に:

build/
    index.html
    content/pages/ (empty??)
    pages/
        about/ -> index.html
        blog/ -> index.html
    posts/
        first-post/ -> index.html

src/index.mdコレクションと同様に変換されることに注意してください。しかし、1.0.0では、同じコードがコレクションのみを変換し、 に対してエラーをスローしますindex.mdError: UNKNOWN, open '/home/index.html'

何か案が?

4

0 に答える 0