From 5985996691be39bb47c7d40ccbc930584df080b4 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Sun, 8 May 2016 00:07:40 +0100 Subject: [PATCH] :sparkles: Update layouts and fix JS --- layouts/404.html | 6 +- layouts/_default/single.html | 3 + layouts/_default/teaching.html | 1 - layouts/index.html | 149 +++++++++++------- layouts/partials/article_metadata.html | 9 +- .../partials/article_metadata_compact.html | 19 +++ layouts/partials/comments.html | 7 + layouts/partials/footer.html | 4 + layouts/partials/footer_container.html | 9 +- layouts/partials/header.html | 3 +- .../bio.html => partials/home_biography.html} | 8 +- .../{contact.html => home_contact.html} | 2 +- layouts/partials/navbar.html | 9 +- .../partials/publication_list_buttons.html | 8 + layouts/partials/share.html | 20 +++ layouts/{projects => project}/single.html | 0 .../{publications => publication}/single.html | 23 +-- layouts/section/{projects.html => home.html} | 0 layouts/section/{blog.html => post.html} | 0 layouts/section/project.html | 0 .../{publications.html => publication.html} | 9 +- static/js/hugo-academic.js | 2 +- 22 files changed, 195 insertions(+), 96 deletions(-) delete mode 100644 layouts/_default/teaching.html create mode 100644 layouts/partials/article_metadata_compact.html create mode 100644 layouts/partials/comments.html rename layouts/{_default/bio.html => partials/home_biography.html} (91%) rename layouts/partials/{contact.html => home_contact.html} (90%) create mode 100644 layouts/partials/publication_list_buttons.html create mode 100644 layouts/partials/share.html rename layouts/{projects => project}/single.html (100%) rename layouts/{publications => publication}/single.html (73%) rename layouts/section/{projects.html => home.html} (100%) rename layouts/section/{blog.html => post.html} (100%) create mode 100644 layouts/section/project.html rename layouts/section/{publications.html => publication.html} (52%) diff --git a/layouts/404.html b/layouts/404.html index c79659f1..3cf31f7b 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -5,15 +5,15 @@

Page not found

Maybe you were looking for one of these?

-

Recent News

- {{ range last 20 (where .Data.Pages "Section" "=" "blog") }} +

Recent Posts

+ {{ range last 20 (where .Data.Pages "Section" "=" "post") }} {{ end }}

Recent Publications

- {{ range last 20 (where .Data.Pages "Section" "=" "publications") }} + {{ range last 20 (where .Data.Pages "Section" "=" "publication") }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index aa68f602..02e8557f 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -4,12 +4,15 @@

{{ .Title }}

{{ partial "article_metadata" . }} +
{{ .Content }}
{{ partial "section_item_pager.html" . }} + {{ partial "comments.html" . }} + {{ partial "footer_container.html" . }} diff --git a/layouts/_default/teaching.html b/layouts/_default/teaching.html deleted file mode 100644 index fb3ffc23..00000000 --- a/layouts/_default/teaching.html +++ /dev/null @@ -1 +0,0 @@ -{{ .Content }} \ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html index bc70889c..0d0e1258 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -2,84 +2,121 @@ {{ partial "navbar.html" . }}
+ {{ range $index, $page := where .Site.Pages "Section" "=" "home" }} {{ if eq .Title "about" }} -
- {{ .Render "bio" }} +
+ {{ partial "home_biography" . }}
{{ end }} {{ end }} -
-

Recent Publications

-
    - {{ range first 5 (where .Data.Pages.ByDate "Section" "publications").Reverse }} -
  • - - {{ .Title | markdownify }} - Details - {{ with .Params.url_pdf }}PDF{{ end }} - {{ with .Params.url_code }}Code{{ end }} - {{ with .Params.url_dataset }}Dataset{{ end }} - {{ with .Params.url_project }}Project{{ end }} - {{ range .Params.url_custom }}{{ .name }}{{ end }} -
  • - {{ end }} -
-

More Publications

-
- - -
-

News

- {{ range last 5 (where .Data.Pages "Section" "=" "blog") }} -
-

{{ .Title }}

- {{ partial "article_metadata" . }} -

- {{ if .Truncated }} - {{ .Summary }} - Read More - {{ else }} - {{ .Content }} - {{ end }} -

+ +
+
+
+

Recent Publications

+

More Publications

+
+
+
    + {{ range first 5 (where .Data.Pages.ByDate "Section" "publication").Reverse }} +
  • + + {{ .Title | markdownify }} +

    {{ partial "publication_list_buttons" . }}

    +
  • + {{ end }} +
+
- {{ end }} -

More Posts

-
-

Projects

- + +
+
+
+

Posts

+

More Posts

+
+
+ {{ range last 5 (where .Data.Pages "Section" "=" "post") }} +
+

{{ .Title }}

+ {{ partial "article_metadata_compact" . }} +

+ {{ if .Truncated }} + {{ .Summary }} + {{ else }} + {{ .Content | markdownify }} + {{ end }} +

+

+ Read more +

+
+ {{ end }} +
+
+ +
+
+
+

Projects

+
+
+ +
+
+
+ + + {{ range $index, $page := where .Site.Pages "Section" "=" "home" }} - {{ if eq .Title "teaching" }} -
- {{ .Render "teaching" }} + {{ if and (isset .Params "section_id") (not (eq .Params.section_id 0)) }} + {{ $title_words := split $page.Title " " }} +
+
+
+

{{ title $page.Title }}

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

Contact

- {{ partial "contact.html" . }} + +
+
+
+

Contact

+
+
+ {{ partial "home_contact.html" . }} +
+
+ + {{ partial "footer_container.html" . }}
diff --git a/layouts/partials/article_metadata.html b/layouts/partials/article_metadata.html index 89173a1e..0015429a 100644 --- a/layouts/partials/article_metadata.html +++ b/layouts/partials/article_metadata.html @@ -1,7 +1,6 @@ diff --git a/layouts/partials/article_metadata_compact.html b/layouts/partials/article_metadata_compact.html new file mode 100644 index 00000000..f9093bfd --- /dev/null +++ b/layouts/partials/article_metadata_compact.html @@ -0,0 +1,19 @@ + diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html new file mode 100644 index 00000000..dbed6421 --- /dev/null +++ b/layouts/partials/comments.html @@ -0,0 +1,7 @@ +{{ if not (isset .Site.Params "disable_comments") }} +
+
+ {{ template "_internal/disqus.html" . }} +
+
+{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index a66789bd..5bdb568f 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,4 +1,6 @@ + + @@ -31,10 +33,12 @@ + {{ if and (isset .Params "math") (eq .Params.math true) }} + {{ end }} diff --git a/layouts/partials/footer_container.html b/layouts/partials/footer_container.html index 35a016f4..a10ffd1b 100644 --- a/layouts/partials/footer_container.html +++ b/layouts/partials/footer_container.html @@ -1,11 +1,12 @@
-

+

- Powered by the Academia theme for the Hugo - engine. + {{ with .Site.Copyright }}{{ . | markdownify}} · {{ end }} - Back to top + Powered by the Academic theme for Hugo. + +

diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 742eb5e0..3b0dbd34 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -15,8 +15,9 @@ + - {{ .Site.Title }} + {{ if not .IsHome }}{{ .Title }} | {{ end }}{{ .Site.Title }} diff --git a/layouts/_default/bio.html b/layouts/partials/home_biography.html similarity index 91% rename from layouts/_default/bio.html rename to layouts/partials/home_biography.html index 2e6a688f..546e610b 100644 --- a/layouts/_default/bio.html +++ b/layouts/partials/home_biography.html @@ -12,8 +12,8 @@