Skip to content

Commit

Permalink
landscape test
Browse files Browse the repository at this point in the history
  • Loading branch information
AL-JiongYang committed Jun 4, 2020
1 parent b1aa254 commit 8ca690c
Show file tree
Hide file tree
Showing 7 changed files with 155 additions and 6 deletions.
6 changes: 5 additions & 1 deletion content/home/openings.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ active = true
date = 2016-04-20T00:00:00

# Note: a full width section format can be enabled by commenting out the `title` and `subtitle` with a `#`.
title = "Openings"
title = "<center>Openings</center><br>"
subtitle = ""

# Order that this section will appear in.
weight = 80

[design]
# Choose how many columns the section has. Valid values: 1 or 2.
columns = "1"

+++

<font color="olive">We are always looking for highly motivated Ph.D. students, research assistants and summer internship for exceptional undergraduate interns in our group. We work at the intersection of algorithmic design and systems; therefore, an ideal candidate should have deeper expertise in one area and willingness to learn the other. A strong background in statistics, algorithms/formal methods and prior experience in coding is crucial to make a significant contribution to our research.
Expand Down
3 changes: 2 additions & 1 deletion content/home/posts.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ headless = true # This file represents a page section.
active = true # Activate this widget? true/false
weight = 14 # Order that this section will appear.

title = "Blog Posts"
title = "<center>Blog Posts</center><br>"
subtitle = ""

[content]
Expand Down Expand Up @@ -38,6 +38,7 @@ subtitle = ""
# 3 = Card
# 4 = Citation (publication only)
view = 1
columns = "1"

[design.background]
# Apply a background color, gradient, or image.
Expand Down
4 changes: 2 additions & 2 deletions content/home/projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ active = true # Activate this widget? true/false
weight = 16 # Order that this section will appear.

title = "Software"
subtitle = ""
subtitle = "<br>"

[content]
# Page type to display. E.g. project.
Expand Down Expand Up @@ -35,7 +35,7 @@ subtitle = ""

[design]
# Choose how many columns the section has. Valid values: 1 or 2.
columns = "2"
columns = "1"

# Toggle between the various page layout types.
# 1 = List
Expand Down
1 change: 1 addition & 0 deletions content/home/publications.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ subtitle = ""
# 3 = Card
# 4 = Citation (publication only)
view = 4
columns = "1"

[design.background]
# Apply a background color, gradient, or image.
Expand Down
6 changes: 5 additions & 1 deletion content/home/research.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ active = true


# Note: a full width section format can be enabled by commenting out the `title` and `subtitle` with a `#`.
title = "Research"
title = "<center>Research</center>"
subtitle = ""

# Order that this section will appear in.
weight = 12

[design]
# Choose how many columns the section has. Valid values: 1 or 2.
columns = "1"

+++

# __Overview__
Expand Down
3 changes: 2 additions & 1 deletion content/home/talk.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ headless = true # This file represents a page section.
active = true # Activate this widget? true/false
weight = 15 # Order that this section will appear.

title = "News"
title = "<center>News</center><br>"
subtitle = ""
view = 1

Expand Down Expand Up @@ -41,6 +41,7 @@ view = 1
# 3 = Card
# 4 = Citation (publication only)
view = 1
columns = "1"

[design.background]
# Apply a background color, gradient, or image.
Expand Down
138 changes: 138 additions & 0 deletions layouts/partials/widgets/pages.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
{{/* Pages Widget */}}

{{/* Initialise */}}
{{ $ := .root }}
{{ $st := .page }}
{{ $items_type := $st.Params.content.page_type | default "post" }}
{{ $items_offset := $st.Params.content.offset | default 0 }}
{{ $items_count := $st.Params.content.count }}
{{ if eq $items_count 0 }}
{{ $items_count = 65535 }}
{{ else }}
{{ $items_count = $items_count | default 5 }}
{{ end }}
{{ $items_sort := $st.Params.content.order | default "desc" }}

{{/* Query */}}
{{ $query := where site.RegularPages "Type" $items_type }}
{{ $archive_page := site.GetPage "Section" $items_type }}

{{/* Filters */}}
{{ if $st.Params.content.filters.tag }}
{{ $archive_page = site.GetPage (printf "tags/%s" (urlize $st.Params.content.filters.tag)) }}
{{ $query = $query | intersect $archive_page.Pages }}
{{ end }}
{{ if $st.Params.content.filters.category }}
{{ $archive_page = site.GetPage (printf "categories/%s" (urlize $st.Params.content.filters.category)) }}
{{ $query = $query | intersect $archive_page.Pages }}
{{ end }}
{{ if $st.Params.content.filters.publication_type }}
{{ $archive_page = site.GetPage (printf "publication_types/%s" $st.Params.content.filters.publication_type) }}
{{ $query = $query | intersect $archive_page.Pages }}
{{ end }}
{{ if $st.Params.content.filters.author }}
{{ $archive_page = site.GetPage (printf "authors/%s" (urlize $st.Params.content.filters.author)) }}
{{ $query = $query | intersect $archive_page.Pages }}
{{ end }}
{{ if $st.Params.content.filters.exclude_featured }}
{{ $query = where $query "Params.featured" "!=" true }}
{{ end }}
{{ if $st.Params.content.filters.exclude_past }}
{{ $query = where $query "Date" ">=" now }}
{{ end }}
{{ if $st.Params.content.filters.exclude_future }}
{{ $query = where $query "Date" "<" now }}
{{ end }}

{{ $count := len $query }}

{{/* Sort */}}
{{ $sort_by := "Date" }}
{{ $query = sort $query $sort_by $items_sort }}

{{/* Offset and Limit */}}
{{ if gt $items_offset 0 }}
{{ $query = first $items_count (after $items_offset $query) }}
{{ else }}
{{ $query = first $items_count $query }}
{{ end }}

{{/* Localisation */}}
{{ $i18n := "" }}
{{ if eq $items_type "post" }}
{{ $i18n = "more_posts" }}
{{ else if eq $items_type "talk" }}
{{ $i18n = "more_talks" }}
{{ else if eq $items_type "publication" }}
{{ $i18n = "more_publications" }}
{{ else }}
{{ $i18n = "more_pages" }}
{{ end }}

{{ $columns := $st.Params.design.columns | default "2" }}

<div class="row">
{{ if ne $columns "1" }}
<div class="col-12 col-lg-4 section-heading">
<h1>{{ with $st.Title }}{{ . | markdownify | emojify }}{{ end }}</h1>
{{ with $st.Params.subtitle }}<p>{{ . | markdownify | emojify }}</p>{{ end }}
</div>
<div class="col-12 col-lg-8">

{{ with $st.Content }}{{ . }}{{ end }}

{{ range $post := $query }}
{{ if eq $st.Params.design.view 1 }}
{{ partial "li_list" . }}
{{ else if eq $st.Params.design.view 3 }}
{{ partial "li_card" . }}
{{ else if eq $st.Params.design.view 4 | and (eq $items_type "publication") }}
{{ partial "li_citation" . }}
{{ else }}
{{ partial "li_compact" . }}
{{ end }}
{{end}}

{{ if gt $count $items_count }}
<div class="see-all">
<a href="{{ $archive_page.RelPermalink }}">
{{ i18n $i18n | default "See all" }}
<i class="fas fa-angle-right"></i>
</a>
</div>
{{ end }}

</div>

{{ else }}
<div class="col-12 col-lg-12">
<h1>{{ with $st.Title }}{{ . | markdownify | emojify }}{{ end }}</h1>
{{ with $st.Params.subtitle }}<p>{{ . | markdownify | emojify }}</p>{{ end }}

{{ with $st.Content }}{{ . }}{{ end }}

{{ range $post := $query }}
{{ if eq $st.Params.design.view 1 }}
{{ partial "li_list" . }}
{{ else if eq $st.Params.design.view 3 }}
{{ partial "li_card" . }}
{{ else if eq $st.Params.design.view 4 | and (eq $items_type "publication") }}
{{ partial "li_citation" . }}
{{ else }}
{{ partial "li_compact" . }}
{{ end }}
{{end}}

{{ if gt $count $items_count }}
<div class="see-all">
<a href="{{ $archive_page.RelPermalink }}">
{{ i18n $i18n | default "See all" }}
<i class="fas fa-angle-right"></i>
</a>
</div>
{{ end }}

</div>
{{ end }}

</div>

0 comments on commit 8ca690c

Please sign in to comment.