Code Monkey home page Code Monkey logo

Comments (6)

smnandre avatar smnandre commented on August 24, 2024 5

If you need to compile assets via asset mapper, today you cannot escape versionning. If you need to deploy assets to the public folder, the Asset package can do it for you.

https://symfony.com/doc/current/components/asset.html

But if your problem is related to the markdown example you gave, there is a better solution i think : render the twig file once and then call the markdown filter

So let's say you have a article.md.twig

# Title of your article

Lorem ipsum damet

[{{ article.alt }}]({{ absolute_url(asset('images/my-file.png')) }})

In another template, you can do this:

{% set content = include('article.md.html') %}

{% apply markdown_to_html %}
   {{ content }}
{% endapply %}   

from symfony-docs.

smnandre avatar smnandre commented on August 24, 2024

No it's not possible for now sorry

from symfony-docs.

programarivm avatar programarivm commented on August 24, 2024

What about using a command option?

php bin/console asset-map:compile --unversioned

from symfony-docs.

smnandre avatar smnandre commented on August 24, 2024

If you need to deploy unversionned asset you still can use the Asset component !

from symfony-docs.

programarivm avatar programarivm commented on August 24, 2024

Sorry, I wasn't able to find any documentation on how to "compile" the assets so that the hash won't be appended to the filenames. Can you please provide an example command for this?

🙏 Thank you!

from symfony-docs.

programarivm avatar programarivm commented on August 24, 2024

Thanks for the help, it is very much appreciated! I just created a folder called public/blog for my static blog images. It seems as if the simplest solution is to put the blog images in the public directory as opposed to the assets directory for them to then be referenced in the Markdown documents. See templates/post.html.twig

from symfony-docs.

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.