Skip to content

Commit

Permalink
Style home page
Browse files Browse the repository at this point in the history
  • Loading branch information
chesterhow committed Mar 11, 2017
1 parent 6273da5 commit a0208bb
Show file tree
Hide file tree
Showing 12 changed files with 152 additions and 41 deletions.
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ permalink: pretty

# Setup
title: Tale
tagline: What's your story?
subtitle: by Chester
paginate: 1
baseurl: ""
url: ""
Expand Down
3 changes: 2 additions & 1 deletion _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

<title>
{% if page.title == "Home" %}
{{ site.title }} &middot; {{ site.tagline }}
{{ site.title }} &middot; {{ site.subtitle }}
{% else %}
{{ page.title }} &middot; {{ site.title }}
{% endif %}
</title>

<!-- CSS -->
<link rel="stylesheet" href="{{ site.baseurl }}/styles.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Libre+Baskerville:400,400i,700">
</head>
10 changes: 6 additions & 4 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
<body>

<div class="container">
<h3>
<a href="{{ site.baseurl }}/" title="Home">{{ site.title }}</a>
<small>{{ site.tagline }}</small>
</h3>
<header>
<a href="{{ site.baseurl }}/" title="Home">
<h2>{{ site.title }}</h2>
</a>
<h4>{{ site.subtitle }}</h4>
</header>

<main>
{{ content }}
Expand Down
3 changes: 3 additions & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
layout: default
---
16 changes: 16 additions & 0 deletions _posts/2017-03-09-welcome-to-jekyll.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
layout: post
title: "Introducing Tale"
date: 2017-03-09 12:32:48 +0800
categories: jekyll update
synopsys: "Tale is a minimal Jekyll theme for writers. Find out more here."
---
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.

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.

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].

[jekyll-docs]: https://jekyllrb.com/docs/home
[jekyll-gh]: https://github.com/jekyll/jekyll
[jekyll-talk]: https://talk.jekyllrb.com/
13 changes: 2 additions & 11 deletions _posts/2017-03-10-welcome-to-jekyll.markdown
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
---
layout: post
title: "Welcome to Jekyll!"
title: "Introducing Tale"
date: 2017-03-10 12:32:48 +0800
categories: jekyll update
synopsys: "Tale is a minimal Jekyll theme for writers. Find out more here."
---
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.

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.

Jekyll also offers powerful support for code snippets:

{% highlight ruby %}
def print_hi(name)
puts "Hi, #{name}"
end
print_hi('Tom')
#=> prints 'Hi, Tom' to STDOUT.
{% endhighlight %}

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].

[jekyll-docs]: https://jekyllrb.com/docs/home
Expand Down
17 changes: 0 additions & 17 deletions _sass/_base.scss

This file was deleted.

39 changes: 39 additions & 0 deletions _sass/_home.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.post-preview {
margin-bottom: 30px;
position: relative;

time {
color: $default-tint;
font-size: 1.3em;
font-weight: 500;
letter-spacing: .3px;
}

h1 {
color: $default-shade;
font-size: 3.5em;
margin: 5px 0 10px;
}

p {
color: $default-color;
font-family: $serif-font;
font-size: 1em;
line-height: 1.5em;
margin: 0 0 5px;
text-align: justify;
}

.post-link {
text-align: right;
}

a {
color: $default-tint;
display: inline-block;
font-size: 1.3em;
font-weight: 500;
letter-spacing: .3px;
text-decoration: none;
}
}
45 changes: 45 additions & 0 deletions _sass/_layout.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,50 @@
* {
@include box-sizing;
}

html,
body {
margin: 0;
padding: 0;
}

html {
font-family: $sans-font;
font-size: $default-font-size;
}

.container {
margin: 0 auto;
max-width: 1200px;
width: 80%;
}

header {
margin: 20px 0;
text-align: center;

* {
margin: 0;
}

a {
text-decoration: none;
}

h2 {
@include transition(all .3s ease-out);
color: $default-color;
display: inline-block;
font-size: 3em;

&:hover {
opacity: .6;
}
}

h4 {
color: $default-tint;
font-family: $serif-font;
font-weight: 400;
}
}
25 changes: 25 additions & 0 deletions _sass/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
$default-color: #555555;
$default-shade: #353535;
$default-tint: #AAAAAA;

$serif-font: 'Libre Baskerville';
$sans-font: 'Helvetica Neue';
$default-font-size: 14px;

@mixin box-sizing($type: border-box) {
-webkit-box-sizing: $type;
-moz-box-sizing: $type;
box-sizing: $type;
}

@mixin transition($args...) {
-webkit-transition: $args;
-moz-transition: $args;
transition: $args;
}

@mixin transform-translate($x, $y) {
-webkit-transform: translate($x, $y);
-moz-transform: translate($x, $y);
transform: translate($x, $y);
}
17 changes: 11 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
title: Home
---

<div>
{% for post in site.posts %}
<h1>{{ post.title }}</h1>
{% for post in site.posts %}
<div class="post-preview">
<time datetime="{{ post.date }}">{{ post.date | date_to_string }}</time>
<h1>{{ post.title }}</h1>

<p>{{ post.content | truncatewords: 70 | strip_html }}</p>


{{ post.content }}
{% endfor %}
</div>
<div class="post-link">
<a href="{{ post.url }}">continue reading</a>
</div>
</div>
{% endfor %}
3 changes: 2 additions & 1 deletion styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
# only main files contain this front matter, not partials.
---

@import 'base';
@import 'variables';
@import 'layout';
@import 'home';

0 comments on commit a0208bb

Please sign in to comment.