Skip to content

Commit

Permalink
Allow for content on homepage (#109)
Browse files Browse the repository at this point in the history
Co-authored-by: Yash Mehrotra <yashmehrotra95@gmail.com>
  • Loading branch information
jamesericdavidson and yashmehrotra committed Aug 9, 2022
1 parent 7075a53 commit 84e00a5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
9 changes: 9 additions & 0 deletions exampleSite/content/posts/theme-documentation-basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,15 @@ Text to display in the footer section
footer = "Text in footer"
```

### Displaying content on the homepage

Content to display on homepage below the social icons, using the contents of `content/_index.md`.

```toml
[params]
enableFrontMatter = "true"
```

### Custom Head HTML

You can add custom HTML in head section
Expand Down
9 changes: 9 additions & 0 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ <h3>{{ .Site.Params.Description }}</h3>
</section>
{{ end }}

{{ if isset .Site.Params "enablefrontmatter" }}
{{ if eq .Site.Params.EnableFrontMatter "true" }}
<hr>
<section class="home-content">
{{ .Content }}
</section>
{{ end }}
{{ end }}

{{ if isset .Site.Params "showpostsonhomepage" }}

<div class="home-posts list-posts">
Expand Down
4 changes: 2 additions & 2 deletions static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ table td {
}

/* HOME PAGE */
.home-about {
.home-about, .home-content {
text-align: center;
}

Expand Down Expand Up @@ -556,7 +556,7 @@ table td {
width: 100%;
}

.home-about {
.home-about, .home-content {
margin: 0 auto;
}

Expand Down

0 comments on commit 84e00a5

Please sign in to comment.