mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-13 22:15:11 +00:00
feat: migrate more blocks to v2 block system
This commit is contained in:
1 parent
712c955024
commit
7a3d11a2a5
8 files changed
+134
-8
No files matched your search
@@ -129,3 +129,43 @@ ul.ul-edu li .description p.institution {
|
||||
background-color: #000;
|
||||
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.04), 0 2px 6px rgba(0, 0, 0, 0.04), 0 0 1px rgba(255, 255, 255, 0.96);
|
||||
}
|
||||
|
||||
// ABOUT.AVATAR BLOCK STYLE (overrides ABOUT block styles)
|
||||
.wg-about-avatar {
|
||||
// Custom avatar size on homepage
|
||||
.avatar {
|
||||
width: auto;
|
||||
height: auto;
|
||||
max-width: 225px;
|
||||
max-height: 225px;
|
||||
}
|
||||
|
||||
#profile .network-icon {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
ul.network-icon .big-icon {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.network-icon li {
|
||||
@include media-breakpoint-down(sm) {
|
||||
/* Min 48px Lighthouse tap targets on mobile */
|
||||
margin-right: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.dark .portrait-title h3 {
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.dark .portrait-title h2 {
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.bio-text {
|
||||
max-width: 680px;
|
||||
}
|
||||
}
|
||||
@@ -82,9 +82,11 @@
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
||||
{{ with $block.Content | default ($block.content.text | emojify | markdownify) }}
|
||||
<div class="article-style pt-1">
|
||||
{{ . }}
|
||||
{{ with ($block.content.text | emojify | markdownify) | default $person_page.Content }}
|
||||
<div class="article-style pt-2 d-flex justify-content-center">
|
||||
<div class="bio-text">
|
||||
{{ . }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
|
||||
<div class="col-12 {{if eq $columns "2"}}col-lg-8{{end}}">
|
||||
|
||||
{{ with $block.content.text }}{{ . }}{{ end }}
|
||||
{{ with $block.content.text }}{{ . | emojify | markdownify }}{{ end }}
|
||||
|
||||
{{ range $index, $item := $query }}
|
||||
{{ partial "functions/render_view" (dict "page" $block "item" . "view" ($block.design.view | default "compact") "index" $index) }}
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
{{/* Wowchemy Blocks: Experience */}}
|
||||
{{/* Documentation: https://wowchemy.com/blocks/ */}}
|
||||
{{/* License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */}}
|
||||
|
||||
{{/* Initialise */}}
|
||||
{{ $page := .wcPage }}
|
||||
{{ $block := .wcBlock }}
|
||||
{{ $columns := $block.design.columns | default "1" }}
|
||||
|
||||
<!-- Experience widget -->
|
||||
<div class="col-12 {{if eq $columns "2"}}col-lg-8{{end}}">
|
||||
{{ with $block.content.text }}{{ . | emojify | markdownify }}{{ end }}
|
||||
|
||||
{{ if $block.content.items }}
|
||||
{{ $exp_len := len $block.content.items }}
|
||||
|
||||
{{/* Default to user's custom order (as requested in #1761) as Hugo doesn't support multiple sorts on params. */}}
|
||||
{{ range $idx, $key := $block.content.items }}
|
||||
<div class="row experience">
|
||||
<!-- Timeline -->
|
||||
<div class="col-auto text-center flex-column d-none d-sm-flex">
|
||||
<div class="row h-50">
|
||||
<div class="col {{if gt $idx 0}}border-right{{end}}"> </div>
|
||||
<div class="col"> </div>
|
||||
</div>
|
||||
<div class="m-2">
|
||||
<span class="badge badge-pill border {{if not .date_end}}exp-fill{{end}}"> </span>
|
||||
</div>
|
||||
<div class="row h-50">
|
||||
<div class="col {{if lt $idx (sub $exp_len 1)}}border-right{{end}}"> </div>
|
||||
<div class="col"> </div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Content -->
|
||||
<div class="col py-2">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
{{- if .company_logo}}
|
||||
{{- $svg_icon := resources.Get (printf "media/icons/brands/%s.svg" .company_logo) -}}
|
||||
{{ if not $svg_icon }}{{ errorf "Brand logo not found at `assets/media/icons/brands/%s.svg`" .company_logo }}{{end}}
|
||||
<div class="d-flex align-content-start">
|
||||
<div class="mr-2 mb-2">
|
||||
{{- with .company_url}}<a href="{{.}}" target="_blank" rel="noopener">{{end -}}
|
||||
<img src="{{ $svg_icon.RelPermalink }}" width="56px" height="56px" alt="{{.company | plainify}}" loading="lazy">
|
||||
{{- with .company_url}}</a>{{end -}}
|
||||
</div>
|
||||
<div>
|
||||
{{ end }}
|
||||
|
||||
<div class="section-subheading card-title exp-title text-muted my-0">{{.title | markdownify | emojify}}</div>
|
||||
<div class="section-subheading card-title exp-company text-muted my-0">
|
||||
{{- with .company_url}}<a href="{{.}}" target="_blank" rel="noopener">{{end}}{{.company | markdownify | emojify}}{{with .company_url}}</a>{{end -}}
|
||||
</div>
|
||||
<div class="text-muted exp-meta">
|
||||
{{ (time .date_start) | time.Format ($block.Params.date_format | default "January 2006") }} –
|
||||
{{ if .date_end}}
|
||||
{{ (time .date_end) | time.Format ($block.Params.date_format | default "January 2006") }}
|
||||
{{else}}
|
||||
{{ i18n "present" | default "Present" }}
|
||||
{{end}}
|
||||
{{with .location}}
|
||||
<span class="middot-divider"></span>
|
||||
<span>{{.}}</span>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{- if .company_logo}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{with .description}}<div class="card-text">{{. | markdownify | emojify}}</div>{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
@@ -5,7 +5,7 @@
|
||||
{{/* Initialise */}}
|
||||
{{ $page := .wcPage }}
|
||||
{{ $block := .wcBlock }}
|
||||
{{ $columns := $block.design.columns | default "2" }}
|
||||
{{ $columns := $block.design.columns | default "1" }}
|
||||
{{ $text := $block.content.text | emojify | markdownify }}
|
||||
|
||||
{{ if ne $columns "1" }}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
{{ $tags := first $items_count (index site.Taxonomies $taxonomy).ByCount }}
|
||||
{{ $count := len $tags }}
|
||||
|
||||
{{ $columns := $block.design.columns | default "2" }}
|
||||
{{ $columns := $block.design.columns | default "1" }}
|
||||
|
||||
<div class="col-12 {{if eq $columns "2"}}col-lg-8{{else}}text-center{{end}}">
|
||||
{{ with $block.content.text }}{{ . | markdownify }}{{ end }}
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
{{ end }}
|
||||
|
||||
{{/* Fix Hugo's ContentBaseName returning wrong file base name when page section is within a bundle. */}}
|
||||
{{ $hash_id := $block.id | default (printf "section-%s" $block.block) }}
|
||||
{{ $hash_id := $block.id | default (printf "section-%s" (replace $block_type "." "-")) }}
|
||||
|
||||
{{ $widget_args := dict "wcPage" $page "wcBlock" $block "wcIdentifier" $hash_id }}
|
||||
{{ $css_classes := $block.design.css_class | default $block.Params.advanced.css_class | default "" }}
|
||||
|
||||
@@ -23,7 +23,11 @@
|
||||
{{ end }}
|
||||
|
||||
{{ $order := "" }}
|
||||
{{ if and ($widget.Params.design.flip_alt_rows | default true) (not (modBool $index 2)) }}
|
||||
{{ if isset $widget "Params" }}
|
||||
{{ if and ($widget.Params.design.flip_alt_rows | default true) (not (modBool $index 2)) }}
|
||||
{{ $order = "order-md-2" }}
|
||||
{{ end }}
|
||||
{{ else if and ($widget.design.flip_alt_rows | default true) (not (modBool $index 2)) }}
|
||||
{{ $order = "order-md-2" }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
Reference in new issue
Block a user