Skip to content

Commit

Permalink
feat: add fallback for old portfolio structure
Browse files Browse the repository at this point in the history
  • Loading branch information
lxndrblz committed Jan 28, 2023
1 parent b61fcb8 commit 5bd3ff3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 2 additions & 3 deletions exampleSite/data/portfolio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ portfolioitems:
portfolioitem:
- name: Project 1
image: '/images/portfolio/code.jpg'
links:
- url: https://gohugo.io/
text: 'Visit project website'
link: https://gohugo.io/
linktext: 'Visit project website'
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'
tags:
- Tag 1
Expand Down
8 changes: 6 additions & 2 deletions layouts/portfolio/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,13 @@ <h2>{{ .name | markdownify }}</h2>
{{ end }}
</ul>
<p>{{ .description | markdownify }}</p>
{{ if .links }}
{{ if or .links .link }}
{{ $links := .links }}
{{ if .link }}
{{ $links = $links | append (dict "url" .link "text" .linktext) }}
{{ end }}
<div class="portfolio__button-wrapper">
{{ range $link :=.links}}
{{ range $link := $links}}
<a class="portfolio__button" href="{{ .url | safeURL }}" target="_blank" rel="noopener">
{{- if .icon -}}
<i class="{{ .icon }} fa-2x" aria-hidden="true"></i>
Expand Down

0 comments on commit 5bd3ff3

Please sign in to comment.