diff --git a/exampleSite/content/authors/吳恩達/_index.md b/exampleSite/content/authors/吳恩達/_index.md new file mode 100644 index 00000000..aff78130 --- /dev/null +++ b/exampleSite/content/authors/吳恩達/_index.md @@ -0,0 +1,75 @@ +--- +# Display name +title: 吳恩達 + +# Username (this should match the folder name) +authors: +- 吳恩達 + +# Is this the primary user of the site? +superuser: false + +# Role/position +role: Professor of Artificial Intelligence + +# Organizations/Affiliations +organizations: +- name: Stanford University + url: "" + +# Short bio (displayed in user profile at end of posts) +bio: My research interests include distributed robotics, mobile computing and programmable matter. + +interests: +- Artificial Intelligence +- Computational Linguistics +- Information Retrieval + +education: + courses: + - course: PhD in Artificial Intelligence + institution: Stanford University + year: 2012 + - course: MEng in Artificial Intelligence + institution: Massachusetts Institute of Technology + year: 2009 + - course: BSc in Artificial Intelligence + institution: Massachusetts Institute of Technology + year: 2008 + +# Social/Academic Networking +# For available icons, see: https://sourcethemes.com/academic/docs/page-builder/#icons +# For an email link, use "fas" icon pack, "envelope" icon, and a link in the +# form "mailto:your-email@example.com" or "#contact" for contact widget. +social: +- icon: envelope + icon_pack: fas + link: '#contact' # For a direct email link, use "mailto:test@example.org". +- icon: twitter + icon_pack: fab + link: https://twitter.com/GeorgeCushen +- icon: google-scholar + icon_pack: ai + link: https://scholar.google.co.uk/citations?user=sIwtMXoAAAAJ +- icon: github + icon_pack: fab + link: https://github.com/gcushen +# Link to a PDF of your resume/CV from the About widget. +# To enable, copy your resume/CV to `static/files/cv.pdf` and uncomment the lines below. +# - icon: cv +# icon_pack: ai +# link: files/cv.pdf + +# Enter email to display Gravatar (if Gravatar enabled in Config) +email: "" + +# Organizational groups that you belong to (for People widget) +# Set this to `[]` or comment out if you are not using People widget. +user_groups: +- Researchers +- Visitors +--- + +吳恩達 is a professor of artificial intelligence at the Stanford AI Lab. His research interests include distributed robotics, mobile computing and programmable matter. He leads the Robotic Neurobiology group, which develops self-reconfiguring robots, systems of self-organizing robots, and mobile sensor networks. + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed neque elit, tristique placerat feugiat ac, facilisis vitae arcu. Proin eget egestas augue. Praesent ut sem nec arcu pellentesque aliquet. Duis dapibus diam vel metus tempus vulputate. diff --git a/exampleSite/content/authors/吳恩達/avatar.jpg b/exampleSite/content/authors/吳恩達/avatar.jpg new file mode 100644 index 00000000..d1361fd8 Binary files /dev/null and b/exampleSite/content/authors/吳恩達/avatar.jpg differ diff --git a/exampleSite/content/post/getting-started/index.md b/exampleSite/content/post/getting-started/index.md index 69ffcccf..069bf4cf 100644 --- a/exampleSite/content/post/getting-started/index.md +++ b/exampleSite/content/post/getting-started/index.md @@ -4,10 +4,13 @@ subtitle: 'Create a beautifully simple website in under 10 minutes :rocket:' summary: Create a beautifully simple website in under 10 minutes. authors: - admin +- 吳恩達 tags: - Academic +- 开源 categories: - Demo +- 教程 date: "2016-04-20T00:00:00Z" lastmod: "2019-04-17T00:00:00Z" featured: false diff --git a/layouts/partials/page_metadata.html b/layouts/partials/page_metadata.html index 3d6812ed..e6143141 100644 --- a/layouts/partials/page_metadata.html +++ b/layouts/partials/page_metadata.html @@ -53,13 +53,13 @@ {{ end}} {{ $taxonomy := "categories" }} - {{ with $page.Param $taxonomy }} + {{ if $page.Param $taxonomy }} - {{- range $index, $value := . -}} + {{- range $index, $value := ($page.GetTerms $taxonomy) -}} {{- if gt $index 0 }}, {{ end -}} - {{ . }} + {{ .LinkTitle }} {{- end -}} {{ end }} diff --git a/layouts/partials/page_metadata_authors.html b/layouts/partials/page_metadata_authors.html index 2d7a48b3..437e1653 100644 --- a/layouts/partials/page_metadata_authors.html +++ b/layouts/partials/page_metadata_authors.html @@ -1,17 +1,18 @@ {{/* Display author list. */}} {{- $taxonomy := "authors" }} -{{ with .Param $taxonomy }} +{{ if .Param $taxonomy }} {{ $link_authors := site.Params.link_authors | default true }} - {{ range $index, $value := . }} - {{- $profile_page := site.GetPage (printf "/%s/%s" $taxonomy (. | urlize)) -}} - {{- $name := $profile_page.Title | default ($value|markdownify) -}} + {{ range $index, $value := (.GetTerms $taxonomy) }} + {{- /* Check if a profile was created for this user. */ -}} + {{- $profile_page := isset .Page.Params "superuser" -}} + {{- if gt $index 0 }}, {{ end -}} {{- if and $profile_page $link_authors -}} - {{$name}} + {{ .LinkTitle }} {{- else -}} - {{$name}} + {{ .LinkTitle }} {{- end -}} {{- end -}} diff --git a/layouts/partials/tags.html b/layouts/partials/tags.html index 721c1197..bcc81619 100644 --- a/layouts/partials/tags.html +++ b/layouts/partials/tags.html @@ -1,8 +1,8 @@ {{ $taxonomy := "tags" }} -{{ with .Param $taxonomy }} +{{ if .Param $taxonomy }}
{{ end }} diff --git a/layouts/partials/widgets/about.html b/layouts/partials/widgets/about.html index 8f944255..94d9943e 100644 --- a/layouts/partials/widgets/about.html +++ b/layouts/partials/widgets/about.html @@ -8,7 +8,7 @@ {{ $author = $page.Params.author }} {{end}} -{{ $person_page_path := (printf "/authors/%s" (urlize $author)) }} +{{ $person_page_path := (printf "/authors/%s" $author) }} {{ $person_page := site.GetPage $person_page_path }} {{ if not $person_page }} {{ errorf "Could not find an author page at `%s`. Please check the value of `author` in your About widget and create an associated author page if one does not already exist. See https://sourcethemes.com/academic/docs/page-builder/#about " $person_page_path }} diff --git a/theme.toml b/theme.toml index a0df2a5b..6821fee6 100644 --- a/theme.toml +++ b/theme.toml @@ -3,7 +3,7 @@ license = "MIT" licenselink = "https://github.com/gcushen/hugo-academic/blob/master/LICENSE.md" description = "The website builder for Hugo. Build *anything* with widgets and deploy with one click! Fully personalize your site with themes, plugins, and language packs." homepage = "https://sourcethemes.com/academic/" -min_version = "0.62" +min_version = "0.65" tags = ["widgets", "resume", "portfolio",