diff options
author | Hadi Sinaee <3697216+hadisinaee@users.noreply.github.com> | 2021-07-24 22:54:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-24 22:54:01 +0300 |
commit | 64821980d731317bd1b850cccae1ff3d4d9d8d76 (patch) | |
tree | 6607b18400a06c213319fa464724b967d6ae622a | |
parent | 5a3ec519172cbff7d4b2070e2fe93bee1583e65e (diff) |
chore: add news feed (#44)
-rw-r--r-- | exampleSite/content/home/news.md | 14 | ||||
-rw-r--r-- | exampleSite/content/home/projects.md | 2 | ||||
-rw-r--r-- | exampleSite/content/home/publications.md | 2 | ||||
-rw-r--r-- | exampleSite/content/news/_index.md | 40 | ||||
-rw-r--r-- | layouts/partials/news/news.html | 44 | ||||
-rw-r--r-- | static/css/style.css | 17 |
6 files changed, 117 insertions, 2 deletions
diff --git a/exampleSite/content/home/news.md b/exampleSite/content/home/news.md new file mode 100644 index 0000000..784e52f --- /dev/null +++ b/exampleSite/content/home/news.md @@ -0,0 +1,14 @@ +--- +title: "News" +date: 2020-10-20T18:55:12+03:30 +headless: true +weight: 2 +content_type: "news" + +section_settings: + show_section: true + title: '' + subtitle: 'news section subtitle' +--- + +home/news.md
\ No newline at end of file diff --git a/exampleSite/content/home/projects.md b/exampleSite/content/home/projects.md index 967b9c2..7e4e011 100644 --- a/exampleSite/content/home/projects.md +++ b/exampleSite/content/home/projects.md @@ -2,7 +2,7 @@ title: "Projects" date: 2020-10-20T18:55:12+03:30 headless: true -weight: 2 +weight: 4 content_type: "projects" section_settings: diff --git a/exampleSite/content/home/publications.md b/exampleSite/content/home/publications.md index 3a1ffee..8c050c5 100644 --- a/exampleSite/content/home/publications.md +++ b/exampleSite/content/home/publications.md @@ -2,7 +2,7 @@ title: "Publications" date: 2020-10-20T18:55:12+03:30 headless: true -weight: 1 +weight: 3 content_type: 'publications' section_settings: diff --git a/exampleSite/content/news/_index.md b/exampleSite/content/news/_index.md new file mode 100644 index 0000000..2db6177 --- /dev/null +++ b/exampleSite/content/news/_index.md @@ -0,0 +1,40 @@ +--- +title: "news" +date: 2020-11-20T17:51:47+03:30 +draft: false +headless: true + +# all icons by [feathericons.com](https://https://feathericons.com//) are supported +show_news_icons: true +default_news_icon: "file-text" + +num_news: 5 + +news_items: +- text: "I joined [The Coolest Startup in the World](https://goodluck.com) as the CEO" + extra_text: "August 2023." + date: 2023-11-20 +- text: "How to deploy in the era of cloud services?" + link: https://https://feathericons.com// + extra_text: "Software Engineering Daily Podcast, Feb. 2021." + date: 2022-11-20 +- text: "Past, present and future of decentralized computing" + link: https://https://feathericons.com// + extra_text: "The New York Times, Feb. 2020." + date: 2021-11-20 +- text: "How to give a communicative research talk?" + link: "/en/talks/how-to-give-a-communicative-research-talk/" + extra_text: "Software Engineering Daily Podcast, Jan. 2020." + icon: "youtube" + date: 2020-11-20 +- text: "The new era of software engineering" + link: https://https://feathericons.com// + extra_text: "Software Engineering Daily Podcast, Jan. 2020." + icon: "youtube" + date: 2020-11-20 +- text: "How to write a good paper?" + link: https://https://feathericons.com// + extra_text: "HotOS'19." + icon: "youtube" + date: 2020-11-20 +---
\ No newline at end of file diff --git a/layouts/partials/news/news.html b/layouts/partials/news/news.html new file mode 100644 index 0000000..7ed8ee8 --- /dev/null +++ b/layouts/partials/news/news.html @@ -0,0 +1,44 @@ +{{ $content_type := .Params.content_type }} +{{ $newsPage := .Site.GetPage $content_type }} + +{{ $news_items := $newsPage.Params.news_items }} +{{ $show_news_icons := $newsPage.Params.show_news_icons }} + +{{ $default_news_icon := "" }} +{{ if $show_news_icons }} +{{ $default_news_icon = $newsPage.Params.default_news_icon }} +{{ end }} + +{{ $news_icon := $default_news_icon }} + +{{ $num_news_to_show := $newsPage.Params.num_news }} +<div class="news row w-100"> + <div class="col w-100"> + <ul class="news_list"> + {{ range $item := first $num_news_to_show (sort $news_items "date" "desc") }} + {{ if $item.icon }} + {{ $news_icon = $item.icon }} + {{ end }} + + <li> + {{ if $show_news_icons }} + <i data-feather="{{ $news_icon }}"></i> + {{ end }} + + {{ if $item.link}} + <a href='{{ $item.link }}' target="_blank"> + {{ markdownify (emojify $item.text) }} + </a> + {{ else }} + {{ markdownify (emojify $item.text) }} + {{ end }} + + {{ if $item.extra_text }} + <span class="secondary_font text-muted">, {{ markdownify (emojify $item.extra_text) }}</span> + {{end}} + + </li> + {{ end }} + </ul> + </div> +</div>
\ No newline at end of file diff --git a/static/css/style.css b/static/css/style.css index 460197b..a2aef66 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -85,6 +85,23 @@ a { margin-top: 1%; } +.news { + margin-top: 1.5%; +} + +.news_list { + padding: 0%; + list-style-type: none; +} + +.news_list svg { + margin-right: .5%; +} + +.news_icon i { + font-size: x-small; + color: #071013; +} .publications .publication { margin-top: 1.5%; |