Skip to content

Commit

Permalink
change global site variable
Browse files Browse the repository at this point in the history
  • Loading branch information
somrat-gyver committed Jun 30, 2020
1 parent 309ec2b commit 1e51f84
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en-US{{ end }}">
<html lang="{{ with site.LanguageCode }}{{ . }}{{ else }}en-US{{ end }}">
{{- partial "head.html" . -}}
<body id="body">
{{- partial "preloader.html" . -}}
Expand Down
8 changes: 4 additions & 4 deletions layouts/partials/banner.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{- if .Site.Data.homepage.banner.enable }}
{{- if site.Data.homepage.banner.enable }}
<!-- hero area -->
<section class="section">
<div class="container">
<div class="row">
{{- with .Site.Data.homepage.banner }}
{{- 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>
Expand All @@ -13,7 +13,7 @@ <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 }}"
{{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 }}"
Expand All @@ -24,7 +24,7 @@ <h1 class="font-weight-bold mb-4 font-size-60">{{ .title | markdownify }}</h1>
{{ 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>
{{ end }}{{ end }}>{{ site.Data.homepage.banner.button }}</button>
</div>
</div>
</div><!-- .row close -->
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/call-to-action.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Site.Data.homepage.cta.enable }}
{{- with .Site.Data.homepage.cta }}
{{- if site.Data.homepage.cta.enable }}
{{- with site.Data.homepage.cta }}
<section class="call-to-action section bg-opacity" style="background-image: url('{{ .bgImage | absURL }}');">
<div class="container">
<div class="row">
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/feature-list.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ if .Site.Data.homepage.aboutProduct.enable }}
{{ with .Site.Data.homepage.aboutProduct }}
{{ if site.Data.homepage.aboutProduct.enable }}
{{ with site.Data.homepage.aboutProduct }}
<section class="feature-list section">
<div class="container">
<div class="row">
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/features.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Site.Data.homepage.features.enable }}
{{- with .Site.Data.homepage.features }}
{{- if site.Data.homepage.features.enable }}
{{- with site.Data.homepage.features }}
<section class="section" id="feature">
<div class="container">
<div class="row">
Expand Down
14 changes: 7 additions & 7 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
<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="{{ .Site.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>
<a href="{{ site.BaseURL }}">{{ site.Params.home }}</a>
</li>
{{ range .Site.Menus.main }}
{{ range site.Menus.main }}
<li class="list-inline-item">
<a class="page-scroll" href="#{{ .URL }}">{{ .Name }}</a>
</li>
{{ end }}
</ul>
<p class="copyright-text">{{ .Site.Params.copyright | markdownify }}</p>
<p class="copyright-text">{{ site.Params.copyright | markdownify }}</p>
</div>
</div>
</div>
Expand All @@ -23,10 +23,10 @@


<!-- Snipcart public key -->
<div hidden id="snipcart" data-api-key="{{ .Site.Params.snipcart_api }}"></div>
<div hidden id="snipcart" data-api-key="{{ site.Params.snipcart_api }}"></div>

<!-- JS Plugins -->
{{ range .Site.Params.plugins.js}}
{{ range site.Params.plugins.js}}
<script src="{{ .URL | absURL }}"></script>
{{ end }}

Expand All @@ -35,7 +35,7 @@
<script src="{{ $script.Permalink }}"></script>

<!-- google analitycs -->
{{ with .Site.Params.google_analitycs_id }}
{{ with site.Params.google_analitycs_id }}
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/gallery.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ if .Site.Data.homepage.gallery.enable }}
{{ with .Site.Data.homepage.gallery }}
{{ if site.Data.homepage.gallery.enable }}
{{ with site.Data.homepage.gallery }}
<section class="gallery" id="gallery">
<div class="container">
<div class="row">
Expand Down
6 changes: 3 additions & 3 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

{{ "<!-- mobile responsive meta -->" | safeHTML }}
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}">
{{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}">
{{ with site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
{{ hugo.Generator }}

{{ "<!-- plugins -->" | safeHTML }}
{{ range .Site.Params.plugins.css }}
{{ range site.Params.plugins.css }}
<link rel="stylesheet" href="{{ .URL | absURL }} ">
{{ end }}

Expand Down
6 changes: 3 additions & 3 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<header class="sticky-top bg-white">
<div class="container">
<nav class="navbar navbar-expand-lg navbar-light">
<a class="navbar-brand" href="{{ .Site.BaseURL }}">{{ if .Site.Params.logo }} <img src="{{ .Site.Params.logo | absURL }}" alt="{{ .Site.Title }}"> {{ else }} {{ .Site.Title }} {{ end }}</a>
<a class="navbar-brand" href="{{ site.BaseURL }}">{{ if site.Params.logo }} <img src="{{ site.Params.logo | absURL }}" alt="{{ site.Title }}"> {{ else }} {{ site.Title }} {{ end }}</a>
<button class="navbar-toggler border-0" type="button" data-toggle="collapse" data-target="#navigation"
aria-controls="navigation" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
Expand All @@ -11,9 +11,9 @@
<div class="collapse navbar-collapse" id="navigation">
<ul class="navbar-nav ml-auto text-center text-lg-left">
<li class="nav-item">
<a class="nav-link" href="{{ .Site.BaseURL }}">{{ .Site.Params.home }}</a>
<a class="nav-link" href="{{ site.BaseURL }}">{{ site.Params.home }}</a>
</li>
{{ range .Site.Menus.main }}
{{ range site.Menus.main }}
<li class="nav-item">
<a class="nav-link page-scroll" href="#{{ .URL }}">{{ .Name }}</a>
</li>
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/preloader.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ if .Site.Params.preloader.enable }}
{{ if site.Params.preloader.enable }}
{{ "<!-- preloader start -->" | safeHTML }}
<div class="preloader">
{{ with .Site.Params.preloader.preloader }}
{{ with site.Params.preloader.preloader }}
<img src="{{ . | absURL }}" alt="preloader">
{{ end }}
</div>
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/promo.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ if .Site.Data.homepage.promo.enable }}
{{ with .Site.Data.homepage.promo }}
{{ if site.Data.homepage.promo.enable }}
{{ with site.Data.homepage.promo }}
<section class="bg-orange section">
<div class="container">
<div class="row">
Expand Down
6 changes: 3 additions & 3 deletions layouts/partials/testimonials.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ if .Site.Data.homepage.testimonial.enable }}
{{ if site.Data.homepage.testimonial.enable }}
<section class="testimonials section" id="testimonial">
<div class="container">
{{ with .Site.Data.homepage.testimonial }}
{{ with site.Data.homepage.testimonial }}
<div class="row justify-content-center">
<div class="col-12">
<div class="heading">
Expand All @@ -25,7 +25,7 @@ <h4>{{ .name }}</h4>
{{ end }}
<div class="row mt-100">
<div class="col-md-12 text-center">
<button class="snipcart-add-item btn btn-main" {{with .Site.Data.homepage.product }}
<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"
Expand Down

0 comments on commit 1e51f84

Please sign in to comment.