diff options
author | Themefisher Dev <themefisher.dev@gmail.com> | 2020-01-09 12:24:58 +0300 |
---|---|---|
committer | Themefisher Dev <themefisher.dev@gmail.com> | 2020-01-09 12:24:58 +0300 |
commit | 40588199b1253be3bb2ff71000e0e308df45ef6b (patch) | |
tree | 3e253e6df7b5d2e054c0a089b379940e77b423f2 | |
parent | 4e5adc63fb021c307c3eebf81472bc14cc46f548 (diff) |
added snipcart
-rw-r--r-- | exampleSite/config.toml | 15 | ||||
-rw-r--r-- | exampleSite/data/homepage.yml | 22 | ||||
-rw-r--r-- | layouts/partials/banner.html | 46 | ||||
-rw-r--r-- | layouts/partials/footer.html | 19 | ||||
-rw-r--r-- | layouts/partials/preloader.html | 8 | ||||
-rw-r--r-- | layouts/partials/testimonials.html | 17 | ||||
-rw-r--r-- | theme.toml | 4 |
7 files changed, 80 insertions, 51 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 902d7c2..3537a80 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -20,6 +20,8 @@ theme = "vex-hugo" URL = "css/owl.carousel.css" [[params.plugins.css]] URL = "css/magnific-popup.css" + [[params.plugins.css]] + URL = "https://cdn.snipcart.com/themes/v3.0.3/default/snipcart.css" # JS Plugins [[params.plugins.js]] @@ -30,6 +32,8 @@ theme = "vex-hugo" URL = "js/owl.carousel.min.js" [[params.plugins.js]] URL = "js/jquery.magnific-popup.min.js" + [[params.plugins.js]] + URL = "https://cdn.snipcart.com/themes/v3.0.3/default/snipcart.js" ###################################### Navigation ###################################### @@ -59,10 +63,13 @@ home = "Home" description = "This is meta description" author = "Themefisher" # Google Analitycs -googleAnalitycsID = "Your ID" +google_analitycs_id = "Your ID" +# snipcart public api key +snipcart_api = "ZDgxY2ZiM2EtMWRmMi00M2ZkLWI1MDAtNzA2MDc0Y2Q1MzJlNjM3MTAzNDIwOTQ1NDA4NjM4" # copyright copyright = "Copyright 2019 © [themefisher](http://www.Themefisher.com) | All right reserved." - # Preloader - [params.preloader] - enable = true
\ No newline at end of file +# Preloader +[params.preloader] +enable = true +preloader = "" # use .png , .svg or .gif format
\ No newline at end of file diff --git a/exampleSite/data/homepage.yml b/exampleSite/data/homepage.yml index b173346..edb728e 100644 --- a/exampleSite/data/homepage.yml +++ b/exampleSite/data/homepage.yml @@ -4,9 +4,15 @@ banner: title : "Believe in Technology, Make the change" content : "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptas, modi fugit in veritatis labore perferendis. Minima hic at, nostrum nihil!" image : "images/watch.png" - button: - link : "#" - label : "Buy Now With $199" + button: "Buy Now With $199" + +############################## product ########################### +product: + name : "Smart watch" + image : "images/watch.png" + price : "199" + colors : ["black","white","gray"] + sizes : ["small","medium","large"] ############################# Feature ############################ features: @@ -130,12 +136,4 @@ testimonial: - name : "Jonathon Andrew" designation : "CEO, Themefisher" image : "images/avater.png" - content : "A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine. I am so happy, my dear friend, so absorbed in the exquisite sense of mere tranquil existence, that I neglect my talents." - - - ################# button ############### - button: - enable : true - label : "Grab You Product Now" - link : "#" -
\ No newline at end of file + content : "A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine. I am so happy, my dear friend, so absorbed in the exquisite sense of mere tranquil existence, that I neglect my talents."
\ No newline at end of file diff --git a/layouts/partials/banner.html b/layouts/partials/banner.html index cb82322..aeb7a91 100644 --- a/layouts/partials/banner.html +++ b/layouts/partials/banner.html @@ -1,23 +1,33 @@ {{- if .Site.Data.homepage.banner.enable }} -{{- with .Site.Data.homepage.banner }} <!-- hero area --> <section class="section"> - <div class="container"> - <div class="row"> - <div class="col-md-6 text-center mb-5 mb-md-0"> - <img class="img-fluid" src="{{ .image | absURL }}" alt=""> - </div> - <div class="col-md-6 align-self-center text-center text-md-left"> - <div class="block"> - <h1 class="font-weight-bold mb-4 font-size-60">{{ .title | markdownify }}</h1> - <p class="mb-4">{{ .content | markdownify }}</p> - {{- with .button }} - <a class="btn btn-main" href="{{ .link | absURL }}" role="button">{{ .label }}</a> - {{- end }} - </div> - </div> - </div><!-- .row close --> - </div><!-- .container close --> + <div class="container"> + <div class="row"> + {{- with .Site.Data.homepage.banner }} + <div class="col-md-6 text-center mb-5 mb-md-0"> + <img class="img-fluid" src="{{ .image | absURL }}" alt=""> + </div> + <div class="col-md-6 align-self-center text-center text-md-left"> + <div class="block"> + <h1 class="font-weight-bold mb-4 font-size-60">{{ .title | markdownify }}</h1> + <p class="mb-4">{{ .content | markdownify }}</p> + {{- end }} + <button class="snipcart-add-item btn btn-main" + {{with .Site.Data.homepage.product }} data-item-id="{{ .name | urlize }}__{{ .price }}" + data-item-name="{{ .name }}" + data-item-image="{{ .image | absURL }}" + data-item-price="{{ .price }}" data-item-url="{{ .Permalink }}" + {{ if .colors }} + data-item-custom1-name="Choose Color" + data-item-custom1-options="{{ range $index, $element:= .colors }}{{ if eq $index 0 }}{{ . | title }}{{ else }}|{{ . | title }}{{ end }}{{ end }}" + {{ end }} + {{ if .sizes }} + data-item-custom2-name="Choose Size" + data-item-custom2-options="{{ range $index, $element:= .sizes }}{{ if eq $index 0 }}{{ . | title }}{{ else }}|{{ . | title }}{{ end }}{{ end }}" + {{ end }}{{ end }}>{{ .Site.Data.homepage.banner.button }}</button> + </div> + </div> + </div><!-- .row close --> + </div><!-- .container close --> </section><!-- header close --> -{{- end }} {{- end }}
\ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index f04ae50..8fee209 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -3,7 +3,7 @@ <div class="row"> <div class="col-md-12"> <div class="block"> - <a href="{{ .Site.BaseURL }}" class="footer-logo mb-4">{{ if .Site.Params.logo }} <img src="{{ .Site.Params.logo | absURL }}" alt="{{ .Title }}"> {{ else }} {{ .Title }} {{ end }}</a> + <a href="{{ .Site.BaseURL }}" class="footer-logo mb-4">{{ if .Site.Params.logo }} <img src="{{ .Site.Params.logo | absURL }}" alt="{{ .Site.Title }}"> {{ else }} {{ .Title }} {{ end }}</a> <ul class="list-inline footer-menu"> <li class="list-inline-item"> <a href="{{ .Site.BaseURL }}">{{ .Site.Params.home }}</a> @@ -22,14 +22,20 @@ </footer> -{{ "<!-- JS Plugins -->" | safeHTML }} +<!-- Snipcart public key --> +<div hidden id="snipcart" data-api-key="{{ .Site.Params.snipcart_api }}"></div> + +<!-- JS Plugins --> {{ range .Site.Params.plugins.js}} <script src="{{ .URL | absURL }}"></script> {{ end }} -{{ "<!-- Main Script -->" | safeHTML }} + +<!-- Main Script --> {{ $script := resources.Get "script.js" }} <script src="{{ $script.Permalink }}"></script> -{{ "<!-- google analitycs -->" | safeHTML }} + +<!-- google analitycs --> +{{ with .Site.Params.google_analitycs_id }} <script> (function (i, s, o, g, r, a, m) { i['GoogleAnalyticsObject'] = r; @@ -42,6 +48,7 @@ a.src = g; m.parentNode.insertBefore(a, m) })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); - ga('create', '{{ .Site.Params.googleAnalitycsID }}', 'auto'); + ga('create', '{{ . }}', 'auto'); ga('send', 'pageview'); -</script>
\ No newline at end of file +</script> +{{ end }}
\ No newline at end of file diff --git a/layouts/partials/preloader.html b/layouts/partials/preloader.html index 3009475..0707c57 100644 --- a/layouts/partials/preloader.html +++ b/layouts/partials/preloader.html @@ -1,5 +1,9 @@ {{ if .Site.Params.preloader.enable }} -<div id="preloader-wrapper"> - <div class="pre-loader"></div> +{{ "<!-- preloader start -->" | safeHTML }} +<div class="preloader"> + {{ with .Site.Params.preloader.preloader }} + <img src="{{ . | absURL }}" alt="preloader"> + {{ end }} </div> +{{ "<!-- preloader end -->" | safeHTML }} {{ end }}
\ No newline at end of file diff --git a/layouts/partials/testimonials.html b/layouts/partials/testimonials.html index e85c6f2..f29e369 100644 --- a/layouts/partials/testimonials.html +++ b/layouts/partials/testimonials.html @@ -1,7 +1,7 @@ {{ if .Site.Data.homepage.testimonial.enable }} -{{ with .Site.Data.homepage.testimonial }} <section class="testimonials section" id="testimonial"> <div class="container"> + {{ with .Site.Data.homepage.testimonial }} <div class="row justify-content-center"> <div class="col-12"> <div class="heading"> @@ -22,16 +22,19 @@ </div> {{ end }} </div> - {{ if .button.enable }} + {{ end }} <div class="row mt-100"> <div class="col-md-12 text-center"> - {{ with .button }} - <a href="{{ .link | absURL }}" class="btn btn-main">{{ .label }}</a> - {{ end }} + <button class="snipcart-add-item btn btn-main" {{with .Site.Data.homepage.product }} + data-item-id="{{ .name | urlize }}__{{ .price }}" data-item-name="{{ .name }}" + data-item-image="{{ .image | absURL }}" data-item-price="{{ .price }}" data-item-url="{{ .Permalink }}" + {{ if .colors }} data-item-custom1-name="Choose Color" + data-item-custom1-options="{{ range $index, $element:= .colors }}{{ if eq $index 0 }}{{ . | title }}{{ else }}|{{ . | title }}{{ end }}{{ end }}" + {{ end }} {{ if .sizes }} data-item-custom2-name="Choose Size" + data-item-custom2-options="{{ range $index, $element:= .sizes }}{{ if eq $index 0 }}{{ . | title }}{{ else }}|{{ . | title }}{{ end }}{{ end }}" + {{ end }}{{ end }}>Grab You Product Now</button> </div> </div> - {{ end }} </div> </section> -{{ end }} {{ end }}
\ No newline at end of file @@ -5,9 +5,9 @@ license = "CC-BY-3.0" licenselink = "https://github.com/themefisher/vex-hugo/blob/master/LICENSE" description = "Vex by Themefisher ported to Hugo" homepage = "https://gethugothemes.com/products/vex-hugo-theme/" -tags = ["onepage", "bootstrap", "product", "themefisher"] +tags = ["onepage", "bootstrap", "ecommerce", "single product", "product", "themefisher"] features = ["onepage", "product"] -min_version = "0.54.0" +min_version = "0.58.0" [author] name = "Themefisher" |