Skip to content

Commit 4e4b007

Browse files
committed
Merge branch 'master' of https://github.com/daattali/beautiful-jekyll into master
Conflicts: _config.yml _includes/head.html
2 parents 85b6697 + 325de7b commit 4e4b007

13 files changed

+186
-22
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# Beautiful Jekyll
22

3-
**Beautiful Jekyll** is a ready-to-use template to help you create an awesome website quickly. Perfect for personal blogs or simple project websites. [Check out a demo](http://deanattali.com/beautiful-jekyll) of what you'll get after just two minutes. You can look at [my personal website](http://deanattali.com) to see it in use, or see examples of websites other people created using this theme [here](#featured-users-success-stories).
3+
**Beautiful Jekyll** is a ready-to-use template to help you create an awesome website quickly. Perfect for personal blogs or simple project websites. [Check out a demo](http://deanattali.com/beautiful-jekyll) of what you'll get after just two minutes. You can also look at [my personal website](http://deanattali.com) to see it in use, or see examples of websites other people created using this theme [here](#featured-users-success-stories).
44

5-
Feel free to modify this in any way you'd like, but I would appreciate it if you don't remove the attribution to Beautiful Jekyll. I've noticed that many people copy this website and deliberately remove the tiny phrase that gives me credit, and it feels a bit sad to not get credit for the countless hours I've put into this. Don't make me sad!
6-
7-
If you need a bit of help or have comments, feel free to [contact me](http://deanattali.com/aboutme#contact). Even if you don't have anything important to say but found this useful, I'd love to [hear about it](http://deanattali.com/aboutme#contact). Lastly, if you like this theme, please consider [supporting me with a small donation](http://deanattali.com/aboutme#feed-meeee) if you want to make me extra happy. :)
5+
If you need a bit of help or have comments, feel free to [contact me](http://deanattali.com/aboutme#contact). Even if you don't have anything important to say but found this useful, I'd love to [hear about it](http://deanattali.com/aboutme#contact). Lastly, if you like this theme, please consider [supporting me](https://www.paypal.me/daattali/20) if you want to make me extra happy. :)
86

97
This template is built on top of [Jekyll](http://jekyllrb.com/) and can be used for any [GitHub Pages](https://pages.github.com/) website. (If you don't know what these two things are, that's absolutely fine, you don't need to!)
108

@@ -124,7 +122,7 @@ subtitle | Short description of page or blog post that goes under the title
124122
bigimg | Include a large full-width image at the top of the page. You can either give the path to a single image, or provide a list of images to cycle through (see [my personal website](http://deanattali.com/) as an example).
125123
comments | If you want do add Disqus comments to a specific page, use `comments: true`. Comments are automatically enabled on blog posts; to turn comments off for a specific post, use `comments: false`. Comments only work if you set your Disqus id in the `_config.yml` file.
126124
show-avatar | If you have an avatar configured in the `_config.yml` but you want to turn it off on a specific page, use `show-avatar: false`. If you want to turn it off by default, locate the line `show-avatar: true` in the file `_config.yml` and change the `true` to `false`; then you can selectively turn it on in specific pages using `show-avatar: true`.
127-
fb-img | If you want to share a page on Facebook, by default Facebook will use the first image it can find on the page. If you want to specify an image to use when sharing the page on Facebook, then provide the image's URL here
125+
share-img | If you want to specify an image to use when sharing the page on Facebook or Twitter, then provide the image's full URL here.
128126
layout | What type of page this is (default is `blog` for blog posts and `page` for other pages. You can use `minimal` if you don't want a header and footer)
129127
js | List of local JavaScript files to include in the page (eg. `/js/mypage.js`)
130128
ext-js | List of external JavaScript files to include in the page (eg. `//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.2/underscore-min.js`)
@@ -152,7 +150,7 @@ I wrote [a blog post](http://deanattali.com/2015/03/12/beautiful-jekyll-how-to-b
152150

153151
### Featured users (success stories!)
154152

155-
To my huge surprise, Beautiful Jekyll has been used in over 500 websites in its first 6 months. Here is a hand-picked selection of some websites that use Beautiful Jekyll.
153+
To my huge surprise, Beautiful Jekyll has been used in over 500 websites in its first 6 months alone! Here is a hand-picked selection of some websites that use Beautiful Jekyll.
156154

157155
Want your website featured here? [Contact me](http://deanattali.com/aboutme#contact) to let me know about your website.
158156

@@ -169,6 +167,7 @@ Want your website featured here? [Contact me](http://deanattali.com/aboutme#cont
169167
| [organicrails.github.io](http://organicrails.github.io) | Ruby on Rails tutorial |
170168
| [esentire.github.io](https://esentire.github.io) | Blog about threats and malware |
171169
| [reactionic.github.io](http://reactionic.github.io) | Create iOS and Android apps with React and Ionic |
170+
| [ja2-stracciatella.github.io](http://ja2-stracciatella.github.io) | Jagged Alliance 2 Stracciatella |
172171

173172
#### Personal websites
174173

@@ -183,11 +182,11 @@ Want your website featured here? [Contact me](http://deanattali.com/aboutme#cont
183182
| [chaitanyajoshi.xyz](http://chaitanyajoshi.xyz/) | Chaitanya Joshi | Computer Science undergrad |
184183
| [chauff.github.io](http://chauff.github.io/) | Claudia Hauff | Professor at Delft University of Technology |
185184
| [kootenpv.github.io](http://kootenpv.github.io/) | Pascal van Kooten | Data analytics |
186-
185+
| [sjackman.ca](http://sjackman.ca) | Shaun Jackman | PhD candidate in bioinformatics |
187186

188187
### Very advanced: Local development
189188

190-
Beautiful Jekyll is meant to be so simple to use that you can do it all within the browser. However, if you'd like to develop locally on your own machine, that's possible too if you're comfortable with command line. Folow these simple steps to do that with Vagrant:
189+
Beautiful Jekyll is meant to be so simple to use that you can do it all within the browser. However, if you'd like to develop locally on your own machine, that's possible too if you're comfortable with command line. Follow these simple steps to do that with Vagrant:
191190

192191
1. Install [VirtualBox](http://virtualbox.org) and [Vagrant](https://www.vagrantup.com)
193192
2. Clone your fork `git clone git@github.com:yourusername/yourusername.github.io.git`
@@ -197,6 +196,8 @@ Beautiful Jekyll is meant to be so simple to use that you can do it all within t
197196

198197
Disclaimer: I personally am NOT using local development so I don't know much about running Jekyll locally. If you follow this route, please don't ask me questions because unfortunately I honestly won't be able to help!
199198

199+
Additionally, if you choose to deploy Jekyll using a local ruby installation, you can tell Jekyll to automatically categorize your blog posts by tags. You just need to set `link-tags: true` in `_config.yml`. Jekyll will then generate a new page for each unique tag which lists all of the posts that belong to that tag.
200+
200201
### Credits
201202

202203
This template was not made entirely from scratch. I would like to give special thanks to:

_config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ author:
5252
#facebook: yourname # eg. daattali
5353
github: ProofGeneral
5454
#twitter: yourname # eg. daattali
55-
#linkedin: yourlink # eg. "pub/dean-attali/8/946/143"
55+
#linkedin: yourlink # eg. daattali
5656
#stackoverflow: yourlink # eg. "3943160/daattali"
5757

5858
# Select which links to show in the footer
@@ -107,6 +107,9 @@ defaults:
107107
layout: "page"
108108
show-avatar: true
109109

110+
# Use tags pages (not recommended if you are deploying via GitHub pages, only set to true if deploying locally with ruby)
111+
link-tags: false
112+
110113
# Exclude these files from production site
111114
exclude:
112115
- Gemfile

_includes/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
{% endif %}
4646
{% if site.author.linkedin and site.footer-links-active.linkedin %}
4747
<li>
48-
<a href="https://linkedin.com/{{ site.author.linkedin }}" title="LinkedIn">
48+
<a href="https://linkedin.com/in/{{ site.author.linkedin }}" title="LinkedIn">
4949
<span class="fa-stack fa-lg">
5050
<i class="fa fa-circle fa-stack-2x"></i>
5151
<i class="fa fa-linkedin fa-stack-1x fa-inverse"></i>

_includes/head.html

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,13 @@
5252
<!-- Facebook OpenGraph tags -->
5353
<meta property="og:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}" />
5454
<meta property="og:type" content="website" />
55-
5655
{% if page.id %}
57-
<meta property="og:url" content="{{ site.url }}{{ page.url }}/" />
56+
<meta property="og:url" content="{{ site.url }}{{ page.url }}" />
5857
{% else %}
5958
<meta property="og:url" content="{{ site.url }}{{ page.url | remove: '/index.html' | remove: '.html' }}" />
6059
{% endif %}
61-
62-
{% if page.fb-img %}
63-
<meta property="og:image" content="{{ page.fb-img }}" />
60+
{% if page.share-img %}
61+
<meta property="og:image" content="{{ page.share-img }}" />
6462
{% elsif site.avatar %}
6563
<meta property="og:image" content="{{ site.url }}{{ site.avatar }}" />
6664
{% else %}
@@ -86,4 +84,16 @@
8684
<meta name="msapplication-TileImage" content="/mstile-144x144.png">
8785
<meta name="theme-color" content="#ffffff">
8886

87+
<!-- Twitter summary cards -->
88+
<meta name="twitter:card" content="summary" />
89+
<meta name="twitter:site" content="@{{ site.author.twitter }}" />
90+
<meta name="twitter:creator" content="@{{ site.author.twitter }}" />
91+
<meta name="twitter:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}" />
92+
<meta name="twitter:description" content="{{ page.content | strip_html | xml_escape | truncatewords: 50 }}" />
93+
{% if page.share-img %}
94+
<meta name="twitter:image" content="{{ page.share-img }}" />
95+
{% elsif site.avatar %}
96+
<meta name="twitter:image" content="{{ site.url }}{{ site.avatar }}" />
97+
{% endif %}
98+
8999
</head>

_layouts/post.html

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,20 @@
88
<div class="row">
99
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
1010
<article role="main" class="blog-post">
11-
{{ content }}
12-
</article>
13-
11+
{{ content }}
12+
</article>
13+
{% if page.tags.size > 0 %}
14+
<div class="blog-tags">
15+
Tags:
16+
{% if site.link-tags %}
17+
{% for tag in page.tags %}
18+
<a href="/tag/{{ tag }}">{{ tag }}</a>
19+
{% endfor %}
20+
{% else %}
21+
{{ page.tags | join: ", " }}
22+
{% endif %}
23+
</div>
24+
{% endif %}
1425
<ul class="pager blog-pager">
1526
{% if page.previous.url %}
1627
<li class="previous">

_layouts/tag_index.html

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
layout: default
3+
---
4+
5+
<h2 class="post_title">{{page.title}}:</h2>
6+
7+
<div class="posts-list">
8+
{% for post in site.posts %}
9+
{% for tag in post.tags %}
10+
{% if tag == page.tag %}
11+
<article class="post-preview">
12+
<a href="{{ post.url | prepend: site.baseurl }}">
13+
<h3 class="post-title">{{ post.title }}</h3>
14+
15+
{% if post.subtitle %}
16+
<h4 class="post-subtitle">
17+
{{ post.subtitle }}
18+
</h4>
19+
{% endif %}
20+
</a>
21+
22+
<p class="post-meta">
23+
Posted on {{ post.date | date: "%B %-d, %Y" }}
24+
</p>
25+
26+
<div class="post-entry">
27+
{{ post.content | strip_html | xml_escape | truncatewords: 50 }}
28+
<a href="{{ post.url | prepend: site.baseurl }}" class="post-read-more">[Read&nbsp;More]</a>
29+
</div>
30+
31+
<div class="blog-tags">
32+
Tags:
33+
{% for tag in post.tags %}
34+
<a href="/tag/{{ tag }}">{{ tag }}</a>
35+
{% endfor %}
36+
</div>
37+
</article>
38+
{% endif %}
39+
{% endfor %}
40+
{% endfor %}
41+
</div>

_plugins/_tag_gen.rb

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
module Jekyll
2+
class TagIndex < Page
3+
def initialize(site, base, dir, tag)
4+
@site = site
5+
@base = base
6+
@dir = dir
7+
@name = 'index.html'
8+
self.process(@name)
9+
self.read_yaml(File.join(base, '_layouts'), 'tag_index.html')
10+
self.data['tag'] = tag
11+
tag_title_prefix = site.config['tag_title_prefix'] || 'Posts Tagged &ldquo;'
12+
tag_title_suffix = site.config['tag_title_suffix'] || '&rdquo;'
13+
self.data['title'] = "#{tag_title_prefix}#{tag}#{tag_title_suffix}"
14+
end
15+
end
16+
class TagGenerator < Generator
17+
safe true
18+
def generate(site)
19+
if site.layouts.key? 'tag_index'
20+
dir = site.config['tag_dir'] || 'tag'
21+
site.tags.keys.each do |tag|
22+
write_tag_index(site, File.join(dir, tag), tag)
23+
end
24+
end
25+
end
26+
def write_tag_index(site, dir, tag)
27+
index = TagIndex.new(site, site.source, dir, tag)
28+
index.render(site.layouts, site.site_payload)
29+
index.write(site.dest)
30+
site.pages << index
31+
end
32+
end
33+
end

_posts_demo/2015-01-04-first-post.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: post
33
title: First post!
4+
tags: [random, exciting-stuff]
45
---
56

6-
This is my first post, how exciting!
7+
This is my first post, how exciting!

_posts_demo/2015-01-15-pirates.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: post
33
title: Pirates arrrr
4+
tags: [pirates, random]
45
---
56

6-
Piracy is typically an act of robbery or criminal violence at sea. The term can include acts committed on land, in the air, or in other major bodies of water or on a shore. It does not normally include crimes committed against persons traveling on the same vessel as the perpetrator (e.g. one passenger stealing from others on the same vessel). The term has been used throughout history to refer to raids across land borders by non-state agents.
7+
Piracy is typically an act of robbery or criminal violence at sea. The term can include acts committed on land, in the air, or in other major bodies of water or on a shore. It does not normally include crimes committed against persons traveling on the same vessel as the perpetrator (e.g. one passenger stealing from others on the same vessel). The term has been used throughout history to refer to raids across land borders by non-state agents.

_posts_demo/2015-01-27-dear-diary.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: post
33
title: Dear diary
4+
tags: [random, diary, school]
45
---
56

6-
What is it with that Mary girl? Dragging me to school every day. As if I had a choice. What you don't hear in those nursery rhymes is that she starves me if I don't go to school with her; it's the only way I can stay alive! I'm thinking about being adopted by Little Bo Peep, sure I may get lost, but anything is better than being with Mary and those little brats at school (shudder, shudder).
7+
What is it with that Mary girl? Dragging me to school every day. As if I had a choice. What you don't hear in those nursery rhymes is that she starves me if I don't go to school with her; it's the only way I can stay alive! I'm thinking about being adopted by Little Bo Peep, sure I may get lost, but anything is better than being with Mary and those little brats at school (shudder, shudder).

css/main.css

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,38 @@ footer .theme-by {
331331
}
332332
}
333333

334+
/* --- Tags --- */
335+
336+
.blog-tags {
337+
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
338+
color: #999;
339+
font-size: 15px;
340+
margin-bottom: 30px;
341+
}
342+
343+
.blog-tags a {
344+
color: #008AFF;
345+
text-decoration: none;
346+
padding: 0px 5px;
347+
}
348+
349+
.blog-tags a:hover {
350+
border-radius: 2px;
351+
color: #008AFF;
352+
background-color: #CCC;
353+
}
354+
355+
.post-preview .blog-tags {
356+
margin-top: 5px;
357+
margin-bottom: 0;
358+
}
359+
360+
@media only screen and (min-width: 768px) {
361+
.post-preview .blog-tags {
362+
margin-top: 10px;
363+
}
364+
}
365+
334366
/* --- Post and page headers --- */
335367

336368
.intro-header {
@@ -552,3 +584,20 @@ table tr th :last-child,
552584
table tr td :last-child {
553585
margin-bottom: 0;
554586
}
587+
588+
/* --- Code blocks --- */
589+
590+
pre {
591+
font-size: 16px;
592+
line-height: 1.5em;
593+
background: #FAFAFA;
594+
background-image: linear-gradient(#FAFAFA 50%, #FDFDFD 50%);
595+
background-position: 0px 10px;
596+
background-repeat: repeat;
597+
background-size: 3em 3em;
598+
border-left: 7px solid #444;
599+
}
600+
601+
pre code {
602+
white-space: pre;
603+
}

css/pygment_highlights.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.highlight { background: #ffffff; }
1+
/* .highlight { background: #ffffff; } Dean commented out */
22
.highlight pre { background-color: #fff; font-size: 16px }
33
.highlight .c { color: #999988; font-style: italic } /* Comment */
44
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */

news/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ <h3 class="post-subtitle">
2626
<a href="{{ post.url | prepend: site.baseurl }}" class="post-read-more">[Read&nbsp;More]</a>
2727
</div>
2828

29+
{% if post.tags.size > 0 %}
30+
<div class="blog-tags">
31+
Tags:
32+
{% if site.link-tags %}
33+
{% for tag in post.tags %}
34+
<a href="{{ site.baseurl }}/tag/{{ tag }}">{{ tag }}</a>
35+
{% endfor %}
36+
{% else %}
37+
{{ post.tags | join: ", " }}
38+
{% endif %}
39+
</div>
40+
{% endif %}
41+
2942
</article>
3043
{% endfor %}
3144
</div>

0 commit comments

Comments
 (0)