Browse Source

about widget: Support organization link (#108)

* Add optional `organization_url` to config
George Cushen 8 years ago
parent
commit
b7b20820e6
2 changed files with 9 additions and 2 deletions
  1. 2 1
      exampleSite/config.toml
  2. 7 1
      layouts/partials/widgets/about.html

+ 2 - 1
exampleSite/config.toml

@@ -1,5 +1,5 @@
 baseurl = "https://example.com"
-title = "Academic Theme"
+title = "Academic"
 copyright = "© 2016 Your Name"
 theme = "academic"
 enableEmoji = true
@@ -22,6 +22,7 @@ defaultContentLanguageInSubdir = false
   name = "Lena Smith"
   role = "Professor of Artificial Intelligence"
   organization = "Stanford University"
+  organization_url = ""
   avatar = "portrait.jpg"
   email = "test@example.org"
   address = "Building 1 Room 1, Stanford University, California, 90210, USA"

+ 7 - 1
layouts/partials/widgets/about.html

@@ -15,7 +15,13 @@
       <div class="portrait-title">
         <h2 itemprop="name">{{ $.Site.Params.name }}</h2>
         <h3 itemprop="jobTitle">{{ $.Site.Params.role }}</h3>
-        {{ with $.Site.Params.organization }}<h3 itemprop="worksFor">{{ . }}</h3>{{ end }}
+        {{ if $.Site.Params.organization }}
+        <h3 itemprop="worksFor">
+          {{ with $.Site.Params.organization_url }}<a href="{{ . }}" target="_blank">{{ end }}
+          {{ $.Site.Params.organization }}
+          {{ if $.Site.Params.organization_url }}</a>{{ end }}
+        </h3>
+        {{ end }}
       </div>
 
       <ul class="social-icon" aria-hidden="true">