merge and correct background base Url bug

This commit is contained in:
vincent 2021-01-16 10:54:53 +01:00
commit 8310e99140
147 changed files with 1949 additions and 132 deletions

View file

@ -1,5 +1,5 @@
{{ define "header" }}
<link rel="stylesheet" href="{{ "/assets/css/404.css" | relURL }}">
<link rel="stylesheet" href="{{ "/css/404.css" | relURL }}">
{{ end }}
{{ define "navbar" }}
@ -7,9 +7,19 @@
{{ end }}
{{ define "content" }}
{{/* not found image */}}
{{ $notFoundImage := "/images/404.png" }}
{{/* resize the image. don't resize svg because it is not supported */}}
{{ $notFoundImage := resources.Get $notFoundImage}}
{{ if and $notFoundImage (ne $notFoundImage.MediaType.SubType "svg") }}
{{ $notFoundImage = $notFoundImage.Resize "1500x" }}
{{ end }}
{{ $notFoundImage = $notFoundImage.RelPermalink}}
<div class="container">
<div class="notFound">
<img src="{{ "/assets/images/404.png" | relURL }}" alt="">
<img src="{{ $notFoundImage }}" alt="">
<div class="message">
<h1>404</h1>
<h4>The page you are looking for is not there yet.</h4>

View file

@ -1,6 +1,6 @@
{{ define "header" }}
<link rel="stylesheet" href="{{ "/assets/css/layouts/list.css" | relURL }}">
<link rel="stylesheet" href="{{ "/assets/css/navigators/sidebar.css" | relURL}}">
<link rel="stylesheet" href="{{ "/css/layouts/list.css" | relURL }}">
<link rel="stylesheet" href="{{ "/css/navigators/sidebar.css" | relURL}}">
{{ end }}
{{ define "navbar" }}
@ -10,7 +10,7 @@
{{ define "sidebar" }}
{{ $blogHome:="#" }}
{{ if site.IsMultiLingual }}
{{ $blogHome = (path.Join (cond ( eq .Language.Lang "en") "" .Language.Lang) "posts") }}
{{ $blogHome = (path.Join (cond ( eq .Language.Lang "en") "" .Language.Lang) .Type) }}
{{ end }}
<section class="sidebar-section" id="sidebar-section">
@ -19,7 +19,7 @@
<input type="text" value="" placeholder="Search" data-search="" id="search-box" />
<div class="sidebar-tree">
<ul class="tree" id="tree">
<li id="list-heading"><a href="{{ "/posts" | relLangURL }}" data-filter="all">{{ i18n "posts" }}</a></li>
<li id="list-heading"><a href="{{ .Type | relLangURL }}" data-filter="all">{{ i18n .Type }}</a></li>
<div class="subtree">
{{ partial "navigators/sidebar.html" (dict "menus" site.Menus.sidebar "ctx" .) }}
</div>
@ -47,5 +47,5 @@
{{ end }}
{{ define "scripts" }}
<script src="{{ "/assets/js/list.js" | relURL }}"></script>
<script src="{{ "/js/list.js" | relURL }}"></script>
{{ end }}

View file

@ -4,8 +4,8 @@
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/atom-one-dark.min.css"
/>
<link rel="stylesheet" href="{{ "/assets/css/layouts/single.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/assets/css/navigators/sidebar.css" | relURL }}">
<link rel="stylesheet" href="{{ "/css/layouts/single.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/css/navigators/sidebar.css" | relURL }}">
{{ end }}
{{ define "navbar" }}
@ -35,13 +35,13 @@
<div class="content">
<div class="container p-0 read-area">
<!--Hero Area-->
<div class="hero-area col-sm-12" id="hero-area" style='background-image: url({{ strings.TrimSuffix "/" site.BaseURL }}{{ partial "helpers/get-hero.html" . | relURL }});'>
<div class="hero-area col-sm-12" id="hero-area" style='background-image: url({{ strings.TrimSuffix "/" site.BaseURL }}{{ partial "helpers/get-hero.html" . }});'>
</div>
<!--Content Start-->
<div class="page-content">
<div class="author-profile ml-auto align-self-lg-center">
<img class="rounded-circle" src='{{ partial "helpers/get-author-image.html" . | relURL }}'/>
<img class="rounded-circle" src='{{ partial "helpers/get-author-image.html" . }}'/>
<h5 class="author-name">{{ partial "helpers/get-author-name.html" . }}</h5>
<p>{{ .Page.Date.Format "January 2, 2006" }}</p>
</div>
@ -97,7 +97,7 @@
{{ define "scripts" }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/highlight.min.js"></script>
<script src="{{ "/assets/js/single.js" | relURL }}"></script>
<script src="{{ "/js/single.js" | relURL }}"></script>
<script>
hljs.initHighlightingOnLoad();
</script>

View file

@ -15,13 +15,14 @@
{{- partial "header.html" . -}}
<!-- import index page specific headers -->
<link rel="stylesheet" href="{{ "/assets/css/sections/home.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/assets/css/sections/about.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/assets/css/sections/skills.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/assets/css/sections/experiences.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/assets/css/sections/projects.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/assets/css/sections/recent-posts.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/assets/css/sections/achievements.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/css/sections/home.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/css/sections/about.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/css/sections/skills.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/css/sections/experiences.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/css/sections/education.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/css/sections/projects.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/css/sections/recent-posts.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/css/sections/achievements.css" | relURL }}"/>
<!-- Add Google Analytics if enabled in configuration -->
{{ if site.GoogleAnalytics }}
@ -70,9 +71,9 @@
{{ partial "scripts.html" . }}
<!--- ADD INDEX PAGE SPECIFIC SCRIPTS -->
<script src="{{ "/assets/js/itype.min.js" | relURL }}"></script>
<script src="{{ "/assets/js/github-button.js" | relURL }}"></script>
<script src="{{ "/assets/js/home.js" | relURL }}"></script>
<script src="{{ "/assets/js/jquery.filterizr.min.js" | relURL }}"></script>
<script src="{{ "/js/itype.min.js" | relURL }}"></script>
<script src="{{ "/js/github-button.js" | relURL }}"></script>
<script src="{{ "/js/home.js" | relURL }}"></script>
<script src="{{ "/js/jquery.filterizr.min.js" | relURL }}"></script>
</body>
</html>

View file

@ -4,11 +4,17 @@
>
<div class="card mt-1">
<div class="card">
<a class="card-header" href="{{ if .repo }}{{ .repo }}{{ else if .url }}{{ .url }}{{ else }}#{{ end }}">
<a class="card-header" href="{{ if .repo }}{{ .repo }}{{ else if .url }}{{ .url }}{{ else }}javascript:void(0){{ end }}">
<div>
<div class="d-flex">
{{ if .logo }}
<img class="card-img-xs" src="{{ .logo | relURL }}" alt="{{ .name }}" />
{{ $logoImage:= resources.Get .logo}}
{{ if $logoImage }}
{{ $logoImage := $logoImage.Fit "24x24" }}
<img class="card-img-xs" src="{{ $logoImage.RelPermalink }}" alt="{{ .name }}" />
{{ end }}
{{ end }}
<h5 class="card-title mb-0">{{ .name }}</h5>
</div>

View file

@ -1,9 +1,16 @@
<div class="col-xs-12 col-sm-6 col-lg-4 pt-2">
<a class="skill-card-link" href="{{ if .url }}{{ .url }}{{ else }}#{{ end }}">
<a class="skill-card-link" href="{{ if .url }}{{ .url }}{{ else }}javascript:void(0){{ end }}">
<div class="card">
<div class="card-head d-flex">
{{ if .icon }}
<img class="card-img-xs" src="{{ .icon | relURL }}" alt="{{ .name }}" />
{{ if .logo }}
{{ $logoImage := resources.Get .logo }}
{{/* svg don't support "Fit" operation */}}
{{ if ne $logoImage.MediaType.SubType "svg" }}
{{ $logoImage := $logoImage.Fit "24x24" }}
{{ end }}
<img class="card-img-xs" src="{{ $logoImage.RelPermalink }}" alt="{{ .name }}" />
{{ end }}
<h5 class="card-title">{{ .name }}</h5>
</div>

View file

@ -16,6 +16,23 @@
{{ end }}
{{ end }}
{{/* footer logos */}}
{{ $themeLogo := "/images/theme-logo.png" }}
{{ $hugoLogo := "/images/hugo-logo.svg" }}
{{/* resize the logos. don't resize svg because it is not supported */}}
{{ $themeLogo:= resources.Get $themeLogo}}
{{ if and $themeLogo (ne $themeLogo.MediaType.SubType "svg") }}
{{ $themeLogo = $themeLogo.Resize "32x" }}
{{ end }}
{{ $themeLogo = $themeLogo.RelPermalink}}
{{ $hugoLogo:= resources.Get $hugoLogo}}
{{ if and $hugoLogo (ne $hugoLogo.MediaType.SubType "svg")}}
{{ $hugoLogo = $hugoLogo.Resize "32x" }}
{{ end }}
{{ $hugoLogo = $hugoLogo.RelPermalink}}
<footer class="container-fluid text-center align-content-center footer pb-2">
<div class="container pt-5">
<div class="row text-left">
@ -76,15 +93,15 @@
<div class="row text-left">
<div class="col-md-4">
<a id="theme" href="https://github.com/hossainemruz/toha" target="#">
<img src="{{ "/assets/images/inverted-logo.png" | relURL }}">
<img src="{{ $themeLogo }}">
Toha
</a>
</div>
<div class="col-md-4 text-center">{{ $copyrightNotice }}</div>
<div class="col-md-4 text-center">{{ $copyrightNotice | markdownify }}</div>
<div class="col-md-4 text-right">
<a id="hugo" href="https://gohugo.io/">{{ i18n "hugoAttributionText" }}
<img
src="{{ "/assets/images/hugo-logo-wide.svg" | relURL }}"
src="{{ $hugoLogo }}"
alt="Hugo Logo"
height="18"
/>

View file

@ -1,19 +1,34 @@
{{/* default favicon */}}
{{ $favicon := "/images/favicon.png" }}
{{/* if favicon is provided in the config, then use that */}}
{{ if site.Params.logo.favicon }}
{{ $favicon = site.Params.logo.favicon }}
{{ end }}
{{/* resize the favicon. don't resize svg because it is not supported */}}
{{ $favicon := resources.Get $favicon }}
{{ if and $favicon (ne $favicon.MediaType.SubType "svg") }}
{{ $favicon = $favicon.Resize "42x" }}
{{ end }}
{{ $favicon = $favicon.RelPermalink}}
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<!-- ============ import common css ========== -->
<link rel="stylesheet" href="{{ "/assets/css/bootstrap.min.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/assets/css/layouts/main.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/assets/css/style.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/assets/css/navigators/navbar.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/css/bootstrap.min.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/css/layouts/main.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/css/style.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/css/navigators/navbar.css" | relURL }}"/>
<!--=================== cdn ==============================-->
<link href="https://fonts.googleapis.com/css2?family=Muli:wght@300;400;500;600" rel="stylesheet">
<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="{{ site.Params.logo.favicon | default "/assets/images/favicon.png" | relURL }}" />
<link rel="icon" type="image/png" href="{{ $favicon }}" />
<!--================= custom style overrides =========================-->
<link rel="stylesheet" href="{{ "/assets/css/style.css" | relURL }}"/>
<link rel="stylesheet" href="{{ "/css/style.css" | relURL }}"/>

View file

@ -7,6 +7,8 @@
{{ $countryCode = "gb" }}
{{ else if eq $languageCode "bn" }}
{{ $countryCode = "bd" }}
{{ else if eq $languageCode "hi" }}
{{ $countryCode = "in" }}
{{ end }}
{{/* return the country code */}}

View file

@ -2,11 +2,14 @@
{{ if (index site.Data site.Language.Lang).author }}
{{ $author = (index site.Data site.Language.Lang).author }}
{{ end }}
{{ $authorImage:= "/assets/images/default-avatar.png" }}
{{/* default author image */}}
{{ $authorImage:= "/images/default-avatar.png" }}
{{ if $author.image }}
{{ $authorImage = $author.image }}
{{ end }}
{{/* if author image is provided in author's data, then use that */}}
{{ if eq (printf "%T" .Params.author ) "maps.Params" }}
{{ with .Params.author }}
{{ if .image }}
@ -14,4 +17,13 @@
{{ end }}
{{ end }}
{{ end }}
{{ return $authorImage }}
{{/* apply image processing. don't use "Fit" in svg because its not supported */}}
{{ $authorImage:= resources.Get $authorImage}}
{{ if and $authorImage (ne $authorImage.MediaType.SubType "svg") }}
{{ $authorImage := $authorImage.Fit "120x120" }}
{{ end }}
{{/* return the author image link */}}
{{ return $authorImage.RelPermalink }}

View file

@ -1,5 +1,19 @@
{{ $heroImage:= "/assets/images/default-hero.jpg"}}
{{ if .Params.hero }}
{{ $heroImage = .Params.hero }}
{{/* check if there is any hero image in the same folder as the markdown file */}}
{{ $heroImage := .Page.Resources.GetMatch "hero.{jpg,png,svg}"}}
{{ .Scratch.Set "heroScratch" $heroImage }}
{{/* if hero image is not provided, then use the default hero image */}}
{{ if not $heroImage }}
{{ $heroImage := resources.Get "images/default-hero.jpg"}}
{{ .Scratch.Set "heroScratch" $heroImage }}
{{ end }}
{{ return $heroImage }}
{{ $heroImage := .Scratch.Get "heroScratch" }}
{{/* resize hero image. don't resize if the image is an svg */}}
{{ if and $heroImage (ne $heroImage.MediaType.SubType "svg") }}
{{ $heroImage := $heroImage.Resize "148x" }}
{{ end }}
{{/* return the hero image */}}
{{ return $heroImage.RelPermalink }}

View file

@ -1,19 +1,36 @@
{{ $mainLogo:="/assets/images/main-logo.png" }}
{{ $invertedLogo:="/assets/images/inverted-logo.png" }}
{{/* default logos */}}
{{ $mainLogo := "/images/main-logo.png" }}
{{ $invertedLogo := "/images/inverted-logo.png" }}
{{/* if custom logo has been provided in the config file, then use them */}}
{{ if site.Params.logo.main }}
{{ $mainLogo = site.Params.logo.main }}
{{ end }}
{{ if site.Params.logo.inverted }}
{{ $invertedLogo = site.Params.logo.inverted }}
{{ end }}
{{/* resize the logos. don't resize svg because it is not supported */}}
{{ $mainLogo := resources.Get $mainLogo}}
{{ if and $mainLogo (ne $mainLogo.MediaType.SubType "svg") }}
{{ $mainLogo = $mainLogo.Resize "42x" }}
{{ end }}
{{ $mainLogo = $mainLogo.RelPermalink}}
{{ $invertedLogo := resources.Get $invertedLogo}}
{{ if and $invertedLogo (ne $invertedLogo.MediaType.SubType "svg") }}
{{ $invertedLogo = $invertedLogo.Resize "42x" }}
{{ end }}
{{ $invertedLogo = $invertedLogo.RelPermalink}}
<nav class="navbar navbar-expand-xl top-navbar final-navbar shadow">
<div class="container">
<button class="navbar-toggler navbar-light" id="sidebar-toggler" type="button" onclick="toggleSidebar()">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="{{ site.BaseURL | relLangURL }}">
<img src="{{ $mainLogo | relURL }}">
<img src="{{ $mainLogo }}">
{{- site.Title -}}
</a>
<button class="navbar-toggler navbar-light" id="toc-toggler" type="button" onclick="toggleTOC()">
@ -29,6 +46,6 @@
</div>
</div>
<!-- Store the logo information in a hidden img for the JS -->
<img src="{{ $mainLogo | relURL }}" class="d-none" id="main-logo">
<img src="{{ $invertedLogo | relURL }}" class="d-none" id="inverted-logo">
<img src="{{ $mainLogo }}" class="d-none" id="main-logo">
<img src="{{ $invertedLogo }}" class="d-none" id="inverted-logo">
</nav>

View file

@ -1,5 +1,8 @@
{{ $mainLogo:="/assets/images/main-logo.png" }}
{{ $invertedLogo:="/assets/images/inverted-logo.png" }}
{{/* default logos */}}
{{ $mainLogo := "/images/main-logo.png" }}
{{ $invertedLogo := "/images/inverted-logo.png" }}
{{/* if custom logo is used, them */}}
{{ if site.Params.logo.main }}
{{ $mainLogo = site.Params.logo.main }}
{{ end }}
@ -7,7 +10,20 @@
{{ $invertedLogo = site.Params.logo.inverted }}
{{ end }}
{{ $sections:= site.Data.sections }}
{{/* resize the logos. don't resize svg because it is not supported */}}
{{ $mainLogo := resources.Get $mainLogo}}
{{ if and $mainLogo (ne $mainLogo.MediaType.SubType "svg") }}
{{ $mainLogo = $mainLogo.Resize "42x" }}
{{ end }}
{{ $mainLogo = $mainLogo.RelPermalink}}
{{ $invertedLogo := resources.Get $invertedLogo}}
{{ if and $invertedLogo (ne $invertedLogo.MediaType.SubType "svg")}}
{{ $invertedLogo = $invertedLogo.Resize "42x" }}
{{ end }}
{{ $invertedLogo = $invertedLogo.RelPermalink}}
{{ $sections := site.Data.sections }}
{{ if (index site.Data site.Language.Lang).sections }}
{{ $sections = (index site.Data site.Language.Lang).sections }}
{{ end }}
@ -15,7 +31,7 @@
<nav class="navbar navbar-expand-xl top-navbar initial-navbar" id="top-navbar">
<div class="container">
<a class="navbar-brand" href="{{ site.BaseURL | relLangURL }}">
<img src="{{ $invertedLogo | relURL }}" id="logo">
<img src="{{ $invertedLogo }}" id="logo">
{{- site.Title -}}
</a>
<button
@ -72,6 +88,6 @@
</div>
</div>
<!-- Store the logo information in a hidden img for the JS -->
<img src="{{ $mainLogo | relURL }}" class="d-none" id="main-logo">
<img src="{{ $invertedLogo | relURL }}" class="d-none" id="inverted-logo">
<img src="{{ $mainLogo }}" class="d-none" id="main-logo">
<img src="{{ $invertedLogo }}" class="d-none" id="inverted-logo">
</nav>

View file

@ -1,6 +1,6 @@
<script src="{{ "/assets/js/jquery-3.4.1.min.js" | relURL }}"></script>
<script src="{{ "/assets/js/popper.min.js" | relURL }}"></script>
<script src="{{ "/assets/js/bootstrap.min.js" | relURL }}"></script>
<script src="{{ "/js/jquery-3.4.1.min.js" | relURL }}"></script>
<script src="{{ "/js/popper.min.js" | relURL }}"></script>
<script src="{{ "/js/bootstrap.min.js" | relURL }}"></script>
<script src="{{ "/assets/js/navbar.js" | relURL }}"></script>
<script src="{{ "/assets/js/main.js" | relURL }}"></script>
<script src="{{ "/js/navbar.js" | relURL }}"></script>
<script src="{{ "/js/main.js" | relURL }}"></script>

View file

@ -1,6 +1,18 @@
<div
{{ $achievementImage := resources.Get .image }}
{{ $achievementImageLg := ""}}
{{ $achievementImageSm := ""}}
{{/* resize the images. don't resize svg image because its not supported */}}
{{ if $achievementImage }}
{{ $achievementImageSm = $achievementImage.Resize "x300" }}
{{ $achievementImageSm = $achievementImageSm.RelPermalink }}
{{ $achievementImageLg = $achievementImage.Resize "x1500" }}
{{ $achievementImageLg = $achievementImageLg.RelPermalink }}
{{ end }}
{{/* don't use "background-image: url('{{ $achievementImageSm }}');" Otherwise the images won't show in https://themes.gohugo.io/ */}}
<div
class="achievement-entry text-center"
style="background-image: url('{{ strings.TrimSuffix "/" site.BaseURL }}{{ .image | relURL }}');"
style="background-image: url('{{ strings.TrimSuffix "/" site.BaseURL }}{{ $achievementImageSm }}');"
>
<i class="fas fa-search-plus" id="enlarge-icon"></i>
<h4 class="title" id="achievement-title">{{ .title }}</h4>
@ -8,4 +20,6 @@
<h4>{{ .title }}</h4>
<p>{{ .summary | markdownify }}</p>
</div>
<span style="background-image: url('{{ strings.TrimSuffix "/" site.BaseURL }}{{ $achievementImageSm }}');" class="d-none" id="SmallImage" active="true"></span>
<span style="background-image: url('{{ strings.TrimSuffix "/" site.BaseURL }}{{ $achievementImageLg }}');" class="d-none" id="LargeImage"></span>
</div>

View file

@ -0,0 +1,110 @@
{{ $sectionID := replace (lower .section.name) " " "-" }}
{{ if .section.id }}
{{ $sectionID = .section.id }}
{{ end }}
<div class="container-fluid anchor pb-5 education-section education-alt" id="{{ $sectionID }}">
{{ if not (.section.hideTitle) }}
<h1 class="text-center">{{ .section.name }}</h1>
{{ end }}
<div class="container">
<table class="education-info-table">
<tbody>
{{ range .degrees}}
<tr>
<td class="icon">
<div class="hline"></div>
<div class="icon-holder">
<i class="fas {{ .icon }}"></i>
</div>
</td>
<td class="line">
<div></div>
</td>
<td class="details">
<div class="degree-info card">
<div class="row">
<div class="col-lg-10 col-md-8">
{{ if .institution.url }}
<h5><a href="{{ .institution.url }}">{{ .institution.name }}</a></h5>
{{ else }}
<h5>{{ .institution.name }}</h5>
{{ end }}
</div>
<div class="timeframe col-lg-2 col-md-4">{{ .timeframe }}</div>
</div>
<h6>{{ .name }}</h6>
{{ if .grade }}
<h6><span>{{ .grade.scale }}: </span><span>{{ .grade.achieved }}</span> {{ i18n "out_of" }} <span>{{ .grade.outOf }}</span></h6>
{{ end }}
{{ if .publications }}
<div class="publications">
<h6 class="text-muted">{{i18n "publications"}}</h6>
<ul>
{{ range .publications }}
<li><a href="{{ .url }} ">{{ .title }}</a></li>
{{ end }}
</ul>
</div>
{{ end }}
{{ if .takenCourses }}
<div class="taken-courses">
<h6 class="text-muted">{{ i18n "taken_courses" }}</h6>
{{ if .takenCourses.showGrades }}
<table>
<thead>
<th>{{ i18n "course_name" }}</th>
<th>{{ i18n "total_credit" }}</th>
<th>{{ i18n "obtained_credit" }}</th>
</thead>
<tbody>
{{ range $index,$course := .takenCourses.courses }}
<tr class="course {{ if gt $index 1 }}hidden-course{{ end}}">
<td>{{ $course.name }}</td>
<td>{{ $course.outOf }}</td>
<td>{{ $course.achieved }}</td>
</tr>
{{ end }}
</tbody>
</table>
{{ else }}
<ul>
{{ range $index,$course := .takenCourses.courses }}
<li class="course {{ if gt $index 1 }}hidden-course{{ end}}">{{ $course.name }}</li>
{{ end }}
</ul>
{{ end }}
{{ if gt (len .takenCourses.courses) 2 }}
<button type="button" class="btn btn-link show-more-btn pt-0 {{ if .takenCourses.showGrades }}ml-1{{ else }}ml-2{{ end }}"
onclick="showMoreCourses(this);">{{ i18n "see_more"}}</button>
{{ end }}
</div>
{{ end }}
{{ if .extracurricularActivities }}
<div class="extracurricular-activities">
<h6 class="text-muted">{{ i18n "extracurricular_activities" }}</h6>
<ul>
{{ range .extracurricularActivities }}
<li>{{ . }}</li>
{{ end }}
</ul>
</div>
{{ end }}
</div>
</td>
<td class="line">
<div></div>
</td>
<td class="icon">
<div class="hline"></div>
<div class="icon-holder">
<i class="fas {{ .icon }}"></i>
</div>
</td>
</tr>
{{ end }}
</tbody>
</table>
</div>
</div>

View file

@ -0,0 +1,101 @@
{{ $sectionID := replace (lower .section.name) " " "-" }}
{{ if .section.id }}
{{ $sectionID = .section.id }}
{{ end }}
<div class="container-fluid anchor pb-5 education-section" id="{{ $sectionID }}">
{{ if not (.section.hideTitle) }}
<h1 class="text-center">{{ .section.name }}</h1>
{{ end }}
<div class="container">
<table class="education-info-table">
<tbody>
{{ range .degrees}}
<tr>
<td class="icon">
<div class="hline"></div>
<div class="icon-holder">
<i class="fas {{ .icon }}"></i>
</div>
</td>
<td class="line">
<div></div>
</td>
<td class="details">
<div class="degree-info card">
<div class="row">
<div class="col-lg-10 col-md-8">
{{ if .institution.url }}
<h5><a href="{{ .institution.url }}">{{ .institution.name }}</a></h5>
{{ else }}
<h5>{{ .institution.name }}</h5>
{{ end }}
</div>
<div class="timeframe col-lg-2 col-md-4">{{ .timeframe }}</div>
</div>
<h6>{{ .name }}</h6>
{{ if .grade }}
<h6><span class="text-muted">{{ .grade.scale }}: </span><span>{{ .grade.achieved }}</span> {{ i18n "out_of"}} <span>{{ .grade.outOf }}</span></h6>
{{ end }}
{{ if .publications }}
<div class="publications">
<h6 class="text-muted">{{ i18n "publications"}}</h6>
<ul>
{{ range .publications }}
<li><a href="{{ .url }} ">{{ .title }}</a></li>
{{ end }}
</ul>
</div>
{{ end }}
{{ if .takenCourses }}
<div class="taken-courses">
<h6 class="text-muted">{{ i18n "taken_courses"}}</h6>
{{ if .takenCourses.showGrades }}
<table>
<thead>
<th>{{ i18n "course_name"}}</th>
<th>{{ i18n "total_credit"}}</th>
<th>{{ i18n "obtained_credit"}}</th>
</thead>
<tbody>
{{ range $index,$course := .takenCourses.courses }}
<tr class="course {{ if gt $index 1 }}hidden-course{{ end}}">
<td>{{ $course.name }}</td>
<td>{{ $course.outOf }}</td>
<td>{{ $course.achieved }}</td>
</tr>
{{ end }}
</tbody>
</table>
{{ else }}
<ul>
{{ range $index,$course := .takenCourses.courses }}
<li class="course {{ if gt $index 1 }}hidden-course{{ end}}">{{ $course.name }}</li>
{{ end }}
</ul>
{{ end }}
{{ if gt (len .takenCourses.courses ) 2 }}
<button type="button" class="btn btn-link show-more-btn pt-0 {{ if .takenCourses.showGrades }}ml-1{{ else }}ml-2{{ end }}"
onclick="showMoreCourses(this);">{{ i18n "see_more"}}</button>
{{ end }}
</div>
{{ end }}
{{ if .extracurricularActivities }}
<div class="extracurricular-activities">
<h6 class="text-muted">{{ i18n "extracurricular_activities"}}</h6>
<ul>
{{ range .extracurricularActivities }}
<li>{{ . }}</li>
{{ end }}
</ul>
</div>
{{ end }}
</div>
</td>
</tr>
{{ end }}
</tbody>
</table>
</div>
</div>

View file

@ -15,23 +15,97 @@
{{ $sections = (index site.Data site.Language.Lang).sections }}
{{ end }}
{{ $backgroundImage:= "/assets/images/default-background.jpg" }}
{{ $backgroundImage:= "/images/default-background.jpg" }}
{{ if site.Params.background }}
{{ $backgroundImage = site.Params.background }}
{{ end }}
{{ $authorImage:= "/assets/images/default-avatar.png" }}
{{ $authorImage:= "/images/default-avatar.png" }}
{{ if $author.image }}
{{ $authorImage = $author.image }}
{{ end }}
{{ $authorImage := resources.Get $authorImage }}
{{ $authorImage := $authorImage.Fit "148x148" }}
{{/* get file that matches the filename as specified as src="" in shortcode */}}
{{ $src := resources.Get $backgroundImage }}
{{/* set image sizes, these are hardcoded for now, x dictates that images are resized to this width */}}
{{ $tinyw := default "500x" }}
{{ $smallw := default "800x" }}
{{ $mediumw := default "1200x" }}
{{ $largew := default "1500x" }}
{{/* resize the src image to the given sizes */}}
{{ $tiny := $src.Resize $tinyw }}
{{ $small := $src.Resize $smallw }}
{{ $medium := $src.Resize $mediumw }}
{{ $large := $src.Resize $largew }}
{{/* only use images smaller than or equal to the src (original) image size, as Hugo will upscale small images */}}
{{/* set the sizes attribute to (min-width: 35em) 1200px, 100vw unless overridden in shortcode */}}
{{ if lt $src.Width "500" }}
{{ $tiny := $src}}
{{ $small := $src}}
{{ $medium := $src}}
{{ $large := $src}}
{{ end }}
{{ if lt $src.Width "800" }}
{{ $small := $src}}
{{ $medium := $src}}
{{ $large := $src}}
{{ end }}
{{ if lt $src.Width "1200" }}
{{ $medium := $src}}
{{ $large := $src}}
{{ end }}
{{ if lt $src.Width "1500" }}
{{ $large := $src}}
{{ end }}
<div class="container-fluid home" id="home">
<style>
/* 0 to 299 */
#homePageBackgroundImageDivStyled {
/*background-image: url('{{ $tiny.RelPermalink }}'); This does not work on https://themes.gohugo.io/ */
background-image: url('{{ $tiny.RelPermalink }}');
}
/* 300 to X */
@media (min-width: 500px) and (max-width: 800px) { /* or 301 if you want really the same as previously. */
#homePageBackgroundImageDivStyled {
background-image: url('{{ $small.RelPermalink }}');
}
}
@media (min-width: 801px) and (max-width: 1200px) { /* or 301 if you want really the same as previously. */
#homePageBackgroundImageDivStyled {
background-image: url('{{ $medium.RelPermalink }}');
}
}
@media (min-width: 1201px) and (max-width: 1500px) { /* or 301 if you want really the same as previously. */
#homePageBackgroundImageDivStyled {
background-image: url('{{ $large.RelPermalink }}');
}
}
@media (min-width: 1501px) { /* or 301 if you want really the same as previously. */
#homePageBackgroundImageDivStyled {
background-image: url('{{ $src.RelPermalink }}');
}
}
</style>
<span class="on-the-fly-behavior"></span>
<div
id="homePageBackgroundImageDivStyled"
class="background container-fluid"
style="background-image: url('{{ $backgroundImage | relURL }}');"
></div>
<div class="container content text-center">
<img src="{{ $authorImage | relURL }}"
<img src="{{ $authorImage.RelPermalink }}"
class="rounded-circle mx-auto d-block img-fluid"
/>
<h1 class="greeting"> {{ $author.greeting }} {{ $name }}</h1>

View file

@ -0,0 +1,53 @@
{{/* Combination of code taken from: https://alexlakatos.com/web/2020/07/17/hugo-image-processing/ & https://dev.to/stereobooster/responsive-images-for-hugo-dn9}}
{{/* get file that matches the filename as specified as src="" in shortcode */}}
{{ $src := resources.GetMatch (.Get "src") }}
{{ if in (.Get "src") "http" }}
<img src="{{$src}}" {{ with .Get "alt" }}alt="{{.}}"{{ else }}alt=""{{ end }}>
{{ else }}
{{ if in (.Get "src") ".gif" }}
<img src="{{$src.RelPermalink}}" {{ with .Get "alt" }}alt="{{.}}"{{ else }}alt=""{{ end }}>
{{ else }}
{{/* set image sizes, these are hardcoded for now */}}
{{ $tinyw := default "500x" }}
{{ $smallw := default "800x" }}
{{ $mediumw := default "1200x" }}
{{ $largew := default "1500x" }}
{{/* resize the src image to the given sizes */}}
{{ $tiny := $src.Resize $tinyw }}
{{ $small := $src.Resize $smallw }}
{{ $medium := $src.Resize $mediumw }}
{{ $large := $src.Resize $largew }}
{{/* add the processed images to the scratch */}}
{{/* only use images smaller than or equal to the src (original) image size */}}
<img
{{ with .Get "sizes" }}sizes='{{.}}'{{ else }}{{ end }}
srcset='
{{ if ge $src.Width "500" }}
{{ with $tiny.RelPermalink }}{{.}} 500w{{ end }}
{{ end }}
{{ if ge $src.Width "800" }}
{{ with $small.RelPermalink }}, {{.}} 800w{{ end }}
{{ end }}
{{ if ge $src.Width "1200" }}
{{ with $medium.RelPermalink }}, {{.}} 1200w{{ end }}
{{ end }}
{{ if ge $src.Width "1500" }}
{{ with $large.RelPermalink }}, {{.}} 1500w {{ end }}
{{ end }}'
{{ if .Get (print $medium) }}
src="{{ $medium.RelPermalink }}"
{{ else }}
src="{{ $src.RelPermalink }}"
{{ end }}
{{ with .Get "alt" }}alt='{{.}}'{{ end }}>
{{ end }}
{{ end }}