N
N
Norum2021-10-19 13:29:10
css
Norum, 2021-10-19 13:29:10

How does a multi-page site template look right in PUG?

Usually, when creating a multi-page site, a separate html file is created for each page: portfolio.html, about.html, etc. with a similar template

<!DOCTYPE html>
<html lang="ru">
  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Title</title>
  </head>
  <body> 
    <header class="header"></header>
   <div class="main">
    Контент страницы
   </div>
  </body>
  <footer></footer>
</html>


How should the template look like for other pages on PUG? It is clear that there should be a special pug template, but how to structure it and where to connect it? It seems like nonsense, but still. At first I thought that just in index.pug all pages are connected via include in a row, such as include header.pug , include main.pug, include footer.pug, but then I realized that this would be suitable for landing, but not for a multi-page site, but on the network I did not find a normal explanation

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Froggyweb, 2021-10-19
@Froggyweb

You make a basic template like yours
Instead of Content - block content
In the template you do an extend from the base template and insert block
You can basically look in my assembly https://github.com/FroggyWeb/gulp-newstart/tree/ma...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question