Coder Social home page Coder Social logo

Comments (6)

GwendolenLynch avatar GwendolenLynch commented on June 15, 2024

Template overrides

Yeah, by all means update the docs. Most of these just assume a basic knowledge of Twig… but Twig docs are +/- in some ways.

Basically if you set up something like

pages:
    enabled: true
    feed_template: rss.twig

What Twig will do is first look in the Bolt defined paths for rss.twig, then in the root of the active theme, then in the extension's assets/ folder

You can even add relative paths, like foo/bar/rss.twig, e.g. I usually set up something like

pages:
    enabled: true
    feed_template: extensions/rss/rss.twig

…and in my theme directory create extensions/rss/ and add the Twig file there

from bolt-extension-rssfeed.

GwendolenLynch avatar GwendolenLynch commented on June 15, 2024

Markdown

Just create a separate Twig template for that ContentType and use the Twig |markdown filter that comes with Bolt, e.g.:

{{ record.foobar|markdown }} 

from bolt-extension-rssfeed.

doenietzomoeilijk avatar doenietzomoeilijk commented on June 15, 2024

re template overrides: that's actually better than I hoped for - I was wondering whether there would be a generic way of overriding plugin templates, guess that's a yes. :) Maybe the wording in the config could be slightly altered, but this is more of a Bolt thing, then, worth mentioning somewhere in the template section. That's where I expected it most.

re Markdown: yeah, that's what I did. I figured I didn't really need the HTML scrubbing. Just in case I ever do feel the need, what would be the best way to go about combining the two? Would it make sense to have the plugin auto-parse any markdown fields in the record, or make that a switchable behaviour?

from bolt-extension-rssfeed.

GwendolenLynch avatar GwendolenLynch commented on June 15, 2024

but this is more of a Bolt thing, then, worth mentioning somewhere in the template section. That's where I expected it most.

It's a Twig thing very specifically. We don't try to cover off too much documentation of upstream libraries, generally speaking, as… resources 😁

Would it make sense to have the plugin auto-parse any markdown fields in the record, or make that a switchable behaviour?

No, that belongs in a custom template. Markdown is loved by many, but not fabulous on performance. so impacting every single call for every single user doesn't make sense.

from bolt-extension-rssfeed.

doenietzomoeilijk avatar doenietzomoeilijk commented on June 15, 2024

It's a Twig thing very specifically. We don't try to cover off too much documentation of upstream libraries, generally speaking, as… resources 😁

OK, that makes sense then. Just something you'd have to know.

No, that belongs in a custom template. Markdown is loved by many, but not fabulous on performance. so impacting every single call for every single user doesn't make sense.

Fair enough. Maybe worth mentioning in a readme somewhere, then?

from bolt-extension-rssfeed.

bobdenotter avatar bobdenotter commented on June 15, 2024

Bit of a late reply, but the extension supports markdown now.

from bolt-extension-rssfeed.

Related Issues (12)

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.