Skip to content

Instantly share code, notes, and snippets.

View thefln's full-sized avatar

Francois Lanthier Nadeau thefln

View GitHub Profile
---
layout: default
head:
snipcart.html
---
<div class="product-details">
<img src="{{ page.image }}" alt="{{ page.name }}" class="thumbnail"/>
<div class="product-description">
<p>{{ page.name }}</p>
<script src="https://cdn.snipcart.com/scripts/2.0/snipcart.js"
data-api-key="{{ site.api_key }}"
id="snipcart">
</script>
<link href="https://cdn.snipcart.com/themes/2.0/base/snipcart.min.css" rel="stylesheet" type="text/css" />
---
layout: default
head:
snipcart.html
---
<div class="products">
{{ content }}
</div>
<div class="product">
<a class="product" href="{{ site.baseurl }}{{ product.url }}">
<img src="{{ product.image }}" alt="{{ product.name }}" class="thumbnail"/>
<p>{{ product.name }}</p>
</a>
<button class="snipcart-add-item"
data-item-name="{{ product.name }}"
data-item-id="{{ product.sku }}"
---
layout: products
title: Store
---
{% for product in site.products %}
{% include product.html %}
{% endfor %}
<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 }}{% else %}{{ site.title }}{% endif %}</title>
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
---
name: How Google Works
price: 20.99
slug: how-google-works
sku: HGW
image: http://d.gr-assets.com/books/1422538855l/23158207.jpg
layout: productdetails
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis ullamcorper ante non vehicula eleifend.
Phasellus ut feugiat tellus, vitae malesuada mi. Sed placerat ultrices enim, id fermentum ante tincidunt nec.
@thefln
thefln / snipcart-dependencies.html
Created December 6, 2017 03:20
snipcart-dependencies.html
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="https://cdn.snipcart.com/scripts/2.0/snipcart.js" data-api-key="YjdiNWIyOTUtZTIyMy00MWMwLTkwNDUtMzI1M2M2NTgxYjE0" id="snipcart"></script>
<link href="https://cdn.snipcart.com/themes/2.0/base/snipcart.min.css" rel="stylesheet" type="text/css" />
@thefln
thefln / app.component.html
Created December 6, 2017 03:17
app.component.html
<div style="text-align:center">
<a href="/">
<h1>
Snipcart & Sanity powered demo!
</h1>
</a>
<router-outlet></router-outlet>
</div>
@thefln
thefln / ngmodule-declaration.js
Created December 6, 2017 03:16
ngmodule-declaration.js
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpClientModule } from '@angular/common/http';
import { RouterModule, Routes } from '@angular/router';
import { AppComponent } from './app.component';
import { ProductComponent } from './components/product/product.component';
import { ProductsComponent } from './components/products/products.component';
const appRoutes: Routes = [