-
Notifications
You must be signed in to change notification settings - Fork 844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "extends" #546
Comments
It already exists and it's called includes: https://ejs.co/#docs This syntax It may uses Javascript and follow this syntax to output the block content onto the page Anyway, there is already a feature for that so I don't think it would be interesting |
That's the inverse of the request; it's not the same thing at all. |
True, it's not quite the same thing but it achieves the same goals. Using
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><%= title %></title>
<%- stylesheets %>
<%- javascripts %>
</head>
<html>
<%- include('head', { title: 'EJS' }) %>
<body>
<h1>Hello EJS!</h1>
</body>
</html> Also, it's worth mentionning that the syntax is not consistent (here, you do not have to close the « block » for some reason) and it doesn't follow the Javascript syntax as I pointed out in my previous comment. <%- block title "EJS" %> This « feature » is unnecessary, includes can do all of that with more consistency. |
On several pages, it won't be less code. Moreover it forces to pass the title variable through another page. For your example, it's not relevant to do this for scripts and stylesheets. You are trying to argue for a pointless matter, it won't change anything for you if this feature is added. In short, stop polluting this issue with a different feature, I'm waiting for an answer from @mde ! |
Very good idea, i approve this ✔️ |
It would be really cool to add the possibility to extend other pages and complete blocks like this :
Base.ejs :
HomePage.ejs
Thank you for your attention !
The text was updated successfully, but these errors were encountered: