diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 9cbc5485..f52ea51b 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -82,16 +82,18 @@ googleAnalytics = "" # Navigation Links +# To link a homepage widget, specify the URL as a hash `#` followed by the filename of the +# desired widget in your `content/home/` folder. # The weight parameter defines the order that the links will appear in. [[menu.main]] name = "Home" - url = "#bio" + url = "#about" weight = 1 [[menu.main]] name = "Publications" - url = "#publications" + url = "#publications_selected" weight = 2 [[menu.main]] diff --git a/layouts/index.html b/layouts/index.html index 88c0d496..f2e33ee5 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -5,11 +5,14 @@ -{{ $pubs_selected_len := len (where (where .Data.Pages "Type" "publication") ".Params.selected" true) }} {{ range $index, $page := where .Data.Pages "Type" "home" }} - {{ $params := dict "root" $ "page" $page "pubs_selected_len" $pubs_selected_len }} + {{ $params := dict "root" $ "page" $page }} {{ $widget := printf "widgets/%s.html" ( or $page.Params.widget "custom" ) }} - {{ partial $widget $params }} +
+
+ {{ partial $widget $params }} +
+
{{ end }} diff --git a/layouts/partials/widgets/about.html b/layouts/partials/widgets/about.html index b3526662..2b28c47e 100644 --- a/layouts/partials/widgets/about.html +++ b/layouts/partials/widgets/about.html @@ -1,80 +1,70 @@ {{ $ := .root }} {{ $page := .page }} - -
-
+ +
+
+ + {{ $page.Content }} + +
+ + {{ with $page.Params.interests }} +
+

{{ .title | default "Interests" | markdownify }}

+
    + {{ range .interests }} +
  • {{ . }}
  • + {{ end }} +
+
+ {{ end }} + + {{ with $page.Params.education }} +
+

{{ .title | default "Education" | markdownify }}

+
    + {{ range .courses }} +
  • + +
    +

    {{ .course }}{{ with .year }}, {{ . }}{{ end }}

    +

    {{ .institution }}

    +
    +
  • + {{ end }} +
+
+ {{ end }} + +
+
+ diff --git a/layouts/partials/widgets/contact.html b/layouts/partials/widgets/contact.html index 29f7eada..f61abcaa 100644 --- a/layouts/partials/widgets/contact.html +++ b/layouts/partials/widgets/contact.html @@ -3,57 +3,51 @@ {{ $autolink := default true $page.Params.autolink }} -
-
+
+
+

{{ with $page.Title }}{{ . | markdownify }}{{ end }}

+ {{ with $page.Params.subtitle }}

{{ . | markdownify }}

{{ end }} +
+
+ {{ with $page.Content }}

{{ . | markdownify }}

{{ end }} -
-
-

{{ with $page.Title }}{{ . | markdownify }}{{ end }}

- {{ with $page.Params.subtitle }}

{{ . | markdownify }}

{{ end }} -
-
- {{ with $page.Content }}

{{ . | markdownify }}

{{ end }} +
    -
      + {{ with $.Site.Params.email }} +
    • + + + {{- if $autolink }}{{ . }}{{ else }}{{ . }}{{ end -}} + +
    • + {{ end }} - {{ with $.Site.Params.email }} -
    • - - - {{- if $autolink }}{{ . }}{{ else }}{{ . }}{{ end -}} - -
    • - {{ end }} + {{ with $.Site.Params.keybase }} +
    • + + + @{{ . }} on Keybase. + +
    • + {{ end }} - {{ with $.Site.Params.keybase }} -
    • - - - @{{ . }} on Keybase. - -
    • - {{ end }} + {{ with $.Site.Params.phone }} +
    • + + + {{- if $autolink }}{{ . }}{{ else }}{{ . }}{{ end -}} + +
    • + {{ end }} - {{ with $.Site.Params.phone }} -
    • - - - {{- if $autolink }}{{ . }}{{ else }}{{ . }}{{ end -}} - -
    • - {{ end }} + {{ with $.Site.Params.address }} +
    • + + {{ . }} +
    • + {{ end }} - {{ with $.Site.Params.address }} -
    • - - {{ . }} -
    • - {{ end }} - -
    - -
-
+
-
+ diff --git a/layouts/partials/widgets/custom.html b/layouts/partials/widgets/custom.html index 98273669..3bac3bb6 100644 --- a/layouts/partials/widgets/custom.html +++ b/layouts/partials/widgets/custom.html @@ -1,19 +1,12 @@ {{ $page := .page }} -{{ $title_words := split $page.Title " " }} -
-
-
-
-

{{ title $page.Title }}

- {{ with $page.Params.subtitle }}

{{ . | markdownify }}

{{ end }} -
-
- {{ $page.Content }} -
-
+
+
+

{{ title $page.Title }}

+ {{ with $page.Params.subtitle }}

{{ . | markdownify }}

{{ end }}
-
+
+ {{ $page.Content }} +
+ diff --git a/layouts/partials/widgets/posts.html b/layouts/partials/widgets/posts.html index 13a57a0c..581efb29 100644 --- a/layouts/partials/widgets/posts.html +++ b/layouts/partials/widgets/posts.html @@ -1,42 +1,38 @@ {{ $ := .root }} {{ $page := .page }} - {{ $posts_len := len (where (where $.Data.Pages "Type" "post") ".Params.notonhomepage" nil) }} -{{ if gt $posts_len 0 }} + -
-
+
+
-
-
-

{{ with $page.Title }}{{ . | markdownify }}{{ end }}

- {{ with $page.Params.subtitle }}

{{ . | markdownify }}

{{ end }} - {{ if gt $posts_len $page.Params.count }} -

- - {{ with $page.Params.str_all }}{{ . | markdownify }}{{ end }} - - -

- {{ end }} -
-
- {{ with $page.Content }}

{{ . | markdownify }}

{{ end }} +

{{ with $page.Title }}{{ . | markdownify }}{{ end }}

+ {{ with $page.Params.subtitle }}

{{ . | markdownify }}

{{ end }} + {{ if gt $posts_len $page.Params.count }} +

+ + {{ with $page.Params.str_all }}{{ . | markdownify }}{{ end }} + + +

+ {{ end }} - {{ if $page.Params.tags }} - {{ range first $page.Params.count (where (where (where $.Data.Pages "Type" "post") ".Params.tags" "intersect" $page.Params.tags) ".Params.notonhomepage" nil) }} - {{ $params := dict "post" . "page" $page }} - {{ partial "post_li" $params }} - {{ end }} - {{ else }} - {{ range first $page.Params.count (where (where $.Data.Pages "Type" "post") ".Params.notonhomepage" nil) }} - {{ $params := dict "post" . "page" $page }} - {{ partial "post_li" $params }} - {{ end }} - {{ end }} - -
-
-
-{{ end }} +
+ + {{ with $page.Content }}

{{ . | markdownify }}

{{ end }} + + {{ if $page.Params.tags }} + {{ range first $page.Params.count (where (where (where $.Data.Pages "Type" "post") ".Params.tags" "intersect" $page.Params.tags) ".Params.notonhomepage" nil) }} + {{ $params := dict "post" . "page" $page }} + {{ partial "post_li" $params }} + {{ end }} + {{ else }} + {{ range first $page.Params.count (where (where $.Data.Pages "Type" "post") ".Params.notonhomepage" nil) }} + {{ $params := dict "post" . "page" $page }} + {{ partial "post_li" $params }} + {{ end }} + {{ end }} + +
+ diff --git a/layouts/partials/widgets/projects.html b/layouts/partials/widgets/projects.html index fa6fc3bd..15450733 100644 --- a/layouts/partials/widgets/projects.html +++ b/layouts/partials/widgets/projects.html @@ -1,89 +1,80 @@ {{ $ := .root }} {{ $page := .page }} -{{ $projects_len := len (where $.Data.Pages "Type" "project") }} -{{ if gt $projects_len 0 }} -
-
+
+
+

{{ with $page.Title }}{{ . | markdownify }}{{ end }}

+ {{ with $page.Params.subtitle }}

{{ . | markdownify }}

{{ end }} +
+
+ {{ with $page.Content }}

{{ . | markdownify }}

{{ end }} -
-
-

{{ with $page.Title }}{{ . | markdownify }}{{ end }}

- {{ with $page.Params.subtitle }}

{{ . | markdownify }}

{{ end }} -
-
- {{ with $page.Content }}

{{ . | markdownify }}

{{ end }} - -
-
-
-
- {{ range $page.Params.filter }} - {{ .name }} - {{ end }} -
-
+
+
+
+
+ {{ range $page.Params.filter }} + {{ .name }} + {{ end }}
- - {{ if eq $page.Params.view 0 }} - -
- -
- - {{ else }} - -
- - {{ range $project := where $.Data.Pages "Type" "project" }} - {{ $.Scratch.Set "project_url" $project.Permalink }} - {{ if $project.Params.external_link }} - {{ $.Scratch.Set "project_url" $project.Params.external_link }} - {{ end }} -
-
- {{ with $project.Params.image_preview }} - - - - {{ end }} -
-

{{ .Title }}

-
- {{ with $project.Params.summary }}

{{ . }}

{{ end }} -
-
-
-
- {{ end }} - -
- - {{ end }} -
+ {{ if eq $page.Params.view 0 }} + +
+ +
+ + {{ else }} + +
+ + {{ range $project := where $.Data.Pages "Type" "project" }} + {{ $.Scratch.Set "project_url" $project.Permalink }} + {{ if $project.Params.external_link }} + {{ $.Scratch.Set "project_url" $project.Params.external_link }} + {{ end }} +
+
+ {{ with $project.Params.image_preview }} + + + + {{ end }} +
+

{{ .Title }}

+
+ {{ with $project.Params.summary }}

{{ . }}

{{ end }} +
+
+
+
+ {{ end }} + +
+ + {{ end }} +
-
-{{ end }} + diff --git a/layouts/partials/widgets/publications.html b/layouts/partials/widgets/publications.html index ad2856cf..f54356e2 100644 --- a/layouts/partials/widgets/publications.html +++ b/layouts/partials/widgets/publications.html @@ -1,43 +1,35 @@ {{ $ := .root }} {{ $page := .page }} -{{ $pubs_selected_len := .pubs_selected_len }} - {{ $pubs_len := len (where $.Data.Pages "Type" "publication") }} -{{ if gt $pubs_len 0 }} + -
-
+
+
+

{{ with $page.Title }}{{ . | markdownify }}{{ end }}

+ {{ with $page.Params.subtitle }}

{{ . | markdownify }}

{{ end }} + {{ if gt $pubs_len $page.Params.count }} +

+ + {{ with $page.Params.str_all }}{{ . | markdownify }}{{ end }} + + +

+ {{ end }} +
+
+ {{ with $page.Content }}

{{ . | markdownify }}

{{ end }} -
-
-

{{ with $page.Title }}{{ . | markdownify }}{{ end }}

- {{ with $page.Params.subtitle }}

{{ . | markdownify }}

{{ end }} - {{ if gt $pubs_len $page.Params.count }} -

- - {{ with $page.Params.str_all }}{{ . | markdownify }}{{ end }} - - -

- {{ end }} -
-
- {{ with $page.Content }}

{{ . | markdownify }}

{{ end }} - - {{ if $page.Params.detailed_list }} - {{ range first $page.Params.count (where $.Data.Pages "Type" "publication") }} - {{ partial "publication_li_detailed" . }} - {{ end }} - {{ else }} -
    - {{ range first $page.Params.count (where $.Data.Pages "Type" "publication") }} - {{ partial "publication_li_simple" . }} - {{ end }} -
- {{ end }} -
-
+ {{ if $page.Params.detailed_list }} + {{ range first $page.Params.count (where $.Data.Pages "Type" "publication") }} + {{ partial "publication_li_detailed" . }} + {{ end }} + {{ else }} +
    + {{ range first $page.Params.count (where $.Data.Pages "Type" "publication") }} + {{ partial "publication_li_simple" . }} + {{ end }} +
+ {{ end }}
-
-{{ end }} + diff --git a/layouts/partials/widgets/publications_selected.html b/layouts/partials/widgets/publications_selected.html index 5836ab4e..2d0946e3 100644 --- a/layouts/partials/widgets/publications_selected.html +++ b/layouts/partials/widgets/publications_selected.html @@ -1,34 +1,26 @@ {{ $ := .root }} {{ $page := .page }} -{{ $pubs_selected_len := .pubs_selected_len }} -{{ if gt $pubs_selected_len 0 }} -
-
+
+
+

{{ with $page.Title }}{{ . | markdownify }}{{ end }}

+ {{ with $page.Params.subtitle }}

{{ . | markdownify }}

{{ end }} +
+
+ {{ with $page.Content }}

{{ . | markdownify }}

{{ end }} -
-
-

{{ with $page.Title }}{{ . | markdownify }}{{ end }}

- {{ with $page.Params.subtitle }}

{{ . | markdownify }}

{{ end }} -
-
- {{ with $page.Content }}

{{ . | markdownify }}

{{ end }} - - {{ if $page.Params.detailed_list }} - {{ range (where (where $.Data.Pages "Type" "publication") ".Params.selected" true) }} - {{ partial "publication_li_detailed" . }} - {{ end }} - {{ else }} -
    - {{ range (where (where $.Data.Pages "Type" "publication") ".Params.selected" true) }} - {{ partial "publication_li_simple" . }} - {{ end }} -
- {{ end }} -
-
+ {{ if $page.Params.detailed_list }} + {{ range (where (where $.Data.Pages "Type" "publication") ".Params.selected" true) }} + {{ partial "publication_li_detailed" . }} + {{ end }} + {{ else }} +
    + {{ range (where (where $.Data.Pages "Type" "publication") ".Params.selected" true) }} + {{ partial "publication_li_simple" . }} + {{ end }} +
+ {{ end }}
-
-{{ end }} +