diff --git a/exampleSite/config.toml b/exampleSite/config.toml index fb51ea1e..fb96bbdb 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -60,7 +60,7 @@ enableGitInfo = false gravatar = false # Get your avatar from Gravatar.com? (true/false) avatar = "portrait.jpg" # Specify an avatar image (in `static/img/` folder) or delete value to disable avatar. - + # Details for the Contact Widget email = "test@example.org" address = "Building 1 Room 1, Stanford University, California, 90210, USA" @@ -107,7 +107,7 @@ enableGitInfo = false # Description for social sharing and search engines. If undefined, author role is used in place. description = "" - + # Default image for social sharing and search engines. Place image in `static/img/` folder and specify image name here. sharing_image = "" diff --git a/exampleSite/content/home/posts.md b/exampleSite/content/home/posts.md index 3f1d2688..4f9fb79d 100644 --- a/exampleSite/content/home/posts.md +++ b/exampleSite/content/home/posts.md @@ -23,6 +23,7 @@ count = 5 # List format. # 0 = Simple # 1 = Detailed -list_format = 1 +# 2 = Stream +list_format = 2 +++ diff --git a/exampleSite/content/post/getting-started/featured.jpg b/exampleSite/content/post/getting-started/featured.jpg new file mode 100644 index 00000000..04a7bae5 Binary files /dev/null and b/exampleSite/content/post/getting-started/featured.jpg differ diff --git a/exampleSite/content/post/getting-started.md b/exampleSite/content/post/getting-started/index.md similarity index 98% rename from exampleSite/content/post/getting-started.md rename to exampleSite/content/post/getting-started/index.md index 99f9dfd2..e1c87daf 100644 --- a/exampleSite/content/post/getting-started.md +++ b/exampleSite/content/post/getting-started/index.md @@ -12,8 +12,7 @@ tags = ["Academic"] summary = "Create a beautifully simple website or blog in under 10 minutes." [header] -image = "headers/getting-started.png" -caption = "Image credit: [**Academic**](https://github.com/gcushen/hugo-academic/)" +caption = "Image credit: [**Unsplash**](https://unsplash.com/photos/CpkOjOcXdUY)" [[gallery_item]] album = "1" diff --git a/exampleSite/static/img/headers/getting-started.png b/exampleSite/static/img/headers/getting-started.png deleted file mode 100644 index 47d46169..00000000 Binary files a/exampleSite/static/img/headers/getting-started.png and /dev/null differ diff --git a/layouts/partials/css/academic.css b/layouts/partials/css/academic.css index 1ae310e4..84018001 100644 --- a/layouts/partials/css/academic.css +++ b/layouts/partials/css/academic.css @@ -775,6 +775,39 @@ article .article-metadata { padding-top: 1rem; } +/************************************************* + * Stream + **************************************************/ + +.media.stream-item { + margin-bottom: 2rem; +} + +.media.stream-item .article-title { + font-size: 1.2rem; +} + +.media.stream-item .article-style { + margin-top: 2px; + font-size: 0.8rem; +} + +.media.stream-item .stream-meta { + margin-top: 12px; +} + +.media.stream-item img { + max-width: 150px; + height: auto; + object-fit: cover; +} + +@media screen and (max-width: 768px) { + .media.stream-item img { + max-width: 80px; + } +} + /************************************************* * Publications **************************************************/ diff --git a/layouts/partials/header_image.html b/layouts/partials/header_image.html index b2f91b33..032cb3c1 100644 --- a/layouts/partials/header_image.html +++ b/layouts/partials/header_image.html @@ -1,4 +1,13 @@ -{{ if .Params.header.image }} +{{ $featured := (.Resources.ByType "image").GetMatch "*featured*" }} +{{ with $featured }} +{{ $image := .Fill "1600x400" }} +
+ + {{ with $.Params.header.caption }}{{ . | markdownify | emojify }}{{ end }} +
+{{end}} + +{{ if and .Params.header.image (not $featured) }}
{{ $img_src := urls.Parse .Params.header.image }} {{ if $img_src.Scheme }} diff --git a/layouts/partials/post_li_stream.html b/layouts/partials/post_li_stream.html new file mode 100644 index 00000000..a96b6e23 --- /dev/null +++ b/layouts/partials/post_li_stream.html @@ -0,0 +1,36 @@ +{{ $post := .post }} + +
+
+ +

+ +

+ + {{ $summary := "" }} + {{ if $post.Params.summary }} + {{ $summary = $post.Params.summary | markdownify }} + {{ else if $post.Truncated }} + {{ $summary = $post.Summary }} + {{ end }} + {{ with $summary }} +
+ {{ . | truncate 135 }} +
+ {{ end }} + +
+ {{ partial "article_metadata" (dict "content" $post "is_list" 1) }} +
+ +
+
+ {{ $resource := ($post.Resources.ByType "image").GetMatch "*featured*" }} + {{ with $resource }} + {{ $image := .Resize "150x" }} + + + + {{end}} +
+
diff --git a/layouts/partials/widgets/posts.html b/layouts/partials/widgets/posts.html index 6e7de960..4a27f79e 100644 --- a/layouts/partials/widgets/posts.html +++ b/layouts/partials/widgets/posts.html @@ -81,8 +81,10 @@ {{ $params := dict "post" . }} {{ if eq $page.Params.list_format 0 }} {{ partial "post_li_simple" $params }} - {{ else }} + {{ else if eq $page.Params.list_format 1 }} {{ partial "post_li_detailed" $params }} + {{ else }} + {{ partial "post_li_stream" $params }} {{ end }} {{end}}