Skip to content

Commit

Permalink
Add more js Bundle options
Browse files Browse the repository at this point in the history
  • Loading branch information
Jieiku committed Feb 11, 2023
1 parent 7207c18 commit 7e39d93
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"scripts": {
"searchonly": "uglifyjs static/elasticlunr.min.js static/search.js -c -m -o static/abridge-searchonly.min.js",
"noswitcher": "uglifyjs static/prestyle.js static/email.js static/codecopy.js static/elasticlunr.min.js static/search.js -c -m -o static/abridge-bundle-noswitcher.min.js",
"nosearch": "uglifyjs static/prestyle.js static/theme_button.js static/email.js static/codecopy.js -c -m -o static/abridge-bundle-nosearch.min.js",
"noswitchernosearch": "uglifyjs static/prestyle.js static/email.js static/codecopy.js -c -m -o static/abridge-bundle-noswitchernosearch.min.js",
"nofacade": "uglifyjs static/prestyle.js static/theme_button.js static/email.js static/codecopy.js static/elasticlunr.min.js static/search.js -c -m -o static/abridge-bundle-nofacade.min.js",
"theme": "uglifyjs static/theme.js -c -m -o static/theme.min.js",
"katex-bundle": "uglifyjs static/katex.min.js static/mathtex-script-type.min.js static/auto-render.min.js static/katexoptions.js -c -m -o static/katexbundle.min.js",
Expand Down
1 change: 1 addition & 0 deletions static/abridge-bundle-nosearch.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions static/abridge-bundle-noswitchernosearch.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions templates/macros/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@

{#- no search #}

{%- if config.extra.js_switcher %}

<script defer src="{{ get_url(path='abridge-bundle-nosearch.min.js', trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity %} integrity="sha384-{{ get_file_hash(path='abridge-bundle-nosearch.min.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script>
{%- else %}

<script defer src="{{ get_url(path='abridge-bundle-noswitchernosearch.min.js', trailing_slash=false, cachebust=true) | safe }}"{%- if config.extra.integrity %} integrity="sha384-{{ get_file_hash(path='abridge-bundle-noswitchernosearch.min.js', sha_type=384, base64=true) | safe }}"{%- endif %}></script>
{%- endif %}

{%- else %}

{#- no bundle or search #}
Expand Down

0 comments on commit 7e39d93

Please sign in to comment.