* get link liquid tag to accept variables as param * new liquid tag `link_as_article_card` * refactor link liquid tag slightly so we can control what props get rendered * generalize filterCodeExample to use in all guides section * pass in `js-filter-card-max` instead of hardcode max * tweaks and add `data` to CSP for images * add liquid tag tests * add some browser tests for card filters * we still need to rely on `getPathWithLanguage` for hrefs that already have the language code embedded Co-authored-by: Emily Gould <4822039+emilyistoofunky@users.noreply.github.com>
Javascripts
The code in this directory is destined to run in a web browser!
The index.js file in this directory is bundled by Webpack. In development, we use webpack-dev-middleware to bundle automatically while running the server. In production, we run webpack --mode production via npm run build.
This file is then referenced in the footer:
<script src="/dist/index.js"></script>
Every other file in this directory is written as a module to
be required in index.js. They all have this format:
module.exports = () => {
// Do some cool browser stuff
// Note: by the time this runs, the DOM will be ready. :)
}
In development, the bundle will recompile every time a file used by javascripts/index.js is changed. This
ensures that you're always getting an up-to-date version of the script.
In production, the bundle is compiled during build-time.