Merge branch 'master' into master

This commit is contained in:
Emruz Hossain 2021-03-14 01:11:39 +06:00 committed by GitHub
commit 67abb6bc45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 788 additions and 49 deletions

View file

@ -11,7 +11,7 @@ jobs:
uses: actions/checkout@v2.3.4
- name: Setup Node
uses: actions/setup-node@v2.1.4
uses: actions/setup-node@v2.1.5
with:
node-version: "15.x"
@ -21,7 +21,7 @@ jobs:
npm run autoprefixer
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3.6.0
uses: peter-evans/create-pull-request@v3.8.2
with:
branch: autoprefixer
branch-suffix: timestamp

View file

@ -10,6 +10,6 @@ jobs:
runs-on: ubuntu-latest
steps:
# Create/Update release draft
- uses: release-drafter/release-drafter@v5.13.0
- uses: release-drafter/release-drafter@v5.14.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -68,7 +68,7 @@ At first, add [Toha](https://github.com/hugo-toha/toha) theme as git submodule t
$ git submodule add https://github.com/hugo-toha/toha.git themes/toha
```
>Don't use SSH URL of the theme during adding as git sub-module. Also, don't clone the theme in your `themes` directory using `git clone`. They don't work well with Github Action or Netlify.
> Don't use SSH URL of the theme during adding as git sub-module. Also, don't clone the theme in your `themes` directory using `git clone`. They don't work well with Github Action or Netlify.
If you don't already have a hugo site, create one by following the step by step guide from [here](https://toha-guides.netlify.app/posts/getting-started/prepare-site/).
@ -102,8 +102,9 @@ enableEmoji: true
# Site parameters
params:
# GitHub repo URL of your site
# GitHub repo URL and branch of your site
gitRepo: https://github.com/hugo-toha/hugo-toha.github.io
gitBranch: main
# specify whether you want to write some blog posts or not
enableBlogPost: true
@ -145,12 +146,14 @@ Here, are the current plan and progress of various components of this theme. The
### Sections
- [x] **Home**
- [x] Configurable Background
- [x] Author Image
- [x] Greeting
- [x] Typing Carousel
- [x] **About**
- [x] Name and Designation
- [x] Summary
- [x] Markdown Support
@ -160,16 +163,19 @@ Here, are the current plan and progress of various components of this theme. The
- [x] Soft Skills Indicator
- [x] **Skills**
- [x] Skill Cards
- [x] Markdown Support
- [x] **Experiences**
- [x] Designation
- [x] Timeline
- [x] Company Overview
- [x] Responsibilities
- [ ] **Projects**
- [x] Category Filter
- [ ] Project Card
- [x] Overview
@ -181,6 +187,7 @@ Here, are the current plan and progress of various components of this theme. The
- [x] **Recent Posts**
- [ ] **Academic Career**
- [ ] Degree
- [ ] Institution
- [ ] Timeline
@ -189,6 +196,7 @@ Here, are the current plan and progress of various components of this theme. The
- [ ] Extracurricular Activities
- [ ] **Publications**
- [ ] Category Filter
- [ ] Card
- [ ] Abstract
@ -198,6 +206,7 @@ Here, are the current plan and progress of various components of this theme. The
- [ ] Gallery
- [ ] **Accomplishment / Courses**
- [ ] Overview
- [ ] Certificate
@ -246,7 +255,7 @@ Pull requests are most welcome and I will be happy to review. Just follow the fo
- Use as few dependencies as possible.
- Have patience.
>I am not a web developer. I have created this theme for my personal needs. So, it is reasonable to have some flaws in the codes. Feel free to open issues and PRs acknowledging the problems.
> I am not a web developer. I have created this theme for my personal needs. So, it is reasonable to have some flaws in the codes. Feel free to open issues and PRs acknowledging the problems.
## Local Development

52
content/posts/search.md Normal file
View file

@ -0,0 +1,52 @@
---
title: "Search Results"
sitemap:
priority : 0.1
layout: "search"
url: search
---
This file exists solely to respond to /search URL with the related `search` layout template.
No content shown here is rendered, all content is based in the template layouts/page/search.html
Setting a very low sitemap priority will tell search engines this is not important content.
This implementation uses Fusejs, jquery and mark.js
## Initial setup
Search depends on additional output content type of JSON in config.toml
\```
[outputs]
home = ["HTML", "JSON"]
\```
## Searching additional fileds
To search additional fields defined in front matter, you must add it in 2 places.
### Edit layouts/_default/index.JSON
This exposes the values in /index.json
i.e. add `category`
\```
...
"contents":{{ .Content | plainify | jsonify }}
{{ if .Params.tags }},
"tags":{{ .Params.tags | jsonify }}{{end}},
"categories" : {{ .Params.categories | jsonify }},
...
\```
### Edit fuse.js options to Search
`static/js/search.js`
\```
keys: [
"title",
"contents",
"tags",
"categories"
]
\```

View file

@ -32,6 +32,14 @@ languages:
languageName: 中文
weight: 8
# At least HTML and JSON are required for the main HTML content and
# client-side JavaScript search
outputs:
home:
- HTML
- RSS
- JSON
# Force a locale to be use, really useful to develop the application ! Should be commented in production, the "weight" should rocks.
# DefaultContentLanguage: fr
@ -69,6 +77,7 @@ params:
# GitHub repo URL of your site
gitRepo: https://github.com/hugo-toha/hugo-toha.github.io
gitBranch: main
# specify whether you want to write some blog posts or not
enableBlogPost: true

View file

@ -38,7 +38,7 @@ projects:
repo: https://github.com/tensorflow/tensorflow
#url: ""
summary: An Open Source Machine Learning Framework for Everyone.
tags: ["professional", "machine-learning","academic"]
tags: ["professional", "machine-learning"]
- name: A sample academic paper
role: Team Lead

View file

@ -37,7 +37,7 @@ projects:
repo: https://github.com/tensorflow/tensorflow
#url: ""
summary: An Open Source Machine Learning Framework for Everyone.
tags: ["professional", "machine-learning","academic"]
tags: ["professional", "machine-learning"]
- name: A sample academic paper
role: Team Lead

View file

@ -37,7 +37,7 @@ projects:
repo: https://github.com/tensorflow/tensorflow
#url: ""
summary: An Open Source Machine Learning Framework for Everyone.
tags: ["professional", "machine-learning","academic"]
tags: ["professional", "machine-learning"]
- name: A sample academic paper
role: Team Lead

View file

@ -37,7 +37,7 @@ projects:
repo: https://github.com/tensorflow/tensorflow
#url: ""
summary: An Open Source Machine Learning Framework for Everyone.
tags: ["professional", "machine-learning","academic"]
tags: ["professional", "machine-learning"]
- name: A sample academic paper
role: Team Lead

View file

@ -70,3 +70,27 @@ other = "পাঠক্রম বহির্ভূত কার্যক্র
[see_more]
other = "আরো দেখুন"
[responsibilities]
other = "দায়িত্বসমুহ:"
[present]
other = "বর্তমান"
# [comments_javascript]
# other = "Please enable JavaScript to view the"
# [comments_by]
# other = "comments powered by"
# [read]
# other = "Read"
# [project_star]
# other = "Star"
# [project_details]
# other = "Details"
# [err_404]
# other = "The page you are looking for is not there yet."

View file

@ -73,3 +73,27 @@ other = "课外活动"
[see_more]
other = "查看更多"
# [responsibilities]
# other = "Responsibilities:"
# [present]
# other = "Present"
# [comments_javascript]
# other = "Please enable JavaScript to view the"
# [comments_by]
# other = "comments powered by"
# [read]
# other = "Read"
# [project_star]
# other = "Star"
# [project_details]
# other = "Details"
# [err_404]
# other = "The page you are looking for is not there yet."

View file

@ -73,3 +73,27 @@ other = "Buitenschoolse activiteiten"
[see_more]
other = "Bekijk meer"
# [responsibilities]
# other = "Responsibilities:"
# [present]
# other = "Present"
# [comments_javascript]
# other = "Please enable JavaScript to view the"
# [comments_by]
# other = "comments powered by"
# [read]
# other = "Read"
# [project_star]
# other = "Star"
# [project_details]
# other = "Details"
# [err_404]
# other = "The page you are looking for is not there yet."

View file

@ -73,3 +73,27 @@ other = "Extracurricular Activities"
[see_more]
other = "See More"
[responsibilities]
other = "Responsibilities:"
[present]
other = "Present"
[comments_javascript]
other = "Please enable JavaScript to view the"
[comments_by]
other = "comments powered by"
[read]
other = "Read"
[project_star]
other = "Star"
[project_details]
other = "Details"
[err_404]
other = "The page you are looking for is not there yet."

View file

@ -73,3 +73,27 @@ other = "Actividades extracurriculares"
[see_more]
other = "Ver más"
# [responsibilities]
# other = "Responsibilities:"
# [present]
# other = "Present"
# [comments_javascript]
# other = "Please enable JavaScript to view the"
# [comments_by]
# other = "comments powered by"
# [read]
# other = "Read"
# [project_star]
# other = "Star"
# [project_details]
# other = "Details"
# [err_404]
# other = "The page you are looking for is not there yet."

View file

@ -73,3 +73,27 @@ other = "Activités extra-scolaires"
[see_more]
other = "En savoir plus"
# [responsibilities]
# other = "Responsibilities:"
# [present]
# other = "Present"
# [comments_javascript]
# other = "Please enable JavaScript to view the"
# [comments_by]
# other = "comments powered by"
# [read]
# other = "Read"
# [project_star]
# other = "Star"
# [project_details]
# other = "Details"
# [err_404]
# other = "The page you are looking for is not there yet."

View file

@ -73,3 +73,27 @@ other = "अतिरिक्त पाठयक्रम गतिविधि
[see_more]
other = "और देखें"
# [responsibilities]
# other = "Responsibilities:"
# [present]
# other = "Present"
# [comments_javascript]
# other = "Please enable JavaScript to view the"
# [comments_by]
# other = "comments powered by"
# [read]
# other = "Read"
# [project_star]
# other = "Star"
# [project_details]
# other = "Details"
# [err_404]
# other = "The page you are looking for is not there yet."

View file

@ -73,3 +73,27 @@ other = "Kegiatan ekstrakulikuler"
[see_more]
other = "Lihat Selengkapnya"
# [responsibilities]
# other = "Responsibilities:"
# [present]
# other = "Present"
# [comments_javascript]
# other = "Please enable JavaScript to view the"
# [comments_by]
# other = "comments powered by"
# [read]
# other = "Read"
# [project_star]
# other = "Star"
# [project_details]
# other = "Details"
# [err_404]
# other = "The page you are looking for is not there yet."

View file

@ -73,3 +73,27 @@ other = "Attività extracurriculari"
[see_more]
other = "Vedi altro"
# [responsibilities]
# other = "Responsibilities:"
# [present]
# other = "Present"
# [comments_javascript]
# other = "Please enable JavaScript to view the"
# [comments_by]
# other = "comments powered by"
# [read]
# other = "Read"
# [project_star]
# other = "Star"
# [project_details]
# other = "Details"
# [err_404]
# other = "The page you are looking for is not there yet."

View file

@ -70,3 +70,27 @@ other = "課外活動"
[see_more]
other = "続きを見る"
# [responsibilities]
# other = "Responsibilities:"
# [present]
# other = "Present"
# [comments_javascript]
# other = "Please enable JavaScript to view the"
# [comments_by]
# other = "comments powered by"
# [read]
# other = "Read"
# [project_star]
# other = "Star"
# [project_details]
# other = "Details"
# [err_404]
# other = "The page you are looking for is not there yet."

99
i18n/ko.toml Normal file
View file

@ -0,0 +1,99 @@
# More documentation here: https://github.com/nicksnyder/go-i18n
[home]
other = "Home"
[posts]
other = "게시글"
[toc_heading]
other = "목차"
[at]
other = "at"
[resume]
other = "이력서"
[navigation]
other = "바로가기"
[contact_me]
other = "Contact me:"
[email]
other = "Email"
[phone]
other = "Phone"
[newsletter_text]
other = "이메일 알림으로 최신 상태를 유지해보세요"
[newsletter_input_placeholder]
other = "이메일을 입력하세요"
[newsletter_warning]
other = "이메일을 다른 목적으로 사용하지 않습니다."
[submit]
other = "제출"
[hugoAttributionText]
other = "Powered by"
[prev]
other = "이전"
[next]
other = "다음"
[improve_this_page]
other = "이 페이지를 개선"
[out_of]
other = "out of"
[publications]
other = "Publications"
[taken_courses]
other = "이수 과목"
[course_name]
other = "과목명"
[total_credit]
other = "총 수익"
[obtained_credit]
other = "획득한 수익"
[extracurricular_activities]
other = "기타 활동"
[see_more]
other = "더보기"
# [responsibilities]
# other = "Responsibilities:"
# [present]
# other = "Present"
# [comments_javascript]
# other = "Please enable JavaScript to view the"
# [comments_by]
# other = "comments powered by"
# [read]
# other = "Read"
# [project_star]
# other = "Star"
# [project_details]
# other = "Details"
# [err_404]
# other = "The page you are looking for is not there yet."

View file

@ -73,3 +73,27 @@ other = "Внеклассные занятия"
[see_more]
other = "Узнать больше"
# [responsibilities]
# other = "Responsibilities:"
# [present]
# other = "Present"
# [comments_javascript]
# other = "Please enable JavaScript to view the"
# [comments_by]
# other = "comments powered by"
# [read]
# other = "Read"
# [project_star]
# other = "Star"
# [project_details]
# other = "Details"
# [err_404]
# other = "The page you are looking for is not there yet."

View file

@ -73,3 +73,27 @@ other = "Các hoạt động ngoại khóa"
[see_more]
other = "Xem thêm"
# [responsibilities]
# other = "Responsibilities:"
# [present]
# other = "Present"
# [comments_javascript]
# other = "Please enable JavaScript to view the"
# [comments_by]
# other = "comments powered by"
# [read]
# other = "Read"
# [project_star]
# other = "Star"
# [project_details]
# other = "Details"
# [err_404]
# other = "The page you are looking for is not there yet."

View file

@ -22,7 +22,7 @@
<img src="{{ $notFoundImage }}" alt="">
<div class="message">
<h1>404</h1>
<h4>The page you are looking for is not there yet.</h4>
<h4>{{ i18n "err_404" }}</h4>
</div>
</div>
</div>

View file

@ -0,0 +1,5 @@
{{- $.Scratch.Add "index" slice -}}
{{- range .Site.RegularPages -}}
{{- $.Scratch.Add "index" (dict "title" .Title "hero" (partial "helpers/get-hero.html" .) "date" (.Date.Format "January 2, 2006") "summary" .Summary "tags" .Params.tags "categories" .Params.categories "contents" .Plain "permalink" .Permalink) -}}
{{- end -}}
{{- $.Scratch.Get "index" | jsonify -}}

View file

@ -16,7 +16,9 @@
<section class="sidebar-section" id="sidebar-section">
<div class="sidebar-holder">
<div class="sidebar" id="sidebar">
<input type="text" value="" placeholder="Search" data-search="" id="search-box" />
<form class="mx-auto" method="get" action="{{ "search" | absURL }}">
<input type="text" name="keyword" value="" placeholder="Search" data-search="" id="search-box" />
</form>
<div class="sidebar-tree">
<ul class="tree" id="tree">
<li id="list-heading"><a href="{{ .Type | relLangURL }}" data-filter="all">{{ i18n .Type }}</a></li>

View file

@ -0,0 +1,71 @@
{{ define "header" }}
<link rel="stylesheet" href="{{ "/css/layouts/list.css" | relURL }}">
<link rel="stylesheet" href="{{ "/css/navigators/sidebar.css" | relURL}}">
{{ end }}
{{ define "navbar" }}
{{ partial "navigators/navbar-2.html" . }}
{{ end }}
{{ define "sidebar" }}
{{ $blogHome:="#" }}
{{ if site.IsMultiLingual }}
{{ $blogHome = (path.Join (cond ( eq .Language.Lang "en") "" .Language.Lang) .Type) }}
{{ end }}
<section class="sidebar-section" id="sidebar-section">
<div class="sidebar-holder">
<div class="sidebar" id="sidebar">
<form class="mx-auto" method="get" action="{{ "search" | absURL }}">
<input type="text" name="keyword" value="" placeholder="Search" data-search="" id="search-box" />
</form>
<div class="sidebar-tree">
<ul class="tree" id="tree">
<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>
</ul>
</div>
</div>
</div>
</section>
{{ end }}
{{ define "content" }}
<section class="content-section" id="content-section">
<div class="content container-fluid" id="content">
<div class="container-fluid post-card-holder" id="post-card-holder">
<div id="search-results">
<script id="search-result-template" type="text/x-js-template">
<div class="post-card">
<a href="${link}" class="post-card-link">
<div class="card" style="min-height: 352px;"><a href="${link}" class="post-card-link">
<div class="card-head">
<img class="card-img-top" src="${hero}">
</div>
<div class="card-body">
<h5 class="card-title">${title}</h5>
<p class="card-text post-summary">${summary}</p>
</div>
<div class="card-footer">
<span class="float-left">${date}</span>
<a href="${link}" class="float-right btn btn-outline-info btn-sm">Read</a>
</div>
</div>
</a>
</div>
</script>
</div>
</div>
</div>
</section>
{{ end }}
{{ define "scripts" }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/3.2.0/fuse.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.min.js"></script>
<script src="{{ "/js/search.js" | absURL }}"></script>
{{ end }}

View file

@ -16,7 +16,9 @@
<section class="sidebar-section" id="sidebar-section">
<div class="sidebar-holder">
<div class="sidebar" id="sidebar">
<input type="text" value="" placeholder="Search" data-search="" id="search-box" />
<form class="mx-auto" method="get" action="{{ "search" | absURL }}">
<input type="text" name="keyword" value="" placeholder="Search" data-search="" id="search-box" />
</form>
<div class="sidebar-tree">
<ul class="tree" id="tree">
<li id="list-heading"><a href="{{ "/posts" | relLangURL }}" data-filter="all">{{ i18n "posts" }}</a></li>
@ -57,7 +59,7 @@
<!--- Improve this page button --->
{{ if site.Params.GitRepo }}
<div class="btn-improve-page">
<a href="{{ site.Params.GitRepo }}/edit/master/content/{{ .File.Path }}">
<a href="{{ site.Params.GitRepo }}/edit/{{ site.Params.GitBranch }}/content/{{ .File.Path }}">
<i class="fas fa-code-branch"></i>
{{ i18n "improve_this_page" }}
</a>
@ -75,6 +77,8 @@
</div>
</div>
</div>
<!--scroll back to top-->
<a id="scroll-to-top" class="btn"><i class="fas fa-chevron-circle-up"></i></a>
{{ if .IsTranslated }}
{{ partial "navigators/floating-lang-selector.html" . }}
{{ end }}

View file

@ -13,7 +13,7 @@
<a
href="{{ .RelPermalink | relLangURL }}"
class="float-right btn btn-outline-info btn-sm"
>Read</a
>{{ i18n "read" }}</a
>
</div>
</div>

View file

@ -26,25 +26,39 @@
</a>
<div class="card-body text-justify pt-1 pb-1">
<p>{{ .summary | markdownify }}</p>
<span class="float-right">
<!-- Display project card technology tags -->
<div class="project-card-footer">
{{ if .tags }}
<div class="project-tags-holder">
{{ range $index,$tag:= .tags }}
<span class="badge btn-info">
{{ $tag }}
</span>
{{ end }}
</div>
{{ end }}
<div class="project-btn-holder">
{{ if .repo }}
<a
class="github-button-inactive"
class="github-button-inactive project-btn"
href="{{ .repo }}"
data-icon="octicon-standard"
data-show-count="true"
aria-label="Star {{ .name }}"
>Star</a
>{{ i18n "project_star" }}</a
>
{{ else if .url }}
<span>
<a
class="btn btn-outline-info btn-sm mb-2"
class="btn btn-outline-info btn-sm"
href="{{ .url }}"
target="#"
>Details</a
>{{ i18n "project_details" }}</a
>
{{ end }}
</span>
{{ end }}
</div>
</div>
</div>
</div>
</div>

View file

@ -12,7 +12,7 @@
</div>
<div class="card-footer">
<span class="float-left">{{ .Date.Format "January 2, 2006" }}</span>
<a href="{{ .RelPermalink }}" class="float-right btn btn-outline-info btn-sm">Read</a>
<a href="{{ .RelPermalink }}" class="float-right btn btn-outline-info btn-sm">{{ i18n "read" }}</a>
</div>
</div>
</a>

View file

@ -17,11 +17,11 @@
})();
</script>
<noscript
>Please enable JavaScript to view the
>{{ i18n "comments_javascript" }}
<a href="https://disqus.com/?ref_noscript"
>comments powered by Disqus.</a
>{{ i18n "comments_by" }} Disqus.</a
></noscript
>
<a href="https://disqus.com/" class="dsq-brlink"
>comments powered by <span class="logo-disqus">Disqus</span></a
>{{ i18n "comments_by" }} <span class="logo-disqus">Disqus</span></a
>

View file

@ -1,5 +1,10 @@
{{/* check if there is any hero image in the same folder as the markdown file */}}
{{ $heroImage := .Page.Resources.GetMatch "hero.{jpg,png,svg}"}}
{{/* if hero image is specified in the page front-matter, then use that */}}
{{ if .Params.hero }}
{{ $heroImage = .Page.Resources.GetMatch .Params.hero }}
{{ end }}
{{ .Scratch.Set "heroScratch" $heroImage }}
{{/* if hero image is not provided, then use the default hero image */}}

View file

@ -30,6 +30,8 @@
<li>
{{ if eq .name "Email" }}
<a href="mailto:{{ .url }}" target="/"><i class="{{ .icon }}"></i></a>
{{ else if eq .name "Phone" }}
<a href="tel:{{ .url }}" target="/"><i class="{{ .icon }}"></i></a>
{{ else }}
<a href="{{ .url }}" target="/"><i class="{{ .icon }}"></i></a>
{{ end }}

View file

@ -52,17 +52,18 @@
<div class="taken-courses">
<h6 class="text-muted">{{ i18n "taken_courses" }}</h6>
{{ if .takenCourses.showGrades }}
{{ $hideScale := .takenCourses.hideScale }}
<table>
<thead>
<th>{{ i18n "course_name" }}</th>
<th>{{ i18n "total_credit" }}</th>
{{ if not $hideScale }}<th>{{ i18n "total_credit" }}</th>{{ end }}
<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>
{{ if not $hideScale }}<td>{{ $course.outOf }}</td>{{ end }}
<td>{{ $course.achieved }}</td>
</tr>
{{ end }}

View file

@ -52,17 +52,18 @@
<div class="taken-courses">
<h6 class="text-muted">{{ i18n "taken_courses"}}</h6>
{{ if .takenCourses.showGrades }}
{{ $hideScale := .takenCourses.hideScale }}
<table>
<thead>
<th>{{ i18n "course_name"}}</th>
<th>{{ i18n "total_credit"}}</th>
{{ if not $hideScale }}<th>{{ i18n "total_credit"}}</th>{{ end }}
<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>
{{ if not $hideScale }}<td>{{ $course.outOf }}</td>{{ end }}
<td>{{ $course.achieved }}</td>
</tr>
{{ end }}

View file

@ -7,7 +7,7 @@
{{ $oldestPosition := index (last 1 .positions) 0}}
{{ $mostRecentPosition := index (first 1 .positions) 0}}
<p class="text-muted">
{{ $oldestPosition.start }} - {{ if $mostRecentPosition.end }}{{ $mostRecentPosition.end }}{{ else }}Present{{ end }},
{{ $oldestPosition.start }} - {{ if $mostRecentPosition.end }}{{ $mostRecentPosition.end }}{{ else }}{{ i18n "present" }}{{ end }},
{{ .company.location }}
</p>
<!-- Add company overview -->
@ -17,7 +17,7 @@
<div class="positions">
{{ range $index,$position:= .positions }}
<h6 class="designation">{{ $position.designation }}</h6>
<p class="text-muted">{{ $position.start }} - {{if $position.end }} {{ $position.end }} {{else}} Present {{end}}</p>
<p class="text-muted">{{ $position.start }} - {{if $position.end }} {{ $position.end }} {{else}} {{ i18n "present" }} {{end}}</p>
<!-- Add the responsibilities handled at this position -->
<ul class="justify-content-around">
{{ range $position.responsibilities }}

View file

@ -5,14 +5,14 @@
<h5>{{ $position.designation }}</h5>
<h6>{{ if .company.url }}<a href={{.company.url}}>{{ .company.name }}</a>{{ else }}{{ .company.name }}{{ end }}</h6>
<!-- Add experience duration info -->
<p class="text-muted">{{ $position.start }} - {{ if $position.end }}{{ $position.end }}{{ else }}Present{{ end }},
<p class="text-muted">{{ $position.start }} - {{ if $position.end }}{{ $position.end }}{{ else }}{{ i18n "present" }}{{ end }},
{{ .company.location }}
</p>
</div>
<!-- Add company overview -->
<p>{{ .company.overview | markdownify }}</p>
<!-- Add the responsibilities handled at this position -->
<h6 class="text-muted">Responsibilities:</h6>
<h6 class="text-muted">{{ i18n "responsibilities" }}</h6>
<ul class="justify-content-around">
{{ range $position.responsibilities }}
<li>{{ . | markdownify }}</li>

1
package-lock.json generated
View file

@ -247,7 +247,6 @@
"dependencies": {
"anymatch": "~3.1.1",
"braces": "~3.0.2",
"fsevents": "~2.1.2",
"glob-parent": "~5.1.0",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",

View file

@ -313,6 +313,31 @@ mark {
display: none;
}
#scroll-to-top{
position: fixed;
bottom: 0rem;
right: 1rem;
color:#248aaa;
font-size: 24pt;
z-index: 900000;
visibility: hidden;
}
#scroll-to-top i{
box-shadow: 0px 8px 56px rgba(15, 80, 100, 0.16);
background-color: #f9f9f9;
border-radius: 50%;
}
#scroll-to-top:hover{
color: #2098d1;
}
#scroll-to-top.show{
visibility: visible;
}
/* ============= Device specific fixes ======= */
/* Large screens such as TV */
@ -419,6 +444,9 @@ mark {
/* Medium devices (tablets, 768px and up) */
@media only screen and (max-width: 768px) {
#scroll-to-top{
right: 8rem;
}
}
/* Small devices (landscape phones, 576px and up) */

View file

@ -29,6 +29,26 @@
padding: 1rem !important;
}
.project-card-footer {
display: flex;
}
.project-tags-holder {
width: 70%;
}
.project-btn-holder {
width: 30%;
display: flex;
justify-content: flex-end;
flex-direction: column;
}
.project-btn-holder span {
justify-content: flex-end;
display: flex;
}
/* ============= Device specific fixes ======= */
/* Large screens such as TV */

112
static/js/search.js Normal file
View file

@ -0,0 +1,112 @@
summaryInclude=60;
var fuseOptions = {
shouldSort: true,
includeMatches: true,
threshold: 0.0,
tokenize:true,
location: 0,
distance: 100,
maxPatternLength: 32,
minMatchCharLength: 1,
keys: [
{name:"title",weight:0.8},
{name:"hero",weight:0.7},
{name:"summary",weight:0.6},
{name:"date",weight:0.5},
{name:"contents",weight:0.5},
{name:"tags",weight:0.3},
{name:"categories",weight:0.3}
]
};
var searchQuery = param("keyword");
if(searchQuery){
$("#search-query").val(searchQuery);
executeSearch(searchQuery);
}else {
$('#search-results').append("<p>Please enter a word or phrase above</p>");
}
function executeSearch(searchQuery){
$.getJSON( "/index.json", function( data ) {
var pages = data;
var fuse = new Fuse(pages, fuseOptions);
var result = fuse.search(searchQuery);
// console.log({"matches":result});
document.getElementById("search-box").value = searchQuery
if(result.length > 0){
populateResults(result);
}else{
$('#search-results').append("<p>No matches found</p>");
}
});
}
function populateResults(result){
$.each(result,function(key,value){
var contents= value.item.contents;
var snippet = "";
var snippetHighlights=[];
var tags =[];
if( fuseOptions.tokenize ){
snippetHighlights.push(searchQuery);
}else{
$.each(value.matches,function(matchKey,mvalue){
if(mvalue.key == "tags" || mvalue.key == "categories" ){
snippetHighlights.push(mvalue.value);
}else if(mvalue.key == "contents"){
start = mvalue.indices[0][0]-summaryInclude>0?mvalue.indices[0][0]-summaryInclude:0;
end = mvalue.indices[0][1]+summaryInclude<contents.length?mvalue.indices[0][1]+summaryInclude:contents.length;
snippet += contents.substring(start,end);
snippetHighlights.push(mvalue.value.substring(mvalue.indices[0][0],mvalue.indices[0][1]-mvalue.indices[0][0]+1));
}
});
}
if(snippet.length<1){
snippet += contents.substring(0,summaryInclude*2);
}
//pull template from hugo templarte definition
var templateDefinition = $('#search-result-template').html();
//replace values
var output = render(templateDefinition,{key:key,title:value.item.title,hero:value.item.hero,date:value.item.date,summary:value.item.summary,link:value.item.permalink,tags:value.item.tags,categories:value.item.categories,snippet:snippet});
$('#search-results').append(output);
$.each(snippetHighlights,function(snipkey,snipvalue){
$("#summary-"+key).mark(snipvalue);
});
});
}
function param(name) {
return decodeURIComponent((location.search.split(name + '=')[1] || '').split('&')[0]).replace(/\+/g, ' ');
}
function render(templateString, data) {
var conditionalMatches,conditionalPattern,copy;
conditionalPattern = /\$\{\s*isset ([a-zA-Z]*) \s*\}(.*)\$\{\s*end\s*}/g;
//since loop below depends on re.lastInxdex, we use a copy to capture any manipulations whilst inside the loop
copy = templateString;
while ((conditionalMatches = conditionalPattern.exec(templateString)) !== null) {
if(data[conditionalMatches[1]]){
//valid key, remove conditionals, leave contents.
copy = copy.replace(conditionalMatches[0],conditionalMatches[2]);
}else{
//not valid, remove entire section
copy = copy.replace(conditionalMatches[0],'');
}
}
templateString = copy;
//now any conditionals removed we can do simple substitution
var key, find, re;
for (key in data) {
find = '\\$\\{\\s*' + key + '\\s*\\}';
re = new RegExp(find, 'g');
templateString = templateString.replace(re, data[key]);
}
return templateString;
}

View file

@ -59,5 +59,23 @@ var isMobile = false, isTablet = false, isLaptop = false;
elems[i].classList.add("nav-link");
}
// add scroll to top button
function scrollToTop() {
var btn = $('#scroll-to-top');
$(window).scroll(function () {
if ($(window).scrollTop() > 300) {
btn.addClass('show');
} else {
btn.removeClass('show');
}
});
btn.on('click', function (e) {
e.preventDefault();
$('html, body').animate({ scrollTop: 0 }, '300');
});
}
scrollToTop();
});
})(jQuery);