2017-09-28 3 views

答えて

1

あなたが別のものにパグ・ファイルを含める場合は、includeを使用することができます。

doctype html 
html 
    include includes/head.pug 
    body 
    h1 Content 
    inlucde includes/body/content.pug 
    h1 Footer 
    inlucde includes/body/footer.pug 

Read more about includesTemplate Inheritanceもご覧ください。

+0

すべてのファイルを含む何らかの方法が存在するかどうかを知りたいと思います。たとえば、 'include layout/*。pug' –

+0

Mmhです。私はわかりません。ループなどを使用して、すべてのファイルを含めることができます。ただし、ターゲットファイルの名前を指定する必要があります。 [here](https://stackoverflow.com/questions/43967240/how-to-use-for-loop-including-files-in-jade-pug)および[ここ](https://pugjs.org)を参照してください。 /language/iteration.html)。名前を自動的に取得する方法があるかもしれません。 – pzaenger

関連する問題