Skip to content

Commit 627495b

Browse files
committed
categories, blog and main page reorganized
1 parent 9f16d76 commit 627495b

File tree

10 files changed

+86
-14
lines changed

10 files changed

+86
-14
lines changed

_config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ plugins:
3131

3232
# Pagination
3333
paginate: 6
34-
paginate_path: "/blog/page:num/"
34+
paginate_path: "blog/page:num/"
3535

3636
# Permalinks
3737
permalink: /:categories/:title/

_includes/header.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
<nav class="header__links">
1212
<div class="container header__links-wrapper">
13-
<a class="header__link" href="{{ '/' | relative_url }}" itemprop="url"><span itemprop="name">Home</span></a>
14-
<a class="header__link" href="{{ '/articles' | relative_url }}" itemprop="url"><span itemprop="name">Articles</span></a>
13+
<a class="header__link" href="{{ '/blog' | relative_url }}" itemprop="url"><span itemprop="name">Blog</span></a>
14+
<a class="header__link" href="{{ '/categories' | relative_url }}" itemprop="url"><span itemprop="name">Categories</span></a>
1515
<a class="header__link" href="{{ '/about' | relative_url }}" itemprop="url"><span itemprop="name">About</span></a>
1616
<a class="header__link" href="{{ '/contact' | relative_url }}" itemprop="url"><span itemprop="name">Contact</span>
1717
</a>

_layouts/default.html renamed to _layouts/blog.html

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66

77
{% include header.html %}
88

9-
<div class="hero lazyload" data-bg="{{site.url}}/assets/img/main_banner.jpg">
9+
<div class="hero--small">
1010
<div class="hero__wrap">
11-
<h1 class="hero__title">Android Code</h1>
12-
<p class="hero__meta">Android online treasury knowledge</p>
11+
<h1 class="hero__title">{{ page.title }}</h1>
1312
</div>
1413
</div>
1514

_layouts/home.html

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<html lang="{{ page.lang | default: site.lang | default: "en_US" }}">
2+
3+
{% include head.html %}
4+
5+
<body class="site">
6+
7+
{% include header.html %}
8+
9+
<div class="hero--big lazyload" data-bg="{{site.url}}/assets/img/main_banner.jpg">
10+
<div class="hero__wrap">
11+
<h1 class="hero__title">Android Code</h1>
12+
<p class="hero__meta">Android online treasury knowledge</p>
13+
</div>
14+
</div>
15+
16+
{% include footer.html %}
17+
18+
</body>
19+
20+
</html>

_layouts/page.html

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<h1 class="hero__title">{{ page.title }}</h1>
1212
</div>
1313
</div>
14+
1415
<main class="site__content">
1516

1617
<div class="container">

_pages/articles.md

-7
This file was deleted.

_pages/categories.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
layout: page
3+
title: Categories
4+
permalink: /categories/
5+
---
6+
7+
{% for tag in site.categories %}
8+
<h3 id="{{ tag[0] }}">{{ tag[0] | capitalize }}</h3>
9+
<ul>
10+
{% assign pages_list = tag[1] %}
11+
{% for post in pages_list %}
12+
{% if post.title != null %}
13+
{% if group == null or group == post.group %}
14+
<li>
15+
<a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a>
16+
<span class="entry-date">
17+
<time datetime="{{ post.date | date_to_xmlschema }}" itemprop="datePublished">{{ post.date | date: "%B %d, %Y" }}</time>
18+
</span>
19+
</li>
20+
{% endif %}
21+
{% endif %}
22+
{% endfor %}
23+
{% assign pages_list = nil %}
24+
{% assign group = nil %}
25+
</ul>
26+
{% endfor %}

assets/css/main.css

+29
Original file line numberDiff line numberDiff line change
@@ -1386,6 +1386,35 @@ table th,table td {
13861386
background: rgba(52,56,81,0.8);
13871387
}
13881388

1389+
.hero--big {
1390+
margin: 3.75rem auto 0;
1391+
min-height: 25.25rem;
1392+
width: 100%;
1393+
position: relative;
1394+
background-color: #dde5ea;
1395+
background-repeat: no-repeat;
1396+
background-position: 50%;
1397+
background-size: cover;
1398+
}
1399+
1400+
@media (min-width: 62em) {
1401+
.hero--big {
1402+
margin: 0 auto;
1403+
height: 48em;
1404+
}
1405+
}
1406+
1407+
.hero--big::before {
1408+
position: absolute;
1409+
display: block;
1410+
content: "";
1411+
top: 0;
1412+
left: 0;
1413+
width: 100%;
1414+
height: 100%;
1415+
background: rgba(52,56,81,0.8);
1416+
}
1417+
13891418
.hero--small {
13901419
margin: 3.75rem auto 0;
13911420
min-height: 8.75rem;

blog/index.html

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
layout: blog
3+
title: Blog
4+
---

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
layout: default
2+
layout: home
33
title: Home page
44
---
55

0 commit comments

Comments
 (0)