Browse Source

feat(widget): show brand logo in Experience + Accomplishments

To use, add SVG brand logo in lowercase to your `assets/media/icons/brands/` folder

BREAKING CHANGE:

Rename `assets/media/icon-pack/` to `assets/media/icons/`

Close #2259
Close #1781
George Cushen 4 years ago
parent
commit
153cf5b780

File diff suppressed because it is too large
+ 0 - 0
wowchemy/assets/media/icons/brands/coursera.svg


+ 1 - 0
wowchemy/assets/media/icons/brands/datacamp.svg

@@ -0,0 +1 @@
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 34" height="56" width="56"><path d="M14.001 25.028v-7.224l11.393-6.498-2.77-1.588-8.623 4.918V7.391c0-.491-.265-.95-.69-1.194L2.938.245a1.974 1.974 0 00-2.006.06A1.98 1.98 0 000 1.992v20.375c0 .69.35 1.321.934 1.687a1.973 1.973 0 002.002.061l8.317-4.743v6.457c0 .494.266.952.695 1.196l10.658 6.067 2.771-1.589-11.376-6.475zm-2.748-16.84v8.016l-8.504 4.85V3.31l8.504 4.88z" fill="#03EF62" fill-rule="evenodd"></path></svg>

+ 36 - 0
wowchemy/assets/media/icons/brands/edx.svg

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0 0 552.88 310.72" style="enable-background:new 0 0 552.88 310.72;" xml:space="preserve">
+<style type="text/css">
+	.st0{fill:#02262B;}
+	.st1{fill:#FFFFFF;}
+</style>
+<polygon class="st0" points="353.43,50.96 364.08,0 51.3,0 0,245.01 261.52,245.01 247.12,310.72 497.63,310.72 552.88,50.96 "/>
+<path class="st1" d="M106.6,213.73c-7.09,0-13.79-1.16-20.09-3.49c-6.3-2.32-11.8-5.75-16.49-10.28
+	c-4.69-4.53-8.39-10.1-11.11-16.72c-2.72-6.62-4.08-14.22-4.08-22.81c0-11.74,1.63-22.44,4.9-32.09
+	c3.27-9.65,7.82-17.92,13.65-24.82c5.83-6.89,12.82-12.23,20.98-16.01c8.15-3.78,17.08-5.67,26.77-5.67
+	c6.54,0,12.74,1.14,18.62,3.43c5.87,2.29,11.01,5.61,15.42,9.99c4.41,4.37,7.92,9.75,10.52,16.13c2.6,6.38,3.9,13.71,3.9,21.98
+	c0,1.26-0.04,2.74-0.12,4.43c-0.08,1.7-0.2,3.43-0.36,5.2c-0.16,1.77-0.32,3.51-0.47,5.2c-0.16,1.69-0.35,3.13-0.59,4.31H76.22
+	c-0.08,1.11-0.14,2.17-0.18,3.19c-0.04,1.03-0.06,2.09-0.06,3.19c0,6.54,0.95,12.11,2.84,16.72c1.89,4.61,4.35,8.37,7.39,11.29
+	c3.03,2.92,6.44,5.02,10.22,6.32c3.78,1.3,7.6,1.95,11.46,1.95c8.43,0,15.21-1.46,20.33-4.37c5.12-2.91,9.02-6.85,11.7-11.82h21.63
+	c-1.34,4.89-3.55,9.46-6.62,13.71c-3.07,4.25-6.95,7.94-11.64,11.05c-4.69,3.11-10.13,5.56-16.31,7.33
+	C120.8,212.84,114,213.73,106.6,213.73z M148.08,136.08c0.08-0.39,0.14-1.12,0.18-2.19c0.04-1.06,0.06-2.11,0.06-3.13
+	c0-4.18-0.61-8.14-1.83-11.88c-1.22-3.74-3.05-7.03-5.5-9.87c-2.44-2.84-5.48-5.08-9.1-6.74c-3.63-1.65-7.84-2.48-12.65-2.48
+	c-4.89,0-9.46,0.87-13.71,2.6c-4.26,1.73-8.12,4.2-11.58,7.39c-3.47,3.19-6.46,7.01-8.98,11.46c-2.52,4.45-4.53,9.4-6.03,14.83
+	H148.08z"/>
+<path class="st1" d="M227.58,213.73c-6.38,0-12.37-1.2-17.97-3.61c-5.6-2.4-10.5-5.85-14.71-10.34c-4.22-4.49-7.55-9.93-9.99-16.31
+	c-2.44-6.38-3.66-13.51-3.66-21.39c0-7.64,0.77-14.95,2.3-21.92s3.72-13.43,6.56-19.38c2.84-5.95,6.24-11.33,10.22-16.13
+	c3.98-4.81,8.39-8.9,13.24-12.29c4.85-3.39,10.08-5.99,15.72-7.8c5.63-1.81,11.52-2.72,17.67-2.72c4.57,0,8.92,0.63,13.06,1.89
+	c4.14,1.26,7.88,3.01,11.23,5.26c3.35,2.25,6.22,4.96,8.63,8.15c2.4,3.19,4.16,6.68,5.26,10.46h1.89l15.72-74.11h20.68l-37.82,178
+	h-19.62l3.66-17.37h-1.89c-4.65,6.07-10.48,10.85-17.49,14.36C243.26,211.97,235.69,213.73,227.58,213.73z M234.08,195.41
+	c6.62,0,12.74-1.55,18.38-4.67c5.63-3.11,10.54-7.37,14.71-12.76c4.18-5.4,7.45-11.74,9.81-19.03c2.36-7.29,3.55-15.15,3.55-23.58
+	c0-5.44-0.75-10.32-2.25-14.66c-1.5-4.33-3.63-8.02-6.38-11.05c-2.76-3.03-6.11-5.38-10.05-7.03c-3.94-1.66-8.39-2.48-13.36-2.48
+	c-6.54,0-12.61,1.46-18.2,4.37c-5.6,2.92-10.44,6.97-14.54,12.17c-4.1,5.2-7.33,11.41-9.69,18.61s-3.55,15.11-3.55,23.7
+	c0,5.36,0.77,10.28,2.31,14.77c1.54,4.49,3.68,8.33,6.44,11.52c2.76,3.19,6.07,5.67,9.93,7.45
+	C225.05,194.52,229.35,195.41,234.08,195.41z"/>
+<g>
+	<polygon class="st1" points="508.94,84.45 462.81,84.45 412.49,146.75 410.01,146.75 383.4,84.45 336.74,84.45 376.74,174.94
+		290.39,277.23 335.9,277.23 391.32,211.52 395.06,211.52 425,277.23 470.79,277.23 426.51,179.47 	"/>
+</g>
+</svg>

+ 1 - 1
wowchemy/layouts/partials/book_menu.html

@@ -24,7 +24,7 @@
       {{- if eq $pack "emoji" -}}
         {{- . | emojify -}}
       {{- else if eq $pack "custom" -}}
-        {{- $svg_icon := resources.Get (printf "media/icon-pack/%s.svg" .) -}}
+        {{- $svg_icon := resources.Get (printf "media/icons/%s.svg" .) -}}
         {{- if $svg_icon -}}
           {{ $icon = printf "<img src=\"%s\" alt=\"%s\" class=\"svg-icon svg-baseline pr-1\">" $svg_icon.RelPermalink . }}
         {{- end -}}

+ 28 - 12
wowchemy/layouts/partials/widgets/accomplishments.html

@@ -10,22 +10,38 @@
   {{ range $idx, $key := sort $page.Params.item ".date_start" "desc" }}
     <div class="card experience course">
       <div class="card-body">
-        {{- with .url -}}<a href="{{.}}" target="_blank" rel="noopener">{{- end -}}
-        <div class="section-subheading card-title exp-title text-muted my-0">{{.title | markdownify | emojify}}</div>
-        {{- with .url -}}</a>{{- end -}}
+        {{- $svg_icon := resources.Get (printf "media/icons/brands/%s.svg" (replace (lower .organization) " " "_")) -}}
+        {{- if $svg_icon }}
+        <div class="d-flex align-content-start">
+          <div class="mr-2 mb-2">
+            {{- with .organization_url}}<a href="{{.}}" target="_blank" rel="noopener">{{end -}}
+            <img src="{{ $svg_icon.RelPermalink }}" width="56px" height="56px" alt="{{.organization | plainify}}">
+            {{- with .organization_url}}</a>{{end -}}
+          </div>
+          <div>
+        {{ end }}
+
+            {{- with .url -}}<a href="{{.}}" target="_blank" rel="noopener">{{- end -}}
+            <div class="section-subheading card-title exp-title text-muted my-0">{{.title | markdownify | emojify}}</div>
+            {{- with .url -}}</a>{{- end -}}
 
-        <div class="card-subtitle my-0 article-metadata">
-          {{- with .organization_url}}<a href="{{.}}" target="_blank" rel="noopener">{{end -}}
-          {{- .organization | markdownify | emojify -}}
-          {{- with .organization_url}}</a>{{end -}}
+            <div class="card-subtitle my-0 article-metadata">
+              {{- with .organization_url}}<a href="{{.}}" target="_blank" rel="noopener">{{end -}}
+              {{- .organization | markdownify | emojify -}}
+              {{- with .organization_url}}</a>{{end -}}
 
-          <span class="middot-divider"></span>
+              <span class="middot-divider"></span>
 
-          {{ (time .date_start).Format ($page.Params.date_format | default "Jan 2006") }}
-          {{ if .date_end}}
-          – {{ (time .date_end).Format ($page.Params.date_format | default "Jan 2006") }}
-          {{end}}
+              {{ (time .date_start).Format ($page.Params.date_format | default "Jan 2006") }}
+              {{ if .date_end}}
+              – {{ (time .date_end).Format ($page.Params.date_format | default "Jan 2006") }}
+              {{end}}
+            </div>
+
+        {{- if $svg_icon}}
+          </div>
         </div>
+        {{end}}
 
         {{with .description}}
           <div class="card-text">{{. | markdownify | emojify}}</div>

+ 33 - 15
wowchemy/layouts/partials/widgets/experience.html

@@ -28,22 +28,40 @@
     <div class="col py-2">
       <div class="card">
         <div class="card-body">
-          <div class="section-subheading card-title exp-title text-muted mt-0 mb-1">{{.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).Format ($page.Params.date_format | default "January 2006") }} –
-            {{ if .date_end}}
-              {{ (time .date_end).Format ($page.Params.date_format | default "January 2006") }}
-            {{else}}
-              {{ i18n "present" | default "Present" }}
-            {{end}}
-            {{with .location}}
-              <span class="middot-divider"></span>
-              <span>{{.}}</span>
-            {{end}}
+
+          {{- if .company_logo}}
+          <div class="d-flex align-content-start">
+            <div class="mr-2 mb-2">
+              {{- $svg_icon := resources.Get (printf "media/icons/brands/%s.svg" .company_logo) -}}
+              {{- with .company_url}}<a href="{{.}}" target="_blank" rel="noopener">{{end -}}
+              <img src="{{ $svg_icon.RelPermalink }}" width="56px" height="56px" alt="{{.company | plainify}}">
+              {{- 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).Format ($page.Params.date_format | default "January 2006") }} –
+                {{ if .date_end}}
+                  {{ (time .date_end).Format ($page.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>

+ 1 - 1
wowchemy/layouts/partials/widgets/featurette.html

@@ -27,7 +27,7 @@
       {{- if eq $pack "emoji" -}}
         {{- . | emojify -}}
       {{- else if eq $pack "custom" -}}
-        {{- $svg_icon := resources.Get (printf "media/icon-pack/%s.svg" .) -}}
+        {{- $svg_icon := resources.Get (printf "media/icons/%s.svg" .) -}}
         {{- if $svg_icon -}}<img src="{{ $svg_icon.RelPermalink }}" alt="{{.}}" class="svg-icon svg-baseline">{{- end -}}
       {{- else -}}
         <i class="{{ $pack }} {{ $pack_prefix }}-{{ . }}"></i>

Some files were not shown because too many files changed in this diff