diff --git a/README.md b/README.md index a11f6cd..891fd52 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ theme = "hugo-theme-console" ## Example Site -If you want to run the example site, please run the following command: +To run the example site, please type the following command: ``` makefile hugo-server diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 18dca1e..7226a4e 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -11,7 +11,6 @@ languageCode = "en-us" [[params.navlinks]] name = "posts/" url = "/posts/" - home = true [[params.navlinks]] name = "photos/" diff --git a/images/screenshot.png b/images/screenshot.png index 1505a36..1083921 100644 Binary files a/images/screenshot.png and b/images/screenshot.png differ diff --git a/images/tn.png b/images/tn.png index c83b2d1..5fe1ae4 100644 Binary files a/images/tn.png and b/images/tn.png differ diff --git a/layouts/_default/list.html b/layouts/_default/list.html index f730d59..c01818a 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -3,12 +3,16 @@
{{ .Content }} +
{{ range sort .Data.Pages "Date" "desc" }} {{ if not .Params.private }} -
{{ .PublishDate.Format "Jan. 2, 2006" }}
-

{{ .Title }}

- {{ .Summary }} +
+
{{ .PublishDate.Format "Jan. 2, 2006" }}
+

{{ .Title }}

+ {{ .Summary }} +
{{ end }} {{ end }} +
{{ end }} \ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html index 7d458f0..98407f9 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,7 +1,40 @@ - - {{ range .Site.Params.navlinks }} - {{ if .home }} - +{{ define "main" }} + +

About

+ +

+Console is a minimal, responsive and light theme for Hugo inspired by Linux console. (more) +

+
+ +

Latest posts

+ +
+{{ with .Site.GetPage "/posts" }} + {{ range first 3 ((where .Pages ".Params.private" "!=" true) sort .Data.Pages "Date" "desc")}} +
+
{{ .PublishDate.Format "Jan. 2, 2006" }}
+

{{ .Title }}

+ {{ .Summary }} +
{{ end }} +{{ end }} +
+ +

Latest photos

+ +
+{{ with .Site.GetPage "/photos" }} + {{ range first 3 (sort .Data.Pages "Date" "desc")}} + + {{ $image := .Page.Resources.GetMatch .Params.image }} + {{ with $image }} + {{ $thumb := .Resize "400x" }} + {{ .Title }} + {{end}} + {{ end }} - \ No newline at end of file +{{ end }} +
+ +{{ end }} \ No newline at end of file diff --git a/static/hugo-theme-console/css/console.css b/static/hugo-theme-console/css/console.css index b749d7a..8888002 100644 --- a/static/hugo-theme-console/css/console.css +++ b/static/hugo-theme-console/css/console.css @@ -153,14 +153,6 @@ strong { margin-right: 30px; } -.post-list-date { - float: left; - font-weight: bold; - width: 150px; - height: 120px; - margin-top: 21px; -} - figure { margin-top: 15px; margin-bottom: 15px; @@ -201,6 +193,28 @@ figure { margin-bottom: 10px; } +.posts-list { + position: relative; + padding-left: 150px; + top: 0; + margin-top: 21px; +} + +.post h1 { + padding-top: 0; +} + +.posts-list .date { + display: inline-block; + position: absolute; + left: 0px; + width: 150px; + height: 100%; + z-index: 400; + font-weight: bold; + padding-top: 3px; +} + @media only screen and (max-width: 850px) { .site-name { width: 2ch; @@ -236,10 +250,30 @@ figure { margin-left: 30px; margin-right: 30px; } - .post-list-date { - width: 0; - overflow: hidden; + + .posts-list { + position: relative; + padding-left: 0; + top: 0; + margin-top: 21px; } + + .post h1 { + padding-top: 0; + } + + .posts-list .date { + display: inline-block; + position: absolute; + left: 0px; + width: 150px; + height: 100%; + z-index: 400; + font-weight: bold; + padding-top: 3px; + display: none; + } + .footer { margin-top: 50px;