Skip to content

Commit dd5d159

Browse files
committed
blog added
1 parent 6122ca7 commit dd5d159

File tree

117 files changed

+6409
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+6409
-9
lines changed

.gitignore

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# OS X
2+
.DS_Store
3+
4+
# Jekyll build
5+
/_site/
6+
.jekyll-metadata
7+
#Gemfile.lock
8+
9+
# webstorm
10+
.idea/
11+
12+
# others
13+
*.swp
14+
15+
# site build
16+
*.gem
17+
*.rbc
18+
.bundle
19+
.config
20+
coverage
21+
InstalledFiles
22+
lib/bundler/man
23+
pkg
24+
rdoc
25+
spec/reports
26+
test/tmp
27+
test/version_tmp
28+
tmp
29+
vendor
30+
Gemfile.lock
31+
node_modules

.travis.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
sudo: false
2+
language: ruby
3+
cache: bundler
4+
rvm:
5+
- 2.5.1
6+
7+
install:
8+
# Install Jekyll and dependencies
9+
- bundle install
10+
11+
script: bundle exec rake site:deploy --quiet #--trace
12+
13+
# Generate your secure token with the travis gem:
14+
# get Github token from your Travis CI profile page
15+
# gem install travis
16+
# GH_TOKEN from https://github.com/settings/tokens
17+
# travis encrypt 'GIT_NAME="YOUR_USERNAME" GIT_EMAIL="YOUR_EMAIL" GH_TOKEN=YOUR_TOKEN'
18+
env:
19+
global:
20+
secure: "hGpEWbQXMoZDTKAyG4AEKT/Q8CzjJ7TAT4ZDKDmYsIeDjw9IYLVpG9dMArpguHP9eHzcZn1sX/WTWLm8d1fdBGZgUXcKOXb1b8SFKd/A9SNJhIAYlpW9xde6LgUpbOywFfbH93+vkXGiHTxbvdf5ESRrYD8wGGgTKSUAv7/2IPaA9Ea3JX2XMT0v4MIAIndat5SDrcjgLasHev7P8hQo8k4Rjx94axbJUHKImDPl+sAwCtrD3kWikAGwcrnBNoaYw8QBj6tG3XH4RbAbSu4U5GKABOBJNbSq5R9W7jdvTY81oxH/PWTOeIeQBQQk+ekRrtb/GTdVBrLVuevs++63EW5OEARZJCpLLliD/NszhuxNHh7PgNJvO4rLjnxZk3b/QbjbNXzsACFKI0WU0PEaYeGxNB+2oVRuMyw4gtO7DVcCTO1ZC/zsO/DOoajzbsenpn76PR0JykeNcu8u3YvNG2sD9NoUFAtw9bzJK1/PaYNhOL1sF9EUBVqUE9aZYGbp1nqLuhgsBdF5YwzZ2yGX2bKIUnVMvyLnUiZMN1Sr/siglUqsmXRvtQPD/GAVrgr74DvfWcuXk6TnLl4csHtK61abSGJwsBwlvdovq/Rrrm4wfqXqJ801l3+EGUXJtaOO+ghDw4M5aTo3Qwcsf9gkwj9kZE+eljxTL7irxwxmlWU="
21+
branches:
22+
only:
23+
- master

404.html

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
layout: error
3+
current: error
4+
title: "404 - Page Not Found"
5+
permalink: 404.html
6+
---
7+
<!--
8+
This error template is used for all 404 errors, which might occur on your site.
9+
It's a good idea to keep this template as minimal as possible in terms of both file size and complexity.
10+
-->
11+
12+
<!DOCTYPE html>
13+
<html>
14+
<head>
15+
<meta charset="utf-8" />
16+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
17+
<title>{{ page.title }}</title>
18+
<meta name="HandheldFriendly" content="True" />
19+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
20+
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}assets/built/screen.css" />
21+
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}assets/built/screen.edited.css" />
22+
<!-- This tag outputs SEO meta+structured data and other important settings -->
23+
{% include head.html %}
24+
</head>
25+
<body class="error-template">
26+
<div class="site-wrapper">
27+
28+
<header class="site-header outer {% if page.cover %}" style="background-image: url({{ site.baseurl }}{{ page.cover }})){% else %}no-cover{% endif %}">
29+
<div class="inner">
30+
<nav class="site-nav-center">
31+
{% if site.logo %}
32+
<a class="site-nav-logo" href="{{ site.baseurl }}"><img src="{{site.baseurl}}{{ site.logo }}" alt="{{ site.title }}" /></a>
33+
{% else %}
34+
<a class="site-nav-logo" href="{{ site.baseurl }}">{{ site.title }}</a>
35+
{% endif %}
36+
</nav>
37+
</div>
38+
</header>
39+
40+
<main id="site-main" class="site-main outer" role="main">
41+
<div class="inner">
42+
43+
<section class="error-message">
44+
<h1 class="error-code">404</h1>
45+
<p class="error-description">Page not found</p>
46+
<a class="error-link" href="{{ site.baseurl }}">Go to the front page →</a>
47+
</section>
48+
</div>
49+
</main>
50+
51+
<!-- get "posts" limit="3" -->
52+
<aside class="outer">
53+
<div class="inner">
54+
<div class="post-feed">
55+
<!-- The tag below includes the markup for each post - partials/post-card.hbs -->
56+
{% include post-card-error.html %}
57+
</div>
58+
</div>
59+
</aside>
60+
<!-- /get -->
61+
62+
</div>
63+
</body>
64+
</html>

GHOST.txt

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) 2013-2017 Ghost Foundation - Released under The MIT License.
2+
3+
Permission is hereby granted, free of charge, to any person
4+
obtaining a copy of this software and associated documentation
5+
files (the "Software"), to deal in the Software without
6+
restriction, including without limitation the rights to use,
7+
copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the
9+
Software is furnished to do so, subject to the following
10+
conditions:
11+
12+
The above copyright notice and this permission notice shall be
13+
included in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.

Gemfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
source "https://rubygems.org"
2+
3+
gem "jekyll", "~> 3.7.4"
4+
gem "github-pages", "~> 192"
5+
gem "rake", "~> 12.3.1"

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Fábio Madeira
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
## Jasper2
2+
3+
[![Build Status](https://travis-ci.org/jekyller/jasper2.svg?branch=master)](https://travis-ci.org/jekyller/jasper2)
4+
[![Ruby](https://img.shields.io/badge/ruby-2.5.1-blue.svg?style=flat)](http://travis-ci.org/jekyller/jasper2)
5+
[![Jekyll](https://img.shields.io/badge/jekyll-3.7.4-blue.svg?style=flat)](http://travis-ci.org/jekyller/jasper2)
6+
7+
This is a full-featured port of Ghost's default theme [Casper](https://github.com/tryghost/casper)
8+
*v2.1.9* for [Jekyll](https://jekyllrb.com/) / [GitHub Pages](https://pages.github.com/).
9+
10+
## Live Demo
11+
12+
[Ghost's Casper](https://demo.ghost.io) // [Jasper2](https://jekyller.github.io/jasper2)
13+
14+
![home page](https://raw.githubusercontent.com/jekyller/jasper2/master/assets/screenshot-desktop.jpg)
15+
16+
17+
## Features
18+
19+
* Out of the box support for multiple authors (via `_data/authors.yml`)
20+
* Full author information including: picture, bio, website, twitter, facebook, etc.
21+
* Tag description(s) and personalised covers (via `_data/tags.yml`)
22+
* Related posts view at the bottom of each post
23+
* All Ghost default pages: Author page(s), Tag page(s), About page(s), 404, etc.
24+
* Pagination (infinite scrolling or standard pagination, i.e. posts across multiple pages)
25+
* Atom Feeds by [Jekyll-feed](https://github.com/jekyll/jekyll-feed)
26+
* Toggleable subscribe button (requires an external service)
27+
* Code Syntax Highlight with [highlight.js](https://highlightjs.org/)
28+
* Support for Google Analytics tracking
29+
* Support for Disqus comments (not Ghost standard)
30+
31+
32+
## Getting Started
33+
34+
### Deployment
35+
36+
**Important:** For security reasons, Github does not allow plugins (under `_plugins/`) when
37+
deploying with Github Pages. This means:
38+
39+
**1)** that we need to generate your site locally (more details below) and push the resulting
40+
HTML (the contents of `_site/` or `../jasper2-pages/`) to a Github repository, that GitHub Pages
41+
then host;
42+
43+
**2)** built the site with [travis-ci](https://travis-ci.org/) (with goodies from
44+
[jekyll-travis](https://github.com/mfenner/jekyll-travis)) automatically pushing the
45+
generated HTML files to a *gh-pages* branch.
46+
This later approach is the one I am currently using to generate the live demo.
47+
48+
**3)** deploy the static website with Jekyll-compatible hosters, such as https://www.netlify.com/, that allow for deployment from the Github repo and publish the website using CDNs. Netlify has a free starter offer.
49+
50+
For option **1)** simply clone this repository (*master branch*), and then run
51+
`bundle exec jekyll serve` inside the directory. Upload the resulting `_site/` (or `../jasper2-pages/`)
52+
contents to your repository (*master branch* if uploading as your personal page
53+
(e.g. username.github.io) or *gh-pages branch* if uploading as a project page
54+
(as for the [demo](https://github.com/jekyller/jasper2/tree/gh-pages)).
55+
56+
For option **2)** you will need to set up travis-ci for your personal fork. Briefly all you
57+
need then is to change your details in *[\_config.yml](_config.yml)* so that you can push
58+
to your github repo. You will also need to generate a secure key to add to your
59+
*[.travis.yml](.travis.yml)* (you can find more info on how to do it in that file).
60+
Also make sure you read the documentation from
61+
[jekyll-travis](https://github.com/mfenner/jekyll-travis). This approach has clear
62+
advantages in that you simply push your file changes to GitHub and all the HTML files
63+
are generated for you and pushed to *gh-pages*. Also you get to know if everything is
64+
still fine with your site builds. Don't hesitate to contact me if you still have any
65+
issues (see below about issue tracking).
66+
67+
### Author Pages
68+
69+
In order to properly generate author pages you need to rename the field *author* in the
70+
front matter of every post to match that of your each author's *username* as defined
71+
in the *[\_data/authors.yml](_data/authors.yml)* file.
72+
With the latest update, multiple author blogs are now supported out of the box.
73+
74+
### Compiling Styles
75+
76+
Following on the way Casper styles are compiled as [described here](https://github.com/tryghost/casper#development):
77+
78+
Jasper2 styles are compiled using Gulp/PostCSS to polyfill future CSS spec. You'll need Node and Gulp installed globally. After that, from the theme's root directory:
79+
80+
```bash
81+
$ npm install
82+
$ gulp
83+
```
84+
85+
Now you can edit `/assets/css/` files, which will be compiled to `/assets/built/` automatically.
86+
87+
## Issues and Contributing
88+
89+
This install builds well with Ruby v2.5.1 and Jekyll v3.7.4. If you run into any problems
90+
please log them on the [issue tracker](https://github.com/jekyller/jasper2/issues).
91+
92+
Feel free pull-request your patches and fixes.
93+
94+
## Thanks
95+
96+
97+
Many thanks to the Ghost team for all the design work. Also many thanks to all contributors,
98+
that help keeping the project alive and updated :smile:
99+
100+
101+
## Copyright & License
102+
103+
Same licence as the one provided by Ghost's team. See Casper's theme [license](GHOST.txt).
104+
105+
Copyright (C) 2015-2018 - Released under the MIT License.
106+
107+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
108+
109+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
110+
111+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
112+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Rakefile

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#############################################################################
2+
#
3+
# Modified version of jekyllrb Rakefile
4+
# https://github.com/jekyll/jekyll/blob/master/Rakefile
5+
#
6+
#############################################################################
7+
8+
require 'rake'
9+
require 'date'
10+
require 'yaml'
11+
12+
CONFIG = YAML.load(File.read('_config.yml'))
13+
USERNAME = CONFIG["username"]
14+
REPO = CONFIG["repo"]
15+
SOURCE_BRANCH = CONFIG["branch"]
16+
DESTINATION_BRANCH = "gh-pages"
17+
CNAME = CONFIG["CNAME"]
18+
19+
def check_destination
20+
unless Dir.exist? CONFIG["destination"]
21+
sh "git clone https://$GIT_NAME:[email protected]/#{USERNAME}/#{REPO}.git #{CONFIG["destination"]}"
22+
end
23+
end
24+
25+
namespace :site do
26+
desc "Generate the site"
27+
task :build do
28+
check_destination
29+
sh "bundle exec jekyll build"
30+
end
31+
32+
desc "Generate the site and serve locally"
33+
task :serve do
34+
check_destination
35+
sh "bundle exec jekyll serve"
36+
end
37+
38+
desc "Generate the site, serve locally and watch for changes"
39+
task :watch do
40+
sh "bundle exec jekyll serve --watch"
41+
end
42+
43+
desc "Generate the site and push changes to remote origin"
44+
task :deploy do
45+
# Detect pull request
46+
if ENV['TRAVIS_PULL_REQUEST'].to_s.to_i > 0
47+
puts 'Pull request detected. Not proceeding with deploy.'
48+
exit
49+
end
50+
51+
# Configure git if this is run in Travis CI
52+
if ENV["TRAVIS"]
53+
sh "git config --global user.name $GIT_NAME"
54+
sh "git config --global user.email $GIT_EMAIL"
55+
sh "git config --global push.default simple"
56+
end
57+
58+
# Make sure destination folder exists as git repo
59+
check_destination
60+
61+
sh "git checkout #{SOURCE_BRANCH}"
62+
Dir.chdir(CONFIG["destination"]) { sh "git checkout #{DESTINATION_BRANCH}" }
63+
64+
# Generate the site
65+
sh "bundle exec jekyll build"
66+
67+
# Commit and push to github
68+
sha = `git log`.match(/[a-z0-9]{40}/)[0]
69+
Dir.chdir(CONFIG["destination"]) do
70+
# check if there is anything to add and commit, and pushes it
71+
sh "if [ -n '$(git status)' ]; then
72+
echo '#{CNAME}' > ./CNAME;
73+
git add --all .;
74+
git commit -m 'Updating to #{USERNAME}/#{REPO}@#{sha}.';
75+
git push --quiet origin #{DESTINATION_BRANCH};
76+
fi"
77+
puts "Pushed updated branch #{DESTINATION_BRANCH} to GitHub Pages"
78+
end
79+
end
80+
end

0 commit comments

Comments
 (0)