Skip to content

Hashed names of static files don't automatically rewrite in html #247

@Utshaan

Description

@Utshaan

Files in static and public folder look like these respectively

❯tree static/vids
static/vids
├── ck.mp4
└── ck1.mp4

❯tree public/vids
public/vids
├── ck.d4c13650440d.mp4
└── ck1.24c2o03120a0.mp4

Desired ideal behavior

base.html that does not work (but should give ideal behavior):

<div class="content">
  <video controls width="100%">
    <source src="vids/ck1.mp4" type="video/mp4">
    Your browser does not support the video tag.
  </video>
  {% block content %}{% endblock %}
</div>

The corresponding error from the logs is

GET /vids/ck1.mp4 -> 404 status=404 latency_ms=11.432709

Poor fix

<div class="content">
  <video controls width="100%">
    <source src="vids/ck1.24c2o03120a0.mp4" type="video/mp4">
    Your browser does not support the video tag.
  </video>
  {% block content %}{% endblock %}
</div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions