Skip to content

Commit

Permalink
Merge pull request #31 from celestehorgan/add-blog
Browse files Browse the repository at this point in the history
Add blogging
  • Loading branch information
celestehorgan authored Mar 24, 2021
2 parents d1da777 + 752f5a6 commit 9b73e77
Show file tree
Hide file tree
Showing 10 changed files with 117 additions and 9 deletions.
25 changes: 22 additions & 3 deletions assets/sass/custom.sass
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
//@import "bootstrap/scss/alert"
//@import "bootstrap/scss/progress"
//@import "bootstrap/scss/media"
//@import "bootstrap/scss/list-group"
@import "bootstrap/scss/list-group"
//@import "bootstrap/scss/close"
//@import "bootstrap/scss/toasts"
//@import "bootstrap/scss/modal"
Expand All @@ -67,11 +67,17 @@
$font-family-base: "Cairo"
$font-family-headers: "Lexend Deca"
$purple: #704BDB
$link-color-primary: $purple
$link-color-secondary: #663ed8

// Utilities
body
font-family: $font-family-base
a
color: $link-color-primary
&:hover
color: $link-color-secondary

.logo
max-width: 200px
Expand Down Expand Up @@ -142,14 +148,27 @@ p
color: #a0a0a0
padding-top: 100px


nav
ul
list-style-type: none
padding-left: 0
ul
padding-left: 1.5rem

.pagination
@extend .list-group
@extend .list-group-horizontal
a
color: $link-color-primary
a:hover
color: $link-color-secondary
.page-item
@extend .list-group-item
border: 0px
.active.page-item
@extend .bg-light
border: 0px

#sidebar
background-image: url('/img/layout/sidebar-bg.svg')
background-size: cover
Expand All @@ -162,7 +181,7 @@ nav
height: 100%
#sidebar-nav
a
color: #FFFFFF
color: #ffffff

#top-nav
background: linear-gradient(90deg, rgba(73,21,208,1) 0%, rgba(24,151,212,1) 100%)
Expand Down
15 changes: 10 additions & 5 deletions config.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
baseURL = "https://inclusivenaming.org"
title = "Inclusive Naming Initiative"
disableKinds = ["taxonomy", "taxonomyTerm"]
copyright = "The Inclusive Naming Initiative authors and collaborating organizations"

copyright = "The Inclusive Naming Initiative authors and collaborating organizations"
enableGitInfo = true
summaryLength = 20

[markup.highlight]
style = "paraiso-dark"
Expand Down Expand Up @@ -89,11 +89,16 @@ url = "/calendar"
parent = "getinvolved"
weight = 3

# [[menu.main]]
# name = "Blog"
# url = "/blog"
# weight = 4

[[menu.main]]
name = "Resources"
url = "#"
identifier = "lang"
weight = 3
weight = 5

[[menu.main]]
name = "Word replacement list"
Expand All @@ -116,9 +121,9 @@ weight = 3
[[menu.main]]
name = "Related projects"
url = "/related-projects"
weight = 4
weight = 6

[[menu.main]]
name = "FAQs"
url = "/faqs"
weight = 5
weight = 7
5 changes: 5 additions & 0 deletions content/blog/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Blog
linkTitle: Blog
---

7 changes: 7 additions & 0 deletions content/blog/_posts/test-post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Welcome to the Inclusive Naming Blog"
date: 2021-01-01
slug: welcome-post
---

Content goes here
8 changes: 8 additions & 0 deletions layouts/blog/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{ define "title" }}
{{ .Title }}
{{ end }}

{{ define "main" }}
{{ partial "blog/hero.html" . }}
{{ partial "blog/post-list.html" . }}
{{ end }}
8 changes: 8 additions & 0 deletions layouts/blog/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{ define "title" }}
{{ .Title }} | The Longhorn blog
{{ end }}

{{ define "main" }}
{{ partial "blog/hero.html" . }}
{{ partial "blog/content.html" . }}
{{ end }}
16 changes: 16 additions & 0 deletions layouts/partials/blog/content.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{ $posts := where site.RegularPages "Section" "blog" }}
<div class="container">
<div class="columns">
<div class="col col-12">
<div class="">
{{ .Content }}
</div>

<a class="btn btn-primary" href="/blog">
<span>
Back to blog
</span>
</a>
</div>
</div>
</div>
12 changes: 12 additions & 0 deletions layouts/partials/blog/hero.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{ $isPost := ne .File.BaseFileName "_index" }}
<div class="container bg-secondary text-light p-4 mb-3">
<h1>
{{ .Title }}
</h1>
{{ if $isPost }}
{{ $date := dateFormat "January 2, 2006" .Date }}
<h2>
{{ .Params.author }} | {{ $date }}
</h2>
{{ end }}
</div>
28 changes: 28 additions & 0 deletions layouts/partials/blog/post-list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{ $posts := where site.RegularPages "Section" "blog" }}
<div class="container">
<div class="row">
{{ range (.Paginate $posts).Pages }}
{{ $date := dateFormat "January 2, 2006" .Date }}
<div class="col col-lg-6 col-md-12 col-12">
<div>
<a href="{{ .RelPermalink }}">
<h2>
{{ .Title }}
</h2>
<h3>
{{ $date }}
</h3>
</a>
</div>
<div>
{{ .Summary }}...
</div>
</div>
{{ end }}
</div>
<div class="row">
<div class="mx-auto pt-5">
{{ template "_internal/pagination.html" . }}
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion layouts/shortcodes/jumbotron.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ <h1>
{{ .Inner }}
</p>
</div>
</section>
</section>

0 comments on commit 9b73e77

Please sign in to comment.