diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 452dd03b..912ecce0 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -20,88 +20,25 @@ googleAnalytics = "" address = "Stanford AI Lab, Stanford University, California, 90210, USA." phone = "888 888 88 88" + # Enable Keybase in Contact section by entering your keybase.io username. + keybase = "" + # Date format (refer to Go's date format: http://flippinggodateformat.com ) # Examples: "Mon, Jan 2, 2006" or "2006-01-02" date_format = "Mon, Jan 2, 2006" - # Enable global LaTeX math rendering? If false, you can enable it locally - # on a per page basis. + # Enable global LaTeX math rendering? + # If false, you can enable it locally on a per page basis. math = false # Enable native social sharing buttons? sharing = true - # Link custom CSS and JS assets (relative to /static/css and - # /static/js respectively) + # Link custom CSS and JS assets + # (relative to /static/css and /static/js respectively) custom_css = [] custom_js = [] - # Biography section. - # Section will only be displayed if `content/home/about.md` exists. - [params.about] - interests = [ - "Artificial Intelligence", - "Computational Linguistics", - "Information Retrieval" - ] - str_interests = "Interests" - str_education = "Education" - - [[params.about.education]] - course = "PhD in Artificial Intelligence" - institution = "Stanford University" - year = 2012 - - [[params.about.education]] - course = "MEng in Artificial Intelligence" - institution = "Massachusetts Institute of Technology" - year = 2009 - - [[params.about.education]] - course = "BSc in Artificial Intelligence" - institution = "Massachusetts Institute of Technology" - year = 2008 - - # Selected Publications section. - # Section will only be displayed if there are publications with - # `selected = true` in their `+++` preamble. - [params.publications_selected] - detailed_list = true - title = "Selected Publications" - subtitle = "" - - # Publications section. - # Section will only be displayed if there are publications in - # `content/publication/`. - [params.publications] - count = 10 - detailed_list = false - title = "Recent Publications" - subtitle = "" - str_all = "More Publications" - - # Posts section. - # Section will only be displayed if there are posts in `content/post/`. - [params.posts] - count = 5 - title = "Recent Posts" - subtitle = "" - str_all = "More Posts" - str_read_more = "Read more" - - # Projects section. - # Section will only be displayed if there are projects in - # `content/project/`. - [params.projects] - title = "Projects" - subtitle = "" - - # Contact section. - [params.contact] - enable = true - title = "Contact" - subtitle = "" - autolink = true # Automatically link email and phone? # Social/Academic Networking # diff --git a/exampleSite/content/home/about.md b/exampleSite/content/home/about.md index d585fe65..3c2af7ac 100644 --- a/exampleSite/content/home/about.md +++ b/exampleSite/content/home/about.md @@ -1,9 +1,42 @@ +++ +# About/Biography widget. + date = "2016-04-20T00:00:00" draft = false -title = "about" -section_id = 0 + +widget = "about" + +# Order that this section will appear in. weight = 0 + +# List your academic interests. +[interests] + title = "Interests" + interests = [ + "Artificial Intelligence", + "Computational Linguistics", + "Information Retrieval" + ] + +# List your qualifications (such as academic degrees). +[education] + title = "Education" + +[[education.courses]] + course = "PhD in Artificial Intelligence" + institution = "Stanford University" + year = 2012 + +[[education.courses]] + course = "MEng in Artificial Intelligence" + institution = "Massachusetts Institute of Technology" + year = 2009 + +[[education.courses]] + course = "BSc in Artificial Intelligence" + institution = "Massachusetts Institute of Technology" + year = 2008 + +++ # Biography diff --git a/exampleSite/content/home/contact.md b/exampleSite/content/home/contact.md new file mode 100644 index 00000000..bf83e04c --- /dev/null +++ b/exampleSite/content/home/contact.md @@ -0,0 +1,18 @@ ++++ +# Contact widget. + +date = "2016-04-20T00:00:00" +draft = false + +title = "Contact" +subtitle = "" +widget = "contact" + +# Order that this section will appear in. +weight = 60 + +# Automatically link email and phone? +autolink = true + ++++ + diff --git a/exampleSite/content/home/posts.md b/exampleSite/content/home/posts.md new file mode 100644 index 00000000..c0873a7e --- /dev/null +++ b/exampleSite/content/home/posts.md @@ -0,0 +1,23 @@ ++++ +# Recent Posts widget. +# Note: this widget will only display if `content/post/` contains posts. + +date = "2016-04-20T00:00:00" +draft = false + +title = "Recent Posts" +subtitle = "" +widget = "posts" + +# Order that this section will appear in. +weight = 30 + +# Number of posts to list. +count = 5 + +# Links. +str_all = "More Posts" +str_read_more = "CONTINUE READING" + ++++ + diff --git a/exampleSite/content/home/projects.md b/exampleSite/content/home/projects.md new file mode 100644 index 00000000..402ec6d0 --- /dev/null +++ b/exampleSite/content/home/projects.md @@ -0,0 +1,16 @@ ++++ +# Projects widget. +# Note: this widget will only display if `content/project/` contains projects. + +date = "2016-04-20T00:00:00" +draft = false + +title = "Projects" +subtitle = "" +widget = "projects" + +# Order that this section will appear in. +weight = 40 + ++++ + diff --git a/exampleSite/content/home/publications.md b/exampleSite/content/home/publications.md new file mode 100644 index 00000000..ecfc21b2 --- /dev/null +++ b/exampleSite/content/home/publications.md @@ -0,0 +1,25 @@ ++++ +# Recent Publications widget. +# Note: this widget will only display if `content/publication/` contains publications. + +date = "2016-04-20T00:00:00" +draft = false + +title = "Recent Publications" +subtitle = "" +widget = "pubs" + +# Order that this section will appear in. +weight = 20 + +# Number of publications to list. +count = 10 + +# Show publication details (such as abstract)? (true/false) +detailed_list = false + +# Link. +str_all = "More Publications" + ++++ + diff --git a/exampleSite/content/home/publications_selected.md b/exampleSite/content/home/publications_selected.md new file mode 100644 index 00000000..c7771a20 --- /dev/null +++ b/exampleSite/content/home/publications_selected.md @@ -0,0 +1,20 @@ ++++ +# Selected Publications widget. +# Note: this widget will only display if `content/publication/` contains publications +# with `selected = true` in their `+++` preamble. + +date = "2016-04-20T00:00:00" +draft = false + +title = "Selected Publications" +subtitle = "" +widget = "pubs_selected" + +# Order that this section will appear in. +weight = 10 + +# Show publication details (such as abstract)? (true/false) +detailed_list = true + ++++ + diff --git a/exampleSite/content/home/teaching.md b/exampleSite/content/home/teaching.md index e6133997..12414b3b 100644 --- a/exampleSite/content/home/teaching.md +++ b/exampleSite/content/home/teaching.md @@ -1,10 +1,16 @@ +++ +# An example of using the custom widget to create your own home page section. +# To create more sections, duplicate this file and edit the values below as desired. + date = "2016-04-20T00:00:00" draft = false -title = "teaching" + +title = "Teaching" subtitle = "" -section_id = 10 -weight = 10 + +# Order that this section will appear in. +weight = 50 + +++ I am a teaching instructor for the following courses at University X: diff --git a/exampleSite/content/post/getting-started.md b/exampleSite/content/post/getting-started.md index dc3d2c72..b877598b 100644 --- a/exampleSite/content/post/getting-started.md +++ b/exampleSite/content/post/getting-started.md @@ -52,9 +52,9 @@ Assuming you created a new website with the example content following the instal The core parameters for the website can be edited in the `config.toml` configuration file. -As can be seen in the example `config.toml`, the social/academic networking icons and education qualifications are defined as multiples of `[[params.social]]` and `[[params.about.education]]` respectively. They can be duplicated or deleted as necessary. +As can be seen in the example `config.toml`, the social/academic networking icons are defined as multiples of `[[params.social]]`. They can be duplicated or deleted as necessary. -By default, publications will be displayed in a simple list. If you prefer a more detailed list with abstract and image, you can enable the detailed publication list on the homepage by setting `detailed_list = true` under `[params.publications]`. +By default, publications will be displayed in a simple list. If you prefer a more detailed list with abstract and image, you can enable the detailed publication list on the homepage by setting `detailed_list = true` in `content/home/publications.md`. For deployment, the `baseURL` variable should be changed to match your website URL such as `baseURL = "http://your-site.org/"`. The example Disqus commenting variable should be cleared (e.g. `disqusShortname = ""`) or set to your own Disqus shortname to enable commenting. To enable Google Analytics, add your tracking code in `config.toml` similarly to `googleAnalytics = "UA-12345678-9"`. @@ -98,9 +98,8 @@ To list available updates: $ git fetch upstream $ git log --pretty=oneline --abbrev-commit --decorate HEAD..upstream/master -Upgrade by running: +Then, upgrade by running: - $ cd themes/academic $ git pull upstream If you have modified files in `themes/academic`, git will attempt to auto-merge changes. If conflicts are reported, you will need to manually edit the files with conflicts and add them back (`git add `). diff --git a/exampleSite/content/post/managing-content.md b/exampleSite/content/post/managing-content.md index e0e8b900..8e24189b 100644 --- a/exampleSite/content/post/managing-content.md +++ b/exampleSite/content/post/managing-content.md @@ -12,31 +12,49 @@ To enable LaTeX math rendering for a page, you should include `math = true` in t To display an image in publication, post, or project page headers, you can include the `image = "my-image.jpg"` option in the page `+++` preamble. It is automatically assumed that the image is located in your `static/img/` folder. In the context of posts and projects, the image is intended to behave as a full width banner across the top of the article. -## Homepage sections +## Homepage widgets -Homepage sections for publications, projects and posts will automatically hide when there is no content of the respective type. Therefore, if you do not require a particular feature, you can simply delete any associated content in the `content/` folder. +The example site includes the following widgets which display as sections on the homepage: + +- About/biography +- Selected publications +- Recent publications +- Recent news/blog posts +- Projects +- Example custom widget called *teaching* +- Contact ### Introduce yourself with a biography -Place a cropped portrait photo named `portrait.jpg` into the `static/img/` folder, overwriting any defaults. +Place a cropped portrait photo named `portrait.jpg` into the `static/img/` folder, overwriting any defaults. Alternatively, you can edit the `avatar` filepath in `config.toml` to point to a different image name - this is particularly useful if you wish to use a different image format such as PNG. -Edit your biography in the example `content/home/about.md` file that you copied across from the `themes/academic/exampleSite/` folder. The research interests and qualifications are stored separately as `interests` and `education` variables under `[params.about]` in `config.toml`, as can be seen in the example config. It's possible to completely hide the interests and education lists by deleting their respective variables. +Edit your biography in the example `content/home/about.md` file that you copied across from the `themes/academic/exampleSite/` folder. The research interests and qualifications are stored as `interests` and `education` variables. The academic qualifications are defined as multiples of `[[education.courses]]` and can be duplicated or deleted as necessary. It's possible to completely hide the interests and education lists by deleting their respective variables. ### Add a section to the homepage -To add a new section to the homepage: +You can use the custom widget to create your own home page sections. - hugo new home/my-section-name.md +Simply duplicate (copy/paste) and rename the example *teaching* file at `content/home/teaching.md`. Then edit the section title, weight (refer to *Ordering sections* below), and content as desired. -Then edit the newly created file `content/home/my-section-name.md` with your section title and content. In the `+++` preamble, you should also increment the `section_id` to ensure it's unique amongst the other sections in `content/home` and you can adjust `weight` variable to change the order within the custom section of the home page. - -You may also wish to add a navigation link pointing to the new section. This can be achieved by adding something similar to the following lines to your `config.toml`, where the URL will consist of the first title word in lowercase: +You may also wish to add a navigation link to the top of the page that points to the new section. This can be achieved by adding something similar to the following lines to your `config.toml`, where the URL will consist of the first title word in lowercase: [[menu.main]] name = "Research" url = "#research" weight = 10 +### Remove a section from the homepage + +Note that homepage widgets for publications, projects and posts will automatically hide when there is no content of the respective type. + +Otherwise, if you do not require a particular widget, you can simply delete any associated files from the `content/home/` folder. + +To remove a navigation link from the top of the page, remove the associated `[[menu.main]]` entry in `config.toml`. + +### Ordering sections + +The order that the homepage sections are displayed in is defined by the `weight` parameter in each of the files in the `content/home/` directory. The sections are displayed in ascending order of their `weight`, so you can simply edit the `weight` parameters as desired. + ## Create a publication To create a new publication: @@ -86,6 +104,8 @@ To create a blog/news article: Then edit the newly created file `content/post/my-article-name.md` with your full title and content. +To disable commenting for a specific post, you can add `disable_comments = true` to the post `+++` preamble. Or to disable commenting for all posts, you can either set `disqusShortname = ""` or `disable_comments = true` in `config.toml`. + ## Create a project To create a project: diff --git a/layouts/index.html b/layouts/index.html index 4b43bee3..9fdf18c9 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -4,216 +4,26 @@ - -{{ range where .Data.Pages "Type" "home" }} -{{ if eq .Title "about" }} -
-
- {{ partial "home_biography" . }} -
-
-{{ end }} -{{ end }} - - - + {{ $pubs_selected_len := len (where (where .Data.Pages "Type" "publication") ".Params.selected" true) }} -{{ if gt $pubs_selected_len 0 }} -
-
-
-
-

{{ with .Site.Params.publications_selected.title }}{{ . | markdownify }}{{ end }}

- {{ with .Site.Params.publications_selected.subtitle }}

{{ . | markdownify }}

{{ end }} -
-
- {{ if .Site.Params.publications_selected.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 }} - - - -{{ $pubs_len := len (where .Data.Pages "Type" "publication") }} -{{ if gt $pubs_len 0 }} -
-
-
-
-

{{ with .Site.Params.publications.title }}{{ . | markdownify }}{{ end }}

- {{ with .Site.Params.publications.subtitle }}

{{ . | markdownify }}

{{ end }} - {{ if gt $pubs_len .Site.Params.publications.count }} -

- - {{ with .Site.Params.publications.str_all }}{{ . | markdownify }}{{ end }} - - -

- {{ end }} -
-
- {{ if .Site.Params.publications.detailed_list }} - {{ range first .Site.Params.publications.count (where .Data.Pages "Type" "publication") }} - {{ partial "publication_li_detailed" . }} - {{ end }} - {{ else }} -
    - {{ range first .Site.Params.publications.count (where .Data.Pages "Type" "publication") }} - {{ partial "publication_li_simple" . }} - {{ end }} -
- {{ end }} -
-
-
-
-{{ end }} - - - -{{ $posts_len := len (where (where .Data.Pages "Type" "post") ".Params.notonhomepage" nil) }} -{{ if gt $posts_len 0 }} -
-
-
-
-

{{ with .Site.Params.posts.title }}{{ . | markdownify }}{{ end }}

- {{ with .Site.Params.posts.subtitle }}

{{ . | markdownify }}

{{ end }} - {{ if gt $posts_len .Site.Params.posts.count }} -

- - {{ with .Site.Params.posts.str_all }}{{ . | markdownify }}{{ end }} - - -

- {{ end }} -
-
- {{ range first .Site.Params.posts.count (where (where .Data.Pages "Type" "post") ".Params.notonhomepage" nil) }} -
- {{ if .Params.image }} - - - - {{end}} -

- {{ partial "article_metadata" (dict "content" . "is_list" 1) }} -

- {{ if .Truncated }} - {{ printf "%s" .Summary | markdownify }} - {{ else }} - {{ .Content }} - {{ end }} -

-

- - {{ with .Site.Params.posts.str_read_more }}{{ . | markdownify }}{{ end }} - -

-
- {{ end }} -
-
-
-
-{{ end }} - - - -{{ $projects_len := len (where .Data.Pages "Type" "project") }} -{{ if gt $projects_len 0 }} -
-
-
-
-

{{ with .Site.Params.projects.title }}{{ . | markdownify }}{{ end }}

- {{ with .Site.Params.projects.subtitle }}

{{ . | markdownify }}

{{ end }} -
-
-
    - {{ range where .Data.Pages "Type" "project" }} -
  • - - {{ if .Content }}{{ else }}{{ with .Params.external_link }}{{ end }}{{ end }} - - {{ .Title }} - {{ if .Content }}{{ else }}{{ with .Params.external_link }}{{ end }}{{ end }} - - - {{ with .Params.summary }}

    {{ . }}

    {{ end }} - - {{ if isset .Params "tags" }} - {{ $tagsLen := len .Params.tags }} - {{ if gt $tagsLen 0 }} -
    - - {{ range $k, $v := .Params.tags }} - {{ . }}{{ if lt $k (sub $tagsLen 1) }}, {{ end }} - {{ end }} -
    - {{ end }} - {{ end }} -
  • - {{ end }} -
-
-
-
-
-{{ end }} - - - {{ range $index, $page := where .Data.Pages "Type" "home" }} -{{ if and (isset .Params "section_id") (not (eq .Params.section_id 0)) }} -{{ $title_words := split $page.Title " " }} -
-
-
-
-

{{ title $page.Title }}

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

{{ . | markdownify }}

{{ end }} -
-
- {{ $page.Content }} -
-
-
-
-{{ end }} -{{ end }} - - - -{{ if .Site.Params.contact.enable }} -
-
-
-
-

{{ with .Site.Params.contact.title }}{{ . | markdownify }}{{ end }}

- {{ with .Site.Params.contact.subtitle }}

{{ . | markdownify }}

{{ end }} -
-
- {{ partial "home_contact.html" . }} -
-
-
-
+ {{ if eq $page.Params.widget "about" }} + {{ partial "widgets/about" $page }} + {{ else if eq $page.Params.widget "pubs_selected" }} + {{ partial "widgets/publications_selected" (dict "root" $ "page" $page "pubs_selected_len" $pubs_selected_len) }} + {{ else if eq $page.Params.widget "pubs" }} + {{ partial "widgets/publications" (dict "root" $ "page" $page "pubs_selected_len" $pubs_selected_len) }} + {{ else if eq $page.Params.widget "posts" }} + {{ partial "widgets/posts" (dict "root" $ "page" $page) }} + {{ else if eq $page.Params.widget "projects" }} + {{ partial "widgets/projects" (dict "root" $ "page" $page) }} + {{ else if eq $page.Params.widget "contact" }} + {{ partial "widgets/contact.html" $page }} + {{ else }} + {{ partial "widgets/custom.html" $page }} + {{ end }} {{ end }} {{ partial "footer_container.html" . }} - {{ partial "footer.html" . }} diff --git a/layouts/partials/home_biography.html b/layouts/partials/home_biography.html deleted file mode 100644 index 09a5b7cd..00000000 --- a/layouts/partials/home_biography.html +++ /dev/null @@ -1,69 +0,0 @@ - diff --git a/layouts/partials/home_contact.html b/layouts/partials/home_contact.html deleted file mode 100644 index 52d2f6ce..00000000 --- a/layouts/partials/home_contact.html +++ /dev/null @@ -1,32 +0,0 @@ - diff --git a/layouts/partials/widgets/about.html b/layouts/partials/widgets/about.html new file mode 100644 index 00000000..172efade --- /dev/null +++ b/layouts/partials/widgets/about.html @@ -0,0 +1,78 @@ + +
+
+ + + +
+
diff --git a/layouts/partials/widgets/contact.html b/layouts/partials/widgets/contact.html new file mode 100644 index 00000000..6e6ec540 --- /dev/null +++ b/layouts/partials/widgets/contact.html @@ -0,0 +1,59 @@ + +
+
+ +
+
+

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

+ {{ with .Params.subtitle }}

{{ . | markdownify }}

{{ end }} +
+
+ {{ with .Content }}

{{ . | markdownify }}

{{ end }} + +
    + + {{ with .Site.Params.email }} +
  • + + {{ if and (isset $.Params "autolink") (eq $.Params.autolink false) }} + {{ . }} + {{ else }} + {{ . }} + {{ end }} +
  • + {{ end }} + + {{ with .Site.Params.keybase }} +
  • + + + @{{ . }} on Keybase. + +
  • + {{ end }} + + {{ with .Site.Params.phone }} +
  • + + {{ if and (isset $.Params "autolink") (eq $.Params.autolink false) }} + {{ . }} + {{ else }} + {{ . }} + {{ end }} +
  • + {{ end }} + + {{ with .Site.Params.address }} +
  • + + {{ . }} +
  • + {{ end }} + +
+ +
+
+ +
+
diff --git a/layouts/partials/widgets/custom.html b/layouts/partials/widgets/custom.html new file mode 100644 index 00000000..d809f395 --- /dev/null +++ b/layouts/partials/widgets/custom.html @@ -0,0 +1,19 @@ +{{ $page := . }} +{{ $title_words := split $page.Title " " }} + + +
+
+
+
+

{{ 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 new file mode 100644 index 00000000..9ca69824 --- /dev/null +++ b/layouts/partials/widgets/posts.html @@ -0,0 +1,57 @@ +{{ $ := .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 }} + + {{ range first $page.Params.count (where (where $.Data.Pages "Type" "post") ".Params.notonhomepage" nil) }} +
+ {{ if .Params.image }} + + + + {{end}} +

+ +

+ {{ partial "article_metadata" (dict "content" . "is_list" 1) }} +

+ {{ if .Truncated }} + {{ printf "%s" .Summary | markdownify }} + {{ else }} + {{ .Content }} + {{ end }} +

+

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

+
+ {{ end }} +
+
+ +
+
+{{ end }} diff --git a/layouts/partials/widgets/projects.html b/layouts/partials/widgets/projects.html new file mode 100644 index 00000000..59ccafe0 --- /dev/null +++ b/layouts/partials/widgets/projects.html @@ -0,0 +1,53 @@ +{{ $ := .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 }} + +
    + {{ range where $.Data.Pages "Type" "project" }} +
  • + + {{ if .Content }} + + {{ else }} + {{ with .Params.external_link }}{{ end }} + {{ end }} + + {{ .Title }} + {{ if .Content }}{{ else }}{{ with .Params.external_link }}{{ end }}{{ end }} + + + {{ with .Params.summary }}

    {{ . }}

    {{ end }} + + {{ if isset .Params "tags" }} + {{ $tagsLen := len .Params.tags }} + {{ if gt $tagsLen 0 }} +
    + + {{ range $k, $v := .Params.tags }} + {{ . }}{{ if lt $k (sub $tagsLen 1) }}, {{ end }} + {{ end }} +
    + {{ end }} + {{ end }} +
  • + {{ end }} +
+
+
+ +
+
+{{ end }} diff --git a/layouts/partials/widgets/publications.html b/layouts/partials/widgets/publications.html new file mode 100644 index 00000000..ad2856cf --- /dev/null +++ b/layouts/partials/widgets/publications.html @@ -0,0 +1,43 @@ +{{ $ := .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 }} + + {{ 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 new file mode 100644 index 00000000..5836ab4e --- /dev/null +++ b/layouts/partials/widgets/publications_selected.html @@ -0,0 +1,34 @@ +{{ $ := .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 }} + + {{ 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 }}