Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.

Fix alternative template bundles #771

Merged
merged 1 commit into from
Sep 25, 2018
Merged

Conversation

t-kelly
Copy link
Contributor

@t-kelly t-kelly commented Sep 24, 2018

What are you trying to accomplish with this PR?

Fixes #707

Now when you have:

  • template/page.liquid
  • templates/page.alternate.liquid
  • scripts/templates/page.js
  • scripts/templates/page.alternate.js

The following bundles are generated:

  • template.page.js
  • template.page.alternate.js

And the following conditions generated in snippets/style-tags.liquid:

{%- if template == 'product.alternate' -%}
<script type="text/javascript" src="{{ 'template.product.alternate.js' | asset_url }}" defer="defer"></script>
{%- else -%}
<link rel="prefetch" href="{{ 'template.product.alternate.js' | asset_url }}" as="script">
{%- endif -%} 

{%- if template == 'product' -%}
<script type="text/javascript" src="{{ 'template.product.js' | asset_url }}" defer="defer"></script>
{%- else -%}
<link rel="prefetch" href="{{ 'template.product.js' | asset_url }}" as="script">
{%- endif -%}

@t-kelly t-kelly self-assigned this Sep 24, 2018
@t-kelly t-kelly merged commit f2978b9 into master Sep 25, 2018
@t-kelly t-kelly deleted the fix-alternate-template-bundles branch September 25, 2018 16:34
@lock
Copy link

lock bot commented Oct 26, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant