Skip to content

Commit 63f2a4c

Browse files
committed
Implement blog page layout
1 parent fc61339 commit 63f2a4c

File tree

5 files changed

+91
-4
lines changed

5 files changed

+91
-4
lines changed

_layouts/blog.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
layout: default
3+
---
4+
{% if page.title %}
5+
<h1 class="has-text-centered">{{ page.title }}</h1>
6+
{% endif %}
7+
8+
<div class="has-text-centered">
9+
{{ content }}
10+
</div>
11+
12+
{% if site.posts.size > 0 %}
13+
<h2 class="post-list-heading">{{ page.list_title | default: "Posts" }}</h2>
14+
{% for post in site.posts %}
15+
{% unless post.exclude %}
16+
<div class="card">
17+
{% assign date_format = site.minima.date_format | default: "%b %-d, %Y" %}
18+
<a class="card-header-title" href="{{ post.url | relative_url }}">
19+
{{ post.title | escape }}
20+
</a>
21+
<div class="card-content">
22+
<div class="content">
23+
<p>{{ post.excerpt | remove: '<p>' | remove: '</p>'}}...<a href="{{ post.url | relative_url }}">Read More</a></p>
24+
<time class="is-size-7" datetime="{{ post.date }}">{{ post.date | date: date_format }}</time>
25+
</div>
26+
</div>
27+
</div>
28+
<br />
29+
{% endunless %}
30+
{% endfor %}
31+
32+
{% endif %}

_posts/2019-06-15-hello.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
layout: post
3+
title: "Welcome to codeIndore()!"
4+
date: 2019-06-18 20:29:15 +0530
5+
categories: jekyll update
6+
comments: true
7+
---
8+
You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.
9+
10+
To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.
11+
12+
Jekyll also offers powerful support for code snippets:
13+
14+
{% highlight ruby %}
15+
def print_hi(name)
16+
puts "Hi, #{name}"
17+
end
18+
print_hi('Tom')
19+
#=> prints 'Hi, Tom' to STDOUT.
20+
{% endhighlight %}
21+
22+
Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk].
23+
24+
[jekyll-docs]: https://jekyllrb.com/docs/home
25+
[jekyll-gh]: https://github.com/jekyll/jekyll
26+
[jekyll-talk]: https://talk.jekyllrb.com/

_posts/2019-06-17-code.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
layout: post
3+
title: "Welcome to Jekyll!"
4+
date: 2019-06-17 20:29:15 +0530
5+
categories: jekyll update
6+
comments: true
7+
---
8+
You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.
9+
10+
To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.
11+
12+
Jekyll also offers powerful support for code snippets:
13+
14+
{% highlight ruby %}
15+
def print_hi(name)
16+
puts "Hi, #{name}"
17+
end
18+
print_hi('Tom')
19+
#=> prints 'Hi, Tom' to STDOUT.
20+
{% endhighlight %}
21+
22+
Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk].
23+
24+
[jekyll-docs]: https://jekyllrb.com/docs/home
25+
[jekyll-gh]: https://github.com/jekyll/jekyll
26+
[jekyll-talk]: https://talk.jekyllrb.com/

blog.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
2-
title: Blog
3-
layout: default
2+
title: Blogs
3+
layout: blog
44
permalink: /blog/
55
---
6-
<h1 class="has-text-centered">Blog</h1>
7-
<p class="has-text-centered">Any blog entries we post will be visible here</p>
6+
Blogs are a great way of passing on knowledge, expressing opinions, and demonstrating our expertise. The blogs on this page have been submitted by the members of our community as part of their effort in helping others.

css/main.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,7 @@ only screen and (max-width: 1000px) {
7878
td:nth-of-type(4):before { content: "Location";}
7979
td:nth-of-type(5):before { content: "Description"; }
8080
}
81+
82+
.card-header-title {
83+
padding-bottom: 0rem;
84+
}

0 commit comments

Comments
 (0)