Skip to content

Commit

Permalink
Allow multiple position in one company experience (hugo-toha#9)
Browse files Browse the repository at this point in the history
* Add partials for multiple positions on one company

* Remove unnecessary codes + Fix CSS

Co-authored-by: hossainemruz <[email protected]>
  • Loading branch information
Trepix and hossainemruz committed Jul 6, 2020
1 parent f03e94e commit 440f424
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 46 deletions.
63 changes: 37 additions & 26 deletions exampleSite/data/sections/experiences.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,55 @@ section:

# Your experiences
experiences:
- designation: Software Engineer
company:
- company:
name: Example Co.
url: "https://www.example.com"
location: Dhaka Branch
# company overview
overview: Example Co. is a widely recognized company for cloud-native development. It builds tools for Kubernetes.
start: Nov 2017
# don't provide end date if you are currently working there. It will be replaced by "Present"
# end: Dec 2020
# give some points about what was your responsibilities at the company.
responsibilities:
- Design, develop and manage disaster recovery tool [Xtool](https://www.example.com) that backup Kubernetes volumes, databases, and cluster's resource definition.
- My another responsibility.
- My more responsibilities.
positions:
- designation: Senior Software Engineer
start: Nov 2019
# don't provide end date if you are currently working there. It will be replaced by "Present"
# end: Dec 2020
# give some points about what was your responsibilities at the company.
responsibilities:
- Design and develop XYZ tool for ABC task
- Design, develop and manage disaster recovery tool [Xtool](https://www.example.com) that backup Kubernetes volumes, databases, and cluster's resource definition.
- Lead backend team.

- designation: Software Engineer
company:
- designation: Junior Software Engineer
start: Nov 2017
end: Oct 2019
responsibilities:
- Implement and test xyz feature for abc tool.
- Support client for abc tool.
- Learn k,d,w technology for xyz.

- company:
name: PreExample Co.
url: "https://www.preexample.com"
location: Nowhere
overview: PreExample Co. is a gateway company to enter into Example co. So, nothing special here.
start: March 2016
end: May 2017
responsibilities:
- Write lots of example codes.
- Read lots of examples.
- See lots of example videos.
positions:
- designation: Software Engineer
start: March 2016
end: May 2017
responsibilities:
- Write lots of example codes.
- Read lots of examples.
- See lots of example videos.

- designation: Intern
company:
- company:
name: Intern Counting Company (ICC).
url: "https://www.intern.com"
location: Intern Land
overview: Intern counting Company (ICC) is responsible for counting worldwide intern Engineers.
start: Jun 2015
end: Jan 2016
responsibilities:
- Count lost of interns.
- Count more interns.
- Count me as an intern.
positions:
- designation: Intern
start: Jun 2015
end: Jan 2016
responsibilities:
- Count lost of interns.
- Count more interns.
- Count me as an intern.
2 changes: 1 addition & 1 deletion exampleSite/data/sections/recent-posts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ section:
# Can optionally hide the title in sections
# hideTitle: true

# no other configuration is required
# no additional configuration is required
19 changes: 5 additions & 14 deletions layouts/partials/experiences/experience-info.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
<div class="col-10 col-lg-8">
<div class="experience-entry-heading">
<h5><a href="{{ .company.url }}">{{ .company.name }}</a></h5>
<h6>{{ .designation }}</h6>
<p class="text-muted">{{ .start }} - {{ if .end }} {{ .end }} {{ else }}Present{{ end }}, {{ .company.location }}</p>
</div>
<p>{{ .company.overview | markdownify }}</p>
<h6 class="text-muted">Responsibilities:</h6>
<ul class="justify-content-around">
{{ range .responsibilities }}
<li>{{ . | markdownify }}</li>
{{ end }}
</ul>
</div>
{{ if gt (len .positions) 1 }}
{{ partial "experiences/multiple-positions" . }}
{{ else }}
{{ partial "experiences/single-position.html" . }}
{{ end }}
29 changes: 29 additions & 0 deletions layouts/partials/experiences/multiple-positions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<div class="col-10 col-lg-8">
<div class="experience-entry-heading">
<!-- For multiple positions, give emphasis on the company name-->
<h5>{{ if .company.url }}<a href={{.company.url}}>{{ .company.name }}</a>{{ else }}{{ .company.name }}{{ end }}</h5>

<!-- Total experience duration on a company is time between the starting date of the oldest position and ending date of most recent position -->
{{ $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 }},
{{ .company.location }}
</p>
<!-- Add company overview -->
<p>{{ .company.overview | markdownify }}</p>
</div>
<!-- Add the positions information -->
<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>
<!-- Add the responsibilities handled at this position -->
<ul class="justify-content-around">
{{ range $position.responsibilities }}
<li>{{ . | markdownify }}</li>
{{ end }}
</ul>
{{ end }}
</div>
</div>
21 changes: 21 additions & 0 deletions layouts/partials/experiences/single-position.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<div class="col-10 col-lg-8">
<div class="experience-entry-heading">
{{ $position:= index .positions 0 }}
<!-- For single position, give emphasis on the designation-->
<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 }},
{{ .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>
<ul class="justify-content-around">
{{ range $position.responsibilities }}
<li>{{ . | markdownify }}</li>
{{ end }}
</ul>
</div>
14 changes: 9 additions & 5 deletions static/assets/css/experiences.css
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
#experiences {
.experiences-section {
padding-bottom: 1rem;
}

#experiences .timeline {
.experiences-section .timeline {
margin-top: 1.5rem !important;
}

#experiences ul {
.experiences-section ul {
padding-left: 1rem;
}

#experiences ul > li {
.experiences-section ul > li {
margin-left: 0;
color: #3c4858;
}

.experiences-section .designation{
font-weight: 600;
}

.circle {
padding: 13px 20px;
border-radius: 50%;
Expand Down Expand Up @@ -152,4 +156,4 @@
left: 64%;
top: -50%;
}
}
}

0 comments on commit 440f424

Please sign in to comment.