Git Product home page Git Product logo

Comments (8)

goliatone avatar goliatone commented on May 27, 2024 1

@cemremengu Sorry, missed the comment. I ended up having to fork both point-of-view and ejs-mate. The way it was setup locals were not being properly propagated, I ended up adding a couple more features, meaning it might not be a straight PR to either project.

from point-of-view.

TheRTK avatar TheRTK commented on May 27, 2024 1

Hello!
I think you try use ejs engine for ejs-mate

I had same problem with this code:

fastify.register(require('point-of-view'), {
    engine: {
      ejs: require('ejs-mate')
    },
    includeViewExtension: true,
    templates: './templates',
    options: {
      filename: resolve('templates')
    }
  });

Then i change engine ejs to ejs-mate and now its working:

  fastify.register(require('point-of-view'), {
    engine: {
      'ejs-mate': require('ejs-mate') // here need set 'ejs-mate'
    },
    includeViewExtension: true,
    templates: './templates',
    options: {
      filename: resolve('templates')
    }
  });

from point-of-view.

cemremengu avatar cemremengu commented on May 27, 2024

I will take a look at this, unfortunately it supports only version 2.3.0 atm

from point-of-view.

cemremengu avatar cemremengu commented on May 27, 2024

@goliatone if you would like to submit a PR I will take at as well :)

from point-of-view.

goliatone avatar goliatone commented on May 27, 2024

@TheRTK it would not surprise me that I made a silly mistake like that. However, I wanted to add support for some features I had in my previous setup like being able to resolve views from different view folders, a better way to manage locals (config file with locals per route, defaults, merging, etc). Thanks for the heads up tho!

from point-of-view.

calumk avatar calumk commented on May 27, 2024

Hello all, any progress on this?

Could I suggest a reference to requiring 2.3.0 is added to the readme?
I spent about half an hour trying to figure out why it wasn't working, including reading this thread twice, before realising that the sample @TheRTK provided as "working" was only "working" on the 2.3.0 branch

from point-of-view.

Eomm avatar Eomm commented on May 27, 2024

Improving the readme is always a good idea! Would you like to add this?

There is a PR #81 to discuss to update to ejs-mate 3.0.0 but seems stalled due to the project inactivity.

from point-of-view.

stale avatar stale commented on May 27, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from point-of-view.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.