Make theme compatible with hugoBasicExamples

Signed-off-by: hossainemruz <emruz@appscode.com>
This commit is contained in:
hossainemruz 2020-06-02 03:59:39 +06:00
parent e7b2fba1b0
commit dbd270eaee
60 changed files with 150 additions and 394 deletions

View file

@ -4,9 +4,9 @@
<div class="col-md-4 col-sm-12">
<h5>Navigation</h5>
<ul>
{{ range .Site.Menus.main }}
{{ range .Site.Data.site.menus }}
<li class="nav-item">
<a class="smooth-scroll" href="{{ .URL }}">{{ .Name }}</a>
<a class="smooth-scroll" href="{{ .url }}">{{ .name }}</a>
</li>
{{ end }}
</ul>
@ -14,7 +14,7 @@
<div class="col-md-4 col-sm-12">
<h5>Contact Me</h5>
<ul>
{{ range $key,$value:=.Site.Params.contactInfo }}
{{ range $key,$value:=.Site.Data.site.author.contactInfo }}
<li><span>{{ title $key }}: </span> <span>{{ $value }}</span></li>
{{ end }}
</ul>
@ -45,7 +45,7 @@
<div class="row text-left">
<div class="col-md-4">
<a id="theme" href="https://github.com/hossainemruz/toha" target="#">
<img src="/assets/images/logos/logo-inverted.png">
<img src="/assets/images/logo-inverted.png">
Toha
</a>
</div>
@ -53,7 +53,7 @@
<div class="col-md-4">
Powered by <a href="https://gohugo.io/">Hugo
<img
src="/assets/images/logos/hugo-logo-wide.svg"
src="/assets/images/hugo-logo-wide.svg"
alt="Hugo Logo"
height="18"
/>

View file

@ -12,5 +12,5 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css" />
<!--================= fab-icon =========================-->
<link rel="icon" type="image/png" href="/assets/images/logos/favicon.png" />
<link rel="icon" type="image/png" href="/assets/images/favicon.png" />

View file

@ -1,5 +1,9 @@
{{ $authorImage:= "/assets/images/default-avatar.svg"}}
{{ if isset .author "image" }}
{{ $authorImage = .author.image }}
{{ if eq (printf "%T" .Params.author ) "maps.Params" }}
{{ with .Params.author }}
{{ if .image }}
{{ $authorImage = .image }}
{{ end }}
{{ end }}
{{ end }}
{{ return $authorImage }}

View file

@ -1,5 +1,9 @@
{{ $authorName:= "John Doe"}}
{{ if isset .author "name" }}
{{ $authorName = .author.name }}
{{ if eq (printf "%T" .Params.author ) "maps.Params" }}
{{ with .Params.author }}
{{ if .name }}
{{ $authorName = .name }}
{{ end }}
{{ end }}
{{ end }}
{{ return $authorName }}

View file

@ -1,5 +1,5 @@
{{ $categories:= ""}}
{{ if .categories }}
{{ $categories = delimit .categories "," }}
{{ if .Params.categories }}
{{ $categories = delimit .Params.categories "," }}
{{ end }}
{{ return $categories }}

View file

@ -1,5 +1,5 @@
{{ $heroImage:= "/assets/images/default-hero.jpg"}}
{{ if .hero }}
{{ $heroImage = .hero }}
{{ if .Params.hero }}
{{ $heroImage = .Params.hero }}
{{ end }}
{{ return $heroImage }}

View file

@ -1,5 +0,0 @@
{{ $profileImage:= "/assets/images/default-avatar.svg"}}
{{ if .Site.Data.home.image }}
{{ $profileImage = .Site.Data.home.image }}
{{ end }}
{{ return $profileImage }}

View file

@ -1,20 +1,20 @@
<div class="container-fluid home" id="home">
<div
class="background container-fluid"
style="background-image: url('{{ .Site.Data.home.background }}');"
style="background-image: url('{{ .Site.Data.site.background }}');"
></div>
<div class="container content text-center">
<img
src="{{ .Site.Data.home.author.image }}"
src="{{ .Site.Data.site.author.image }}"
class="rounded-circle mx-auto d-block img-fluid"
/>
<h1 class="greeting">Hi, I am {{ .Site.Data.home.author.name -}}</h1>
<h1 class="greeting">Hi, I am {{ .Site.Data.site.author.name -}}</h1>
<div class="typing-carousel">
<span id="ityped" class="ityped"></span>
<span class="ityped-cursor"></span>
</div>
<ul id="typing-carousel-data">
{{ range .Site.Data.home.author.summary }}
{{ range .Site.Data.site.author.summary }}
<li>{{ . }}</li>
{{ end }}
</ul>

View file

@ -1,7 +1,7 @@
<nav class="navbar navbar-expand-lg top-navbar final-navbar shadow">
<div class="container">
<a class="navbar-brand" href="{{ .baseURL }}">
<img src="/assets/images/logos/logo.png">
<img src="/assets/images/logo.png">
{{- .title -}}
</a>
<button class="navbar-toggler navbar-light" type="button" {{ if .hasToggleButton }}onclick="toggleSidebar()"{{ end }}>

View file

@ -1,7 +1,7 @@
<nav class="navbar navbar-expand-lg top-navbar initial-navbar" id="top-navbar">
<div class="container">
<a class="navbar-brand" href="{{ .Site.BaseURL }}">
<img src="/assets/images/logos/logo-inverted.png" id="logo">
<img src="/assets/images/logo-inverted.png" id="logo">
{{- .Site.Title -}}
</a>
<button
@ -16,9 +16,9 @@
<div class="collapse navbar-collapse" id="top-nav-items">
<ul class="navbar-nav ml-auto">
{{ range .Site.Menus.main }}
{{ range .Site.Data.site.menus }}
<li class="nav-item">
<a class="nav-link smooth-scroll" href="{{ .URL }}">{{ .Name }}</a>
<a class="nav-link smooth-scroll" href="{{ .url }}">{{ .name }}</a>
</li>
{{ end }}
<div class="dropdown-divider" id="top-navbar-divider"></div>

View file

@ -2,8 +2,8 @@
<h1 class="text-center">Projects</h1>
<div class="container ml-auto text-center">
<div class="btn-group flex-wrap" role="group" id="project-filter-buttons">
{{ range .Site.Data.projects.filters }}
<button type="button" class="btn btn-dark" data-filter="{{ .tag }}">
{{ range .Site.Data.projects.buttons }}
<button type="button" class="btn btn-dark" data-filter="{{ .filter }}">
{{ .name }}
</button>
{{ end }}

View file

@ -1,8 +1,8 @@
<div class="container-fluid recent-posts bg-white anchor pb-5">
<div class="container-fluid recent-posts bg-white anchor pb-5" id="recent-posts">
<h1 class="text-center">Recent Posts</h1>
<div class="container">
<div class="row" id="recent-posts">
{{ range first 3 .Site.RegularPages }}
<div class="row" id="recent-post-cards">
{{ range first 3 (where .Site.RegularPages "Type" "!=" "section" )}}
{{ partial "cards/recent-post.html" . }}
{{ end }}
</div>