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 52d7044 commit bc01d4e
Show file tree
Hide file tree
Showing 16 changed files with 60 additions and 60 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>
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
{{ .Content }}
</div>
<!-- comments -->
{{ if .Site.DisqusShortname }}
{{ if site.DisqusShortname }}
<div class="col-12">
{{ template "_internal/disqus.html" . }}
</div>
Expand Down
4 changes: 2 additions & 2 deletions layouts/about/list.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ define "main" }}

{{ $data := index .Site.Data .Site.Language.Lang }}
{{ $data := index site.Data site.Language.Lang }}

<!-- about -->
<section class="section">
Expand Down Expand Up @@ -54,7 +54,7 @@ <h2 class="section-title">{{ i18n "our_teachers" }}</h2>
</div>
<div class="row justify-content-center">
<!-- teacher -->
{{ range first 3 (where .Site.RegularPages "Type" "teacher")}}
{{ range first 3 (where site.RegularPages "Type" "teacher")}}
<div class="col-lg-4 col-sm-6 mb-5 mb-lg-0">
{{ .Render "teacher" }}
</div>
Expand Down
2 changes: 1 addition & 1 deletion layouts/author/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h4 class="font-weight-bold">
<h2 class="section-title">{{ i18n "posted_by" }} {{ .Title }}</h2>
</div>
</div>
{{ range where .Site.RegularPages "Params.author" (.Title | title) }}
{{ range where site.RegularPages "Params.author" (.Title | title) }}
<div class="col-lg-4 col-sm-6 mb-4">
{{ .Render "post" }}
</div>
Expand Down
16 changes: 8 additions & 8 deletions layouts/contact/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ <h2 class="section-title">{{ i18n "contact_us" }}</h2>
</div>
<div class="row">
<div class="col-lg-7 mb-4 mb-lg-0">
<form action="{{ .Site.Params.contact_form_action | safeURL }}" method="POST">
<form action="{{ site.Params.contact_form_action | safeURL }}" method="POST">
<input type="text" class="form-control mb-3" id="name" name="name" placeholder="Your Name">
<input type="email" class="form-control mb-3" id="mail" name="mail" placeholder="Your Email">
<input type="text" class="form-control mb-3" id="subject" name="subject" placeholder="Subject">
Expand All @@ -20,9 +20,9 @@ <h2 class="section-title">{{ i18n "contact_us" }}</h2>
</div>
<div class="col-lg-5 content">
{{ .Content }}
<a href="tel:{{ .Site.Params.mobile }}" class="text-color h5 d-block">{{ .Site.Params.mobile }}</a>
<a href="mailto:{{ .Site.Params.email }}" class="mb-5 text-color h5 d-block">{{ .Site.Params.email }}</a>
<p>{{ .Site.Params.address | markdownify }}</p>
<a href="tel:{{ site.Params.mobile }}" class="text-color h5 d-block">{{ site.Params.mobile }}</a>
<a href="mailto:{{ site.Params.email }}" class="mb-5 text-color h5 d-block">{{ site.Params.email }}</a>
<p>{{ site.Params.address | markdownify }}</p>
</div>
</div>
</div>
Expand All @@ -33,10 +33,10 @@ <h2 class="section-title">{{ i18n "contact_us" }}</h2>
<section class="section pt-0">
<!-- Google Map -->
<div id="map_canvas"
data-latitude="{{ .Site.Params.map.map_latitude }}"
data-longitude="{{ .Site.Params.map.map_longitude }}"
data-marker="{{ .Site.Params.map.map_marker | absURL }}"
data-marker-name="{{ .Site.Title }}"></div>
data-latitude="{{ site.Params.map.map_latitude }}"
data-longitude="{{ site.Params.map.map_longitude }}"
data-marker="{{ site.Params.map.map_marker | absURL }}"
data-marker-name="{{ site.Title }}"></div>
</section>
<!-- /gmap -->

Expand Down
4 changes: 2 additions & 2 deletions layouts/course/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h6 class="mb-0">{{ i18n "fee" | upper }}</h6>
<!-- teacher -->
<div class="col-12">
<h5 class="mb-3">{{ i18n "teacher" }}</h5>
{{ range where .Site.RegularPages "Title" (.Params.Teacher | title) }}
{{ range where site.RegularPages "Title" (.Params.Teacher | title) }}
<div class="d-flex justify-content-between align-items-center flex-wrap">
<div class="media mb-2 mb-sm-0 align-items-center">
<img class="mr-4 img-fluid teacher-thumb-sm" src="{{ .Params.Image | relURL }}" alt="{{ .Title }}">
Expand Down Expand Up @@ -98,7 +98,7 @@ <h2 class="section-title">{{ i18n "related_course" }}</h2>
</div>
<div class="row">
<!-- course item -->
{{ $related := (where .Site.RegularPages "Type" "course") | intersect (where .Site.Pages ".Title" "!=" .Title) | union (.Site.RegularPages.Related . ) | shuffle | first 3}}
{{ $related := (where site.RegularPages "Type" "course") | intersect (where site.Pages ".Title" "!=" .Title) | union (site.RegularPages.Related . ) | shuffle | first 3}}
{{ range first 3 $related }}
<div class="col-lg-4 col-sm-6 mb-5">
{{ .Render "course"}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/event/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ <h2 class="section-title">{{ i18n "more_event" }}</h2>
</div>
<div class="row justify-content-center">
<!-- event -->
{{ $related := (where .Site.RegularPages "Type" "event") | intersect (where .Site.Pages ".Title" "!=" .Title) | union (.Site.RegularPages.Related . ) | shuffle | first 3}}
{{ $related := (where site.RegularPages "Type" "event") | intersect (where site.Pages ".Title" "!=" .Title) | union (site.RegularPages.Related . ) | shuffle | first 3}}
{{ range first 3 $related }}
<div class="col-lg-4 col-sm-6 mb-5 mb-lg-0">
{{ .Render "event" }}
Expand Down
8 changes: 4 additions & 4 deletions layouts/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ define "main" }}

{{ $data := index .Site.Data .Site.Language.Lang }}
{{ $data := index site.Data site.Language.Lang }}

<!-- hero slider -->
{{ if $data.homepage.slider.enable }}
Expand Down Expand Up @@ -102,7 +102,7 @@ <h2 class="mb-0 text-nowrap mr-3">{{ $data.homepage.course.title }}</h2>
<!-- course list -->
<div class="row justify-content-center">
<!-- course item -->
{{ range first 6 (where .Site.RegularPages "Type" "course")}}
{{ range first 6 (where site.RegularPages "Type" "course")}}
<div class="col-lg-4 col-sm-6 mb-5">
{{ .Render "course" }}
</div>
Expand Down Expand Up @@ -165,7 +165,7 @@ <h2 class="mb-0 text-nowrap mr-3">{{ $data.homepage.event.title }}</h2>
</div>
<div class="row justify-content-center">
<!-- event -->
{{ range first 3 (where .Site.RegularPages "Type" "event")}}
{{ range first 3 (where site.RegularPages "Type" "event")}}
<div class="col-lg-4 col-sm-6 mb-5 mb-lg-0">
{{ .Render "event" }}
</div>
Expand Down Expand Up @@ -193,7 +193,7 @@ <h2 class="section-title">{{ $data.homepage.blog.title }}</h2>
</div>
<div class="row justify-content-center">
<!-- blog post -->
{{ range first 3 (where .Site.RegularPages "Type" "post")}}
{{ range first 3 (where site.RegularPages "Type" "post")}}
<article class="col-lg-4 col-sm-6 mb-5 mb-lg-0">
{{ .Render "post" }}
</article>
Expand Down
14 changes: 7 additions & 7 deletions layouts/partials/blog-sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
{{ "<!-- categories -->" | safeHTML }}
<div class="bg-white mb-5">
<h4 class="mb-4">{{ i18n "categories" }}</h4>
{{- if isset .Site.Taxonomies "categories" }}
{{- if not (eq (len .Site.Taxonomies.categories) 0) }}
{{- if isset site.Taxonomies "categories" }}
{{- if not (eq (len site.Taxonomies.categories) 0) }}
<ul class="list-unstyled">
{{- range $name, $items := .Site.Taxonomies.categories }}
{{- range $name, $items := site.Taxonomies.categories }}
<li class="border-bottom"><a href="{{ `categories/` | relLangURL }}{{ $name | urlize | lower }}" class="d-block pb-3 mt-3">{{ $name | title | humanize }}</a></li>
{{- end }}
</ul>
Expand All @@ -16,10 +16,10 @@ <h4 class="mb-4">{{ i18n "categories" }}</h4>
{{ "<!-- tags -->" | safeHTML }}
<div class="bg-white mb-5">
<h4 class="mb-4">{{ i18n "tags" }}</h4>
{{- if isset .Site.Taxonomies "tags" }}
{{- if not (eq (len .Site.Taxonomies.tags) 0) }}
{{- if isset site.Taxonomies "tags" }}
{{- if not (eq (len site.Taxonomies.tags) 0) }}
<ul class="list-inline tag-list">
{{- range $name, $items := .Site.Taxonomies.tags }}
{{- range $name, $items := site.Taxonomies.tags }}
<li class="list-inline-item mb-2"><a href="{{ `tags/` | relLangURL }}{{ $name | urlize | lower }}">{{ $name | humanize }}</a></li>
{{- end }}
</ul>
Expand All @@ -30,7 +30,7 @@ <h4 class="mb-4">{{ i18n "tags" }}</h4>
<div class="bg-white">
<h4 class="mb-4">{{ i18n "latest_article" }}</h4>
{{ "<!-- post-item -->" | safeHTML }}
{{ range first 3 ( where .Site.Pages "Type" "post" )}}
{{ range first 3 ( where site.Pages "Type" "post" )}}
<div class="media border-bottom border-color pb-3 mb-3">
<a href="{{ .Permalink }}"><img class="mr-3 post-thumb-sm" src="{{ .Params.Image | absURL }}"></a>
<div class="media-body">
Expand Down
30 changes: 15 additions & 15 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- footer -->
<footer>
<!-- newsletter -->
{{ if .Site.Params.subscription.enable }}
{{ with .Site.Params.subscription }}
{{ if site.Params.subscription.enable }}
{{ with site.Params.subscription }}
<div class="newsletter">
<div class="container">
<div class="row">
Expand All @@ -29,18 +29,18 @@ <h3 class="text-white">{{ i18n "subscribe_newsletter" }}</h3>
<div class="row">
<div class="col-lg-4 col-sm-8 mb-5 mb-lg-0">
<!-- logo -->
<a class="logo-footer" href="{{ .Site.BaseURL | relLangURL }}"><img class="img-fluid mb-4" src="{{ .Site.Params.logo | absURL }}" alt="{{ .Site.Title }}"></a>
<a class="logo-footer" href="{{ site.BaseURL | relLangURL }}"><img class="img-fluid mb-4" src="{{ site.Params.logo | absURL }}" alt="{{ site.Title }}"></a>
<ul class="list-unstyled">
<li class="mb-4">{{ .Site.Params.address | markdownify }}</li>
<li class="mb-4">{{ .Site.Params.email | markdownify }}</li>
<li class="mb-4">{{ .Site.Params.mobile | markdownify }}</li>
<li class="mb-4">{{ site.Params.address | markdownify }}</li>
<li class="mb-4">{{ site.Params.email | markdownify }}</li>
<li class="mb-4">{{ site.Params.mobile | markdownify }}</li>
</ul>
</div>
<!-- company -->
<div class="col-lg-2 col-sm-4 col-6 mb-5 mb-md-0">
<h4 class="text-white mb-5 text-uppercase">{{ i18n "company" }}</h4>
<ul class="list-unstyled">
{{ range .Site.Menus.main }}
{{ range site.Menus.main }}
{{ if not .HasChildren }}
<li class="mb-3"><a class="text-color" href="{{ .URL | absLangURL }}">{{ .Name }}</a></li>
{{ end }}
Expand All @@ -51,7 +51,7 @@ <h4 class="text-white mb-5 text-uppercase">{{ i18n "company" }}</h4>
<div class="col-lg-2 col-sm-4 col-6 mb-5 mb-md-0">
<h4 class="text-white mb-5 text-uppercase">{{ i18n "links" }}</h4>
<ul class="list-unstyled">
{{ range .Site.Menus.footer }}
{{ range site.Menus.footer }}
<li class="mb-3"><a class="text-color" href="{{ .URL | absLangURL }}">{{ .Name }}</a></li>
{{ end }}
</ul>
Expand All @@ -60,7 +60,7 @@ <h4 class="text-white mb-5 text-uppercase">{{ i18n "links" }}</h4>
<div class="col-lg-2 col-sm-4 col-6 mb-5 mb-md-0">
<h4 class="text-white mb-5 text-uppercase">{{ i18n "courses" }}</h4>
<ul class="list-unstyled">
{{ range first 5 (where .Site.RegularPages "Type" "course")}}
{{ range first 5 (where site.RegularPages "Type" "course")}}
<li class="mb-3"><a class="text-color" href="{{ .Permalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
Expand All @@ -69,7 +69,7 @@ <h4 class="text-white mb-5 text-uppercase">{{ i18n "courses" }}</h4>
<div class="col-lg-2 col-sm-4 col-6 mb-5 mb-md-0">
<h4 class="text-white mb-5 text-uppercase">{{ i18n "new_notice" }}</h4>
<ul class="list-unstyled">
{{ range first 3 (where .Site.RegularPages "Type" "notice")}}
{{ range first 3 (where site.RegularPages "Type" "notice")}}
<li class="mb-3"><a class="text-color" href="{{ .Permalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
Expand All @@ -82,11 +82,11 @@ <h4 class="text-white mb-5 text-uppercase">{{ i18n "new_notice" }}</h4>
<div class="container">
<div class="row">
<div class="col-sm-7 text-sm-left text-center">
<p class="mb-0">{{ .Site.Params.copyright | markdownify }}</p>
<p class="mb-0">{{ site.Params.copyright | markdownify }}</p>
</div>
<div class="col-sm-5 text-sm-right text-center">
<ul class="list-inline">
{{ range .Site.Params.social }}
{{ range site.Params.social }}
<li class="list-inline-item"><a class="d-inline-block p-2" href="{{ .link | safeURL }}"><i class="{{ .icon }} text-primary"></i></a></li>
{{ end }}
</ul>
Expand All @@ -98,12 +98,12 @@ <h4 class="text-white mb-5 text-uppercase">{{ i18n "new_notice" }}</h4>
<!-- /footer -->

{{ "<!-- Google Map API -->" | safeHTML }}
{{ with .Site.Params.map.gmap_api }}
{{ with site.Params.map.gmap_api }}
<script src="{{ . | safeURL }}"></script>
{{ end }}

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

Expand All @@ -112,7 +112,7 @@ <h4 class="text-white mb-5 text-uppercase">{{ i18n "new_notice" }}</h4>
<script src="{{ $script.Permalink }}"></script>

{{ "<!-- google analitycs -->" | safeHTML }}
{{ 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
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 .Params.Description }}{{ . }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}">
{{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
<meta name="description" content="{{ with .Params.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="{{ .link | absURL }}">
{{ end }}

Expand Down
20 changes: 10 additions & 10 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
<!-- header -->
<header class="fixed-top header">
<!-- top header -->
{{ if .Site.Params.top_header }}
{{ if site.Params.top_header }}
<div class="top-header py-2 bg-white">
<div class="container">
<div class="row no-gutters align-items-center">
<div class="col-lg-4 text-center text-lg-left">
<ul class="list-inline">
{{ range .Site.Params.social }}
{{ range site.Params.social }}
<li class="list-inline-item mx-0"><a class="d-inline-block p-2 text-color" href="{{ .link | safeURL }}"><i class="{{ .icon }}"></i></a></li>
{{ end }}
</ul>
</div>
<div class="col-lg-8 text-center text-lg-right">
<ul class="list-inline">
<li class="list-inline-item">
<a class="text-color mr-3" href="tel:{{ .Site.Params.mobile }}"><strong>{{ i18n "call" | upper }} : </strong> {{ .Site.Params.mobile }}</a></li>
<a class="text-color mr-3" href="tel:{{ site.Params.mobile }}"><strong>{{ i18n "call" | upper }} : </strong> {{ site.Params.mobile }}</a></li>
<li class="list-inline-item">
<a class="text-color" href="mailto:{{ .Site.Params.email }}"><strong>{{ i18n "email" | upper }} : </strong> {{ .Site.Params.email }}</a></li>
<a class="text-color" href="mailto:{{ site.Params.email }}"><strong>{{ i18n "email" | upper }} : </strong> {{ site.Params.email }}</a></li>
</ul>
</div>
</div>
</div>
</div>
{{ end }}
<!-- navbar -->
<div class="navigation w-100 {{ if .Site.Params.top_header }} top-hider {{ end }}">
<div class="navigation w-100 {{ if site.Params.top_header }} top-hider {{ end }}">
<div class="container">
<nav class="navbar navbar-expand-lg navbar-dark p-0">
<a class="navbar-brand" href="{{ .Site.BaseURL | relLangURL }}"><img class="img-fluid"
src="{{ .Site.Params.logo | absURL }}" alt="{{ .Site.Title }}"></a>
<a class="navbar-brand" href="{{ site.BaseURL | relLangURL }}"><img class="img-fluid"
src="{{ site.Params.logo | absURL }}" alt="{{ site.Title }}"></a>
<button class="navbar-toggler rounded-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 @@ -38,9 +38,9 @@
<div class="collapse navbar-collapse text-center" id="navigation">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="{{ .Site.BaseURL | absLangURL }}">{{ .Site.Params.Home }}</a>
<a class="nav-link" href="{{ site.BaseURL | absLangURL }}">{{ site.Params.Home }}</a>
</li>
{{ range .Site.Menus.main }}
{{ range site.Menus.main }}
{{ if .HasChildren }}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown">
Expand All @@ -63,7 +63,7 @@
<!-- Language List -->
{{ if .IsTranslated }}
<select class="m-2 border-0" id="select-language" onchange="location = this.value;">
{{ $siteLanguages := .Site.Languages}}
{{ $siteLanguages := site.Languages}}
{{ $pageLang := .Page.Lang}}
{{ range .Page.AllTranslations }}
{{ $translation := .}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/page-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="row">
<div class="col-md-8">
<ul class="list-inline custom-breadcrumb">
<li class="list-inline-item h2"><a class="text-primary font-secondary" href="{{ .Site.BaseURL | absLangURL }}">{{ .Site.Params.home }}</a></li>
<li class="list-inline-item h2"><a class="text-primary font-secondary" href="{{ site.BaseURL | absLangURL }}">{{ site.Params.home }}</a></li>
<li class="list-inline-item h5"><i class="ti-angle-right text-white"></i></li>
<li class="list-inline-item text-white h3 font-secondary">{{ .Title }}</li>
</ul>
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
2 changes: 1 addition & 1 deletion layouts/partials/success-story.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ $data := index .Site.Data .Site.Language.Lang }}
{{ $data := index site.Data site.Language.Lang }}

{{ with $data.homepage.success_story }}
<section class="section bg-cover" data-background="{{ .bg_image | absURL }}">
Expand Down
2 changes: 1 addition & 1 deletion layouts/teacher/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ <h4 class="mb-4">{{ i18n "interest" | upper }}</h4>
<h4 class="mb-4">{{ i18n "courses" | upper}}</h4>
</div>
<!-- course item -->
{{ range where .Site.RegularPages "Params.teacher" .Title }}
{{ range where site.RegularPages "Params.teacher" .Title }}
<div class="col-lg-4 col-sm-6 mb-5">
{{ .Render "course"}}
</div>
Expand Down

0 comments on commit bc01d4e

Please sign in to comment.