• HOME
    • PRODUCT
    • PRICING
    • ABOUT
    • COMMUNITY
    Menu
    • HOME
    • PRODUCT
    • PRICING
    • ABOUT
    • COMMUNITY
    Get in touch
    Get in touch
    Menu
    • HOME
    • PRODUCT
    • PRICING
    • ABOUT
    • COMMUNITY
    • Sign in
    • Start free trial
    • Get in touch
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups
    • Documentation
      • Home
      • Read API
      • Write API
      • Plugin Development
    1. Home
    2. bogus
    B
    • Profile
    • Following 0
    • Followers 0
    • Topics 6
    • Posts 22
    • Best 6
    • Controversial 0
    • Groups 1

    Alexander Bogdanov

    @bogus

    GNU/Linux

    11
    Reputation
    589
    Profile views
    22
    Posts
    0
    Followers
    0
    Following
    Joined Last Online
    Website http://

    bogus Unfollow Follow
    GNU/Linux

    Best posts made by bogus

    • using Jade with NodeBB - mission complete

      Hello!

      I've done (well, almost) it on my branch of NodeBB -- abstract out templates engine and add support of Jade in addition to templates.js 😋
      Actually now it's posible to add more template engines in a similar fasion.

      There are glitches of course but in general everything looks good.

      Motivation

      In my opinion templates.js is cute but a little too lightweight. And at the same time its syntax is quite verbose and looks like "broken html". But ofcourse I can't just frop it. It do its job good and all currently working code use it.
      What I wanted is posibility to use another template engines that won't broke everything.

      Architecture overview:

      • I've replaced templates.js with general library (nodebb-templatist)
        It delegates temlate compilation, loading and rendering to concrete function choosen by template type
      • Concrete library like nodebb-templatist-tpl or nodebb-templatist-jade registers template compiler and loader with general library.
      • Template compiler function asyncronously returns dictionary with relative file names and content
      • Loader function asynchronously returns "render" function for given template name

      Existing problems

      • Luck of careful testing
      • It would be cool if that concrete template engines be simply a kind of NodeBB plugins. But currently I can't do it because templates compilation runs before plugins are loaded and initialized.
      • templates.js can render not only whole template but a specific template block. This ability isnt present in most of other engines. I have a couple of ideas how to implement that but I'm not sure.
      • Cross-engine partial includes can be implemented but requires additional hacking on top of template parsing.

      That's it!

      I can make pull request after some cleanups.
      This post is an anounce and invitation to a discussion 🙂

      posted in NodeBB Development
      B
      Alexander Bogdanov
    • RE: Introduce yourself!!!

      Can't believe I've missed this thread!

      It's so... cute!... 👪

      posted in General Discussion
      B
      Alexander Bogdanov
    • RE: Consolidation of template languages

      Here it is!
      https://community.nodebb.org/topic/4170/using-jade-with-nodebb-mission-complete

      posted in Feature Requests
      B
      Alexander Bogdanov
    • RE: Additional resource variables

      I think you should reformulate your question. What is your goal and what that template variables should do?

      posted in Technical Support
      B
      Alexander Bogdanov
    • RE: using Jade with NodeBB - mission complete

      ok, PR was fired

      posted in NodeBB Development
      B
      Alexander Bogdanov
    • RE: Consolidation of template languages

      @psychobunny my template abstraction layer looks working for me 🙂
      Unfortunately the project in which I hoped to use NodeBB is wanished.
      But I'm still not lost my interest. PR was fired and waiting for review 🙂

      Maybe I'll make my own theme fully with Jade. Some day... 🙂

      As for supported template engines - there are modules for t.js templates and for Jade. I can add more engines if anyone needed.

      Main unresolved problems are:

      • rendering of template block is supported only with t.js For other engines I only pass special variable that indicates what block is requested so it can be considered on template level
      • calling helpers is quite complicated in t.js so you have to be carefull when using partials with another engine
      • no generic cross-engine imports and partials

      I personaly don't think that these problems overweight benefits granted.

      posted in Feature Requests
      B
      Alexander Bogdanov

    Latest posts made by bogus

    • RE: Consolidation of template languages

      @psychobunny my template abstraction layer looks working for me 🙂
      Unfortunately the project in which I hoped to use NodeBB is wanished.
      But I'm still not lost my interest. PR was fired and waiting for review 🙂

      Maybe I'll make my own theme fully with Jade. Some day... 🙂

      As for supported template engines - there are modules for t.js templates and for Jade. I can add more engines if anyone needed.

      Main unresolved problems are:

      • rendering of template block is supported only with t.js For other engines I only pass special variable that indicates what block is requested so it can be considered on template level
      • calling helpers is quite complicated in t.js so you have to be carefull when using partials with another engine
      • no generic cross-engine imports and partials

      I personaly don't think that these problems overweight benefits granted.

      posted in Feature Requests
      B
      Alexander Bogdanov
    • RE: Consolidation of template languages

      Here it is!
      https://community.nodebb.org/topic/4170/using-jade-with-nodebb-mission-complete

      posted in Feature Requests
      B
      Alexander Bogdanov
    • RE: Introduce yourself!!!

      Can't believe I've missed this thread!

      It's so... cute!... 👪

      posted in General Discussion
      B
      Alexander Bogdanov
    • RE: exception throws on login

      actually this is a duplicate of https://community.nodebb.org/topic/4269/502-proxy-error-on-login/7

      posted in Bug Reports
      B
      Alexander Bogdanov
    • paginator visual bug when empty / should be hidden instead?

      A picture is worth a thousand words

      http://joxi.ru/Y2LjQ3NIVZkDr6

      NodeBB master at 27049a218082a169755f37cb32674aadb4f25ebd
      [email protected]

      posted in Bug Reports
      B
      Alexander Bogdanov
    • exception throws on login

      Hello!

      Login is broken after commit fa9fde4
      Throws an exception:

      15/4 15:13 [23541] - error: TypeError: undefined is not a function
          at /home/bogus/projects/downloaded/NodeBB/src/database/redis/main.js:121:4
          at try_callback (/home/bogus/projects/downloaded/NodeBB/node_modules/redis/index.js:573:9)
          at RedisClient.return_reply (/home/bogus/projects/downloaded/NodeBB/node_modules/redis/index.js:661:13)
          at ReplyParser.<anonymous> (/home/bogus/projects/downloaded/NodeBB/node_modules/redis/index.js:309:14)
          at ReplyParser.emit (events.js:95:17)
          at ReplyParser.send_reply (/home/bogus/projects/downloaded/NodeBB/node_modules/redis/lib/parser/javascript.js:300:10)
          at ReplyParser.execute (/home/bogus/projects/downloaded/NodeBB/node_modules/redis/lib/parser/javascript.js:189:22)
          at RedisClient.on_data (/home/bogus/projects/downloaded/NodeBB/node_modules/redis/index.js:534:27)
          at Socket.<anonymous> (/home/bogus/projects/downloaded/NodeBB/node_modules/redis/index.js:91:14)
          at Socket.emit (events.js:95:17)
      

      @baris

      posted in Bug Reports
      B
      Alexander Bogdanov
    • RE: using Jade with NodeBB - mission complete

      It's exactly how it's working! And you still can render it by name like 'categories' without extension.

      posted in NodeBB Development
      B
      Alexander Bogdanov
    • RE: using Jade with NodeBB - mission complete

      ok, PR was fired

      posted in NodeBB Development
      B
      Alexander Bogdanov
    • RE: using Jade with NodeBB - mission complete

      @julian, well, yes. PR merged into core would be greate, this is what PRs for 🙂

      I understood that temlates.js can't be replaced that easy and I don't know if it really should be replaced. This is why I'm trying not to break it.
      For now no templates need to be updated. Any code that uses templates through ajaxify just continue to work. And only code that use templates.js directly may need small update.

      What do you think about?

      posted in NodeBB Development
      B
      Alexander Bogdanov
    • RE: using Jade with NodeBB - mission complete

      Well I'm probably too dramatize.
      Large part helpers may be normalized that it will get parameters from current block context by name and returns string. That kind of helpers I believe may be registered for any engine.
      All other posibilities and differences have to be solved within helper functions code.

      posted in NodeBB Development
      B
      Alexander Bogdanov

    Get Started

    • Product
    • Pricing

    Resources

    • Demo Site
    • Answers
    • Docs
    • Bug Bounty

    Company

    • About
    • Blog
    • Contact
    Start Free Trial
    Github Facebook Instagram Twitter
    © 2014 – 2022 NodeBB, Inc. — Made in Canada.
    • Terms
    • Privacy
    • GDPR
    • DMCA
    • Contact
    Menu
    • Terms
    • Privacy
    • GDPR
    • DMCA
    • Contact