django template with vim: replace static references in html
Using more elegant option {% static "my_file" %}. See https://docs.djangoproject.com/en/1.8/howto/static-files/
To replace all instances os src="./img/my_image.jpg"...
:%s/src="\.\(.\{-}\)"/src="{% static '\1' %}"/g
To replace all instances os href="./css/my_style.css"...
:%s/href="\.\(.\{-}\)"/href="{% static '\1' %}"/g
Written by javier wilson
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Templates
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#