pugjs / pug

Pug – robust, elegant, feature rich template engine for Node.js
https://pugjs.org
21.54k stars 1.96k forks source link

Block content not render #3432

Open EmmanuelLefevre opened 1 month ago

EmmanuelLefevre commented 1 month ago

Hello, i try to use Pug, it seems there is a problem with the block content rendering. Even if i put the home.pug file in the same directory as my layout.pug, nothing is render!!! Includes works though.. I've also try relative or absolute path on extends, downgrade my node version to v16 but nothing works.

layout.pug =>

doctype html
html(lang="fr")
  head
    meta(charset="UTF-8")
    meta(name="viewport", content="width=device-width, initial-scale=1.0")
    link(rel="stylesheet", href="assets/css/main.css")
    script(src="https://unpkg.com/htmx.org@1.9.10")
    title Artiwave

  body

    block header
      include ../includes/header

    block appContent

    block footer
      include ../includes/footer

home.pug =>

extends ./layout

block appContent
  main
    p Hello Artiwave

NodeJS v20.10.0 Express 4.18.12 Pug 3.0.2

jeromew commented 1 month ago

https://pugjs.org/language/inheritance.html have you tried extends layout.pug

other than that, stackoverflow is your best bet I think

EmmanuelLefevre commented 1 month ago

Yes i've already try to put extension name after the file..