Skip to content

Commit

Permalink
Merge pull request #128 from zetxek/breadcrumbs-experience
Browse files Browse the repository at this point in the history
Simplify logic (breadcrumbs, experience)
  • Loading branch information
zetxek authored Dec 25, 2023
2 parents ea2535a + 48f042e commit 80262ab
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 61 deletions.
1 change: 1 addition & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ theme = "adritian"

sections = ["showcase", "about", "education", "experience", "contact"]
googleTagManagerID = "GTM-NVN2BJG" # Google Analytics works with Google Tag Manager
homepageExperienceCount = 6

[params.logo]
text1 = "Adrián"
Expand Down
2 changes: 1 addition & 1 deletion layouts/book/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</head>

<body>
{{ partial "header.html" . }} {{ partial "breadcrumb.html" . }}
{{ partial "header.html" . }}

<section
id="books"
Expand Down
2 changes: 1 addition & 1 deletion layouts/book/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</head>

<body>
{{ partial "header.html" . }} {{ partial "breadcrumb.html" . }}
{{ partial "header.html" . }}

<section
id="book"
Expand Down
2 changes: 1 addition & 1 deletion layouts/public-speaking/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</head>

<body>
{{ partial "header.html" . }} {{ partial "breadcrumb.html" . }}
{{ partial "header.html" . }}

<section
id="books"
Expand Down
1 change: 1 addition & 0 deletions themes/adritian/assets/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ html body ::selection{

#breadcrumb-bar{
position: relative;
padding-left: 40px;
padding-top: 120px;
}

Expand Down
48 changes: 10 additions & 38 deletions themes/adritian/layouts/experience/list.html
Original file line number Diff line number Diff line change
@@ -1,46 +1,18 @@
<!-- inject:../components/baseHead/baseHeadStart.html -->
<!DOCTYPE html>
<html lang="en">
<head>
{{ partial "head.html" . }} {{ partial "head_custom.html" . }}
</head>

<body>
{{ partial "header.html" . }} {{ partial "breadcrumb.html" . }}
<head>
{{ partial "head.html" . }} {{ partial "head_custom.html" . }}
</head>

<section
id="experience"
class="section section--border-bottom rad-animation-group"
>
<div class="container">
<div class="row flex-column-reverse flex-md-row rad-fade-down">
<div class="col-12 col-md-5 mt-5 mt-sm-0">
{{ range where .Site.RegularPages.ByDate.Reverse "Type" "experience" }}
<body>
{{ partial "header.html" . }}

<div class="experience">
<a href="{{.Permalink}}">
{{/* The context, ".", is now each one of the pages as it goes
through the loop */}}
<div class="experience__date">{{ .Params.duration }}</div>
<div class="experience__title">{{ .Params.title }}</div>
<div class="experience__company">
{{ .Params.company }}.
<span class="experience__location"
>{{ .Params.location }}</span
>
</div>
</a>
</div>
{{ end }}
</div>
<div class="col-12 col-md-7 mt-7 mt-sm-0">
{{ partial "experience-description.html" . }}
</div>
</div>
</div>
</section>
{{ partial "experience.html" . }}

{{ partial "footer.html" . }} {{ partial "base-foot.html" . }}
</body>

{{ partial "footer.html" . }} {{ partial "base-foot.html" . }}
</body>
</html>
<!-- endinject -->
<!-- endinject -->
2 changes: 1 addition & 1 deletion themes/adritian/layouts/experience/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</head>

<body>
{{ partial "header.html" . }} {{ partial "breadcrumb.html" . }}
{{ partial "header.html" . }}

<section
id="experience"
Expand Down
4 changes: 1 addition & 3 deletions themes/adritian/layouts/partials/breadcrumb.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<section id="breadcrumb-bar" class="breadcrumb-bar">
<div class="container">
<section id="breadcrumb-bar" class="breadcrumb-bar container">
<ul class="breadcrumbs">
<li class="breadcrum-item"><span><a href="{{ relURL "" }}">Home</a></span></li>
{{- $.Scratch.Set "url" "" -}}
Expand All @@ -24,5 +23,4 @@
{{- end -}}
{{- end -}}
</ul>
</div>
</section>
42 changes: 27 additions & 15 deletions themes/adritian/layouts/partials/experience.html
Original file line number Diff line number Diff line change
@@ -1,32 +1,44 @@
{{ if .Site.Data.homepage.experience.enable }}
<section id="experience" class="section section--border-bottom rad-animation-group">
<section id="experience" class="section-experience section section--border-bottom rad-animation-group">
<div class="container">
<div class="row flex-column-reverse flex-md-row rad-fade-down">
<div class="col-12 cold-md-12 col-sm-6 mt-5 mt-sm-0">
{{ $xp := (where .Site.RegularPages.ByDate.Reverse "Type" "experience") }}
{{ $xpCount := len $xp }}
{{/* in the homepage we limit to the homepageExperienceCount param (6 by default) in the inner page (experience) we display the all */}}
{{ $totalCount := .Site.Params.homepageExperienceCount }}

{{ if not .IsHome }}
{{ $totalCount = len $xp }}
{{ end }}
{{ range first 6 $xp }}
<div class="experience">
<div class="experience__date">{{ .Params.duration }}</div>
<div class="experience__title">{{ .Params.jobTitle }}</div>
<div class="experience__company">{{ .Params.company }}. <span class="experience__location">{{ .Params.location }}</span></div>
<a href="{{.Permalink}}">
{{/* The context, ".", is now each one of the pages as it goes
through the loop */}}
<div class="experience__date">{{ .Params.duration }}</div>
<div class="experience__title">{{ .Params.jobTitle }}</div>
<div class="experience__company">{{ .Params.company }}. <span class="experience__location">{{
.Params.location }}</span></div>
</a>
</div>
{{ end }}
{{ if gt $xpCount 6 }}
<div class="all-experience-container">
{{ $xpExtra := sub $xpCount 6 }}
<em>And {{ $xpExtra }} more</em><br/>
<a href="{{ absURL "experience" }} " title="See additional {{ $xpExtra }} experience items" class="btn btn-primary btn-all-experience">
<i class="{{ .Site.Data.homepage.experience.button3.icon }}"></i>
{{ .Site.Data.homepage.experience.button3.btnText }}
</a>
</div>
{{ if gt $xpCount $totalCount }}
<div class="all-experience-container">
{{ $xpExtra := sub $xpCount $totalCount }}
<em>And {{ $xpExtra }} more</em><br />
<a href="{{ absURL "experience" }} " title=" See additional {{ $xpExtra }} experience items"
class="btn btn-primary btn-all-experience">
<i class="{{ .Site.Data.homepage.experience.button3.icon }}"></i>
{{ .Site.Data.homepage.experience.button3.btnText }}
</a>
</div>
{{ end }}
</div>
<div class="col-12 col-md-6">
{{ partial "experience-description.html" . }}
{{ partial "experience-description.html" . }}
</div>
</div>
</div>
</section>
{{ end }}
{{ end }}
4 changes: 4 additions & 0 deletions themes/adritian/layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@
</nav>
</div>
</header>

{{ if not .IsHome }}
{{ partial "breadcrumb.html" . }}
{{ end }}
2 changes: 1 addition & 1 deletion themes/adritian/layouts/partials/showcase.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ if .Site.Data.homepage.showcase.enable }}
<section class="rad-showcase rad-showcase--index rad-animation-group rad-fade-down">
<div class="container">
<div class="row">
<div class="row flex-column-reverse flex-md-row rad-fade-down rad-waiting rad-animate">
<div class="col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6">
<h1 class="display-1">
{{ .Site.Data.homepage.showcase.title }}
Expand Down

1 comment on commit 80262ab

@vercel
Copy link

@vercel vercel bot commented on 80262ab Dec 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.