Skip to content

Commit 36ab49b

Browse files
committed
Merge branch '4.4' into 5.0
* 4.4: Update copy-files.rst
2 parents e32eef5 + 8324762 commit 36ab49b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

frontend/encore/copy-files.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ To reference an image tag from inside a JavaScript file, *require* the file:
1818
// path is relative to this file - e.g. assets/images/logo.png
1919
const logoPath = require('../images/logo.png');
2020
21-
var html = `<img src="${logoPath}">`;
21+
let html = `<img src="${logoPath}" alt="ACME logo">`;
2222
2323
When you ``require`` (or ``import``) an image file, Webpack copies it into your
2424
output directory and returns the final, *public* path to that file.
@@ -60,10 +60,10 @@ To render inside Twig, use the ``asset()`` function:
6060
.. code-block:: html+twig
6161

6262
{# assets/images/logo.png was copied to public/build/logo.png #}
63-
<img src="{{ asset('build/logo.png') }}">
63+
<img src="{{ asset('build/logo.png') }}" alt="ACME logo">
6464

6565
{# assets/images/subdir/logo.png was copied to public/build/subdir/logo.png #}
66-
<img src="{{ asset('build/subdir/logo.png') }}">
66+
<img src="{{ asset('build/subdir/logo.png') }}" alt="ACME logo">
6767

6868
Make sure you've enabled the :ref:`json_manifest_path <load-manifest-files>` option,
6969
which tells the ``asset()`` function to read the final paths from the ``manifest.json``

0 commit comments

Comments
 (0)