question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

It would be really cool to add the possibility to extend other pages and complete blocks like this :

Base.ejs :

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <title><%- block title %><%- endblock %></title>

        <%- block stylesheets %><%- endblock %>
        <%- block javascripts %><%- endblock %>
    </head>
    <body>
        <%- block body %><%- endblock %>
    </body>
</html>

HomePage.ejs

<%- extends "Base.ejs" %>

<%- block title "EJS" %>

<%- block body %>
    <h1>Hello EJS !</h1>
<%- endblock %>

Thank you for your attention !

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:43
  • Comments:5

github_iconTop GitHub Comments

13reactions
rivycommented, Nov 27, 2020

It already exists and it’s called includes: https://ejs.co/#docs

That’s the inverse of the request; it’s not the same thing at all.

12reactions
Bluzzicommented, Nov 29, 2020

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 !

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I add to List<? extends Number> data structures?
Sorry, but you can't. The wildcard declaration of List<? extends Number> foo3 means that the variable foo3 can hold any value from a...
Read more >
extends - JavaScript - MDN Web Docs - Mozilla
The extends keyword is used in class declarations or class expressions to create a class that is a child of another class.
Read more >
Sass: @extend
When one class extends another, Sass styles all elements that match the extender as though they also match the class being extended. When...
Read more >
TSConfig Option: extends - TypeScript
How this setting affects your build.
Read more >
Extending Classes | Think Java | Trinket
Rather than add every possible feature to CardCollection , we can use inheritance to define subclasses. A subclass is a class that “extends”...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found