Skip to content

Commit

Permalink
Snipcart Addition
Browse files Browse the repository at this point in the history
  • Loading branch information
s2moore committed Jun 15, 2023
1 parent 3e48b30 commit fda878a
Show file tree
Hide file tree
Showing 7 changed files with 255 additions and 170 deletions.
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ plugins:
- jekyll-sitemap
- jekyll-paginate
- jekyll-seo-tag

collections:
- products

authors:
sal:
Expand Down
6 changes: 6 additions & 0 deletions _includes/product-definition.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<button class="buy-button snipcart-add-item" data-item-id="{{ product.identifier }}" data-item-name="{{ product.name }}"
data-item-price="{{ product.price }}" data-item-image="{{ product.image }}"
data-item-url="https://snipcart-jekyll.netlify.com{{ page.url }}"
data-item-description="{{ product.content | remove: '<p>' | remove: '</p>' }}">
Add to cart (${{ product.price }})
</button>
9 changes: 9 additions & 0 deletions _includes/product.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div class="product">
<div class="product__information">
<h2 class="product__title">{{ product.name }}</h2>
<p class="product__description">{{ product.content | remove: '
<p>' | remove: '</p>' }}</p>
{% include product-definition.html %}
</div>
<img src="{{ product.image }}" alt="{{ product.name }} product image" class="product__image">
</div>
25 changes: 20 additions & 5 deletions _includes/tracking-header.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
<!-- This goes before </head> closing tag, Google Analytics can be placed here -->
<!-- This goes before </head> closing tag, Google Analytics can be placed here -->

<head><!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-NR0RSJSH30"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());

gtag('config', 'G-NR0RSJSH30');
gtag('config', 'G-NR0RSJSH30');
</script>
</head>


<!--Snipcart E-commerce-->

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title>
<meta name="description"
content="{{ page.excerpt | default: site.description | strip_html | normalize_whitespace | truncate: 160 | escape }}">
<link rel="stylesheet" href="{{ " /assets/main.css" | relative_url }}">
<link rel="stylesheet" href="https://cdn.snipcart.com/themes/v3.0.0-beta.3/default/snipcart.css" />
<link rel="canonical" href="{{ page.url | replace:'index.html','' | absolute_url }}">
</head>
90 changes: 59 additions & 31 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
Expand All @@ -11,7 +12,8 @@
<link rel="shortcut icon" type="image/x-icon" href="{{site.baseurl}}/{{site.favicon}}">

<!-- Font Awesome Icons -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"
integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">

<!-- Google Fonts-->
<link href="https://fonts.googleapis.com/css?family=Lora:400,400i,700" rel="stylesheet">
Expand All @@ -23,10 +25,8 @@
<link rel="stylesheet" href="{{site.baseurl}}/assets/css/theme.css">

<!-- Jquery on header to make sure everything works, the rest of the scripts in footer for fast loading -->
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>

<!-- Video YouTube Stylesheet -->
<link rel="stylesheet" href="{{site.baseurl}}/assets/css/styles.css">
Expand All @@ -35,24 +35,46 @@

</head>

<body class="{% if page.url == "/" %} homefirstpage {% endif %}">
<!--Snipcart E-commerce Here and in tracking-header.html in _includes-->
<!DOCTYPE html>
<html lang="{{ page.lang | default: site.lang | default: " en" }}">
{% include head.html %}

<body>
{% include header.html %}
<main class="main">
<div class="products">
{{ content }}
</div>
</main>
{% include footer.html %}
</body>
<div hidden id="snipcart" data-api-key="<MmFjNDQ5ZTItMmI2OS00YzRhLTgwMjEtZDczNmVmNDYyMDgzNjM4MjI0MjEzNDM3NTI2Njcz>">
</div>
<script src="https://cdn.snipcart.com/themes/v3.0.0-beta.3/default/snipcart.js" defer></script>

</html>


<body class="{% if page.url == " /" %} homefirstpage {% endif %}">

<!-- Navbar -->
<nav id="MagicMenu" class="topnav navbar navbar-expand-lg navbar-light bg-white fixed-top">
<div class="container">
<a class="navbar-brand" href="{{ site.baseurl }}/index.html"><strong>{{site.name}}</strong></a>
<button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse" id="navbarColor02" style="">
<ul class="navbar-nav mr-auto d-flex align-items-center">
{% include menu-header.html %}
</ul>
<ul class="navbar-nav ml-auto d-flex align-items-center">
{% include search-lunr.html %}
</ul>
<div class="container">
<a class="navbar-brand" href="{{ site.baseurl }}/index.html"><strong>{{site.name}}</strong></a>
<button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarColor02"
aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse" id="navbarColor02" style="">
<ul class="navbar-nav mr-auto d-flex align-items-center">
{% include menu-header.html %}
</ul>
<ul class="navbar-nav ml-auto d-flex align-items-center">
{% include search-lunr.html %}
</ul>
</div>
</div>
</div>
</nav>

<!-- Search Results -->
Expand All @@ -67,37 +89,43 @@


<!-- Scripts: popper, bootstrap, theme, lunr -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"
integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut"
crossorigin="anonymous"></script>

<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"
integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k"
crossorigin="anonymous"></script>

<script src="{{site.baseurl}}/assets/js/theme.js"></script>


<!-- Footer -->
<footer class="bg-white border-top p-3 text-muted small">
<div class="container">
<div class="row align-items-center justify-content-between">
<div>
<span class="navbar-brand mr-2 mb-0"><strong>raceto11</strong></span>
<span>Copyright © <script>document.write(new Date().getFullYear())</script>.</span>
<div class="row align-items-center justify-content-between">
<div>
<span class="navbar-brand mr-2 mb-0"><strong>raceto11</strong></span>
<span>Copyright ©
<script>document.write(new Date().getFullYear())</script>.
</span>

<!-- Github Repo Star Btn-->
<!--<a class="text-dark ml-1" target="_blank" href="https://github.com/wowthemesnet/mundana-theme-jekyll"><i class="fab fa-github"></i> Fork on Github</a>-->
<!-- Github Repo Star Btn-->
<!--<a class="text-dark ml-1" target="_blank" href="https://github.com/wowthemesnet/mundana-theme-jekyll"><i class="fab fa-github"></i> Fork on Github</a>-->

</div>
<!--<div>
</div>
<!--<div>
Made with <a target="_blank" class="text-dark font-weight-bold" href="https://www.wowthemes.net/mundana-jekyll-theme/"> Mundana Jekyll Theme </a> by <a class="text-dark" target="_blank" href="https://www.wowthemes.net">WowThemes</a>.
</div>-->
<div>
The Cue Sports Blog.
</div>
</div>
</div>
</div>
</footer>

{% include tracking-footer.html %}

</body>

</html>
</html>
7 changes: 7 additions & 0 deletions _products/product1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
identifier: jekyll-starry-night
name: Starry Night
price: 79.95
image: /assets/images/starry-night.jpg
**---**
This is a high-quality replica of The Starry Night by the Dutch post-impressionist painter Vincent van Gogh. Using brand new techniques such as magneto-reluctance and capacitive reactance, we were able to reproduce the original colours with a 99.99% accuracy.
Loading

0 comments on commit fda878a

Please sign in to comment.