Skip to content
Merged
48 changes: 48 additions & 0 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Shopify Lighthouse CI

on:
pull_request:
types: [opened, synchronize]
jobs:
get-environment:
runs-on: ubuntu-latest
outputs:
environment: ${{ steps.get_environment.outputs.environment }}
steps:
- id: get_environment
name: Get Environment
run: |

target_branch="${{ github.event.pull_request.base.ref }}"
echo "Target branch: $target_branch"

if [[ $target_branch = "develop" ]]
then
echo "environment=develop" >> $GITHUB_OUTPUT
elif [[ $target_branch = "main" ]]
then
echo "environment=main" >> $GITHUB_OUTPUT
else
echo "error: Could not determine environment"
exit 1
fi
lighthouse-check:
runs-on: ubuntu-latest
needs: ["get-environment"]
environment:
name: ${{ needs.get-environment.outputs.environment }}
strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v2
- name: Lighthouse
uses: shopify/lighthouse-ci-action@v1.2.2
with:
access_token: ${{ secrets.SHOP_ACCESS_TOKEN }}
store: ${{ secrets.SHOP_STORE }}
password: ${{ secrets.SHOP_PASSWORD }}
lhci_github_app_token: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
product_handle: test-product
collection_handle: all
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config.yml
shopify.theme.toml
304 changes: 304 additions & 0 deletions layout/theme-easylockdown-bckp.liquid

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion layout/theme.liquid
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html class="js" lang="{{ request.locale.iso_code }}">
<head>
{% comment %}ElHeadStart{% endcomment %}{% unless request.design_mode %}{% comment %}EasylockdownHeadBegin{% endcomment %}{% capture elhRender %}{% render 'easylockdown_head', easylockdownRender: true, easylockdownOnlySpecialPriceSelector: easylockdownOnlySpecialPriceSelector, easylockdownCustomPriceSelector: easylockdownCustomPriceSelector %}{% endcapture %}{% assign elhRender = elhRender | split: '--elhResults--'%}{{ elhRender[0] }}{% comment %}EasylockdownHeadEnd{% endcomment %}{% endunless %}{% comment %}ElHeadEnd{% endcomment %}
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
Expand Down Expand Up @@ -310,7 +311,7 @@
{% sections 'header-group' %}

<main id="MainContent" class="content-for-layout focus-none" role="main" tabindex="-1">
{{ content_for_layout }}
{% comment %}ElBodyStart{% endcomment %}{% unless request.design_mode %}{% comment %}{{ content_for_layout }}{% endcomment %}{% render 'easylockdown_body', content_for_layout: content_for_layout, elhDefines: elhRender[1] %}{% else %} {{ content_for_layout }} {% endunless %}{% comment %}ElBodyEnd{% endcomment %}
</main>

{% sections 'footer-group' %}
Expand Down
5 changes: 5 additions & 0 deletions snippets/easylockdown_body.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% unless request.design_mode %}
{{ content_for_layout }}
{% else %}
{{ content_for_layout }}
{% endunless %}
Empty file.
Empty file.
Empty file.
Empty file.
14 changes: 14 additions & 0 deletions snippets/easylockdown_password_form.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<div id="easylockdown-password-form" style="display: none;">
<div id="easylockdown-wrapper">
{% unless easylockdownPasswordNote == '' %}
<div id="easylockdown-password-note">{{ easylockdownPasswordNote }}</div>
{% endunless %}

<div class="easylockdown-form-holder">
<div id="easylockdown-password-error">Invalid password</div>
<input type="password" placeholder="{{ easylockdownPasswordPlaceholder }}" id="easylockdown-password"
onkeypress="if( event.keyCode == 13 && typeof easylockdown == 'object' && typeof easylockdown.checkUnlockPassword == 'function' ) { event.preventDefault(); easylockdown.checkUnlockPassword(this); }" />
<a href="javascript:void(0);" id="easylockdown-password-form-button" onclick="if( typeof easylockdown == 'object' && typeof easylockdown.checkUnlockPassword == 'function' ) easylockdown.checkUnlockPassword(this);">Enter</a>
</div>
</div>
</div>
11 changes: 10 additions & 1 deletion templates/index.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
* ------------------------------------------------------------
* IMPORTANT: The contents of this file are auto-generated.
*
* This file may be updated by the Shopify admin theme editor
* or related systems. Please exercise caution as any changes
* made to this file may be overwritten.
* ------------------------------------------------------------
*/
{
"sections": {
"image_banner": {
Expand All @@ -6,7 +15,7 @@
"heading": {
"type": "heading",
"settings": {
"heading": "Browse our latest products",
"heading": "Browse our latestBrowse our latest",
"heading_size": "h0"
}
},
Expand Down
Loading