mirror of
https://github.com/meineerde/holgerjust.de.git
synced 2025-10-17 17:01:01 +00:00
middleman init holgerjust.de --template=casper
We use the casper theme from https://github.com/danielbayerlein/middleman-casper in version 34ec5aa9e2a7f179146a5e21d31b4ba61e2bd926
This commit is contained in:
commit
97ea6575af
18
.gitignore
vendored
Normal file
18
.gitignore
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
||||
#
|
||||
# If you find yourself ignoring temporary files generated by your text editor
|
||||
# or operating system, you probably want to add a global ignore instead:
|
||||
# git config --global core.excludesfile ~/.gitignore_global
|
||||
|
||||
# Ignore bundler config
|
||||
/.bundle
|
||||
|
||||
# Ignore the build directory
|
||||
/build
|
||||
|
||||
# Ignore cache
|
||||
/.sass-cache
|
||||
/.cache
|
||||
|
||||
# Ignore .DS_store file
|
||||
.DS_Store
|
||||
17
Gemfile
Normal file
17
Gemfile
Normal file
@ -0,0 +1,17 @@
|
||||
# If you have OpenSSL installed, we recommend updating the following line to
|
||||
# use "https".
|
||||
source 'http://rubygems.org'
|
||||
|
||||
gem 'middleman', '~> 3.4.0'
|
||||
gem 'middleman-blog', '~> 3.5.3'
|
||||
gem 'middleman-livereload', '~> 3.4.3'
|
||||
|
||||
# For feed.xml.builder
|
||||
gem 'builder', '~> 3.2.2'
|
||||
|
||||
# Code syntax highlighting
|
||||
gem 'middleman-syntax', '~> 2.0.0'
|
||||
gem 'redcarpet', '~> 3.3.2'
|
||||
|
||||
# For "summary"-Helper
|
||||
gem 'nokogiri', '~> 1.6.6.2'
|
||||
151
Gemfile.lock
Normal file
151
Gemfile.lock
Normal file
@ -0,0 +1,151 @@
|
||||
GEM
|
||||
remote: http://rubygems.org/
|
||||
specs:
|
||||
activesupport (4.2.4)
|
||||
i18n (~> 0.7)
|
||||
json (~> 1.7, >= 1.7.7)
|
||||
minitest (~> 5.1)
|
||||
thread_safe (~> 0.3, >= 0.3.4)
|
||||
tzinfo (~> 1.1)
|
||||
addressable (2.3.8)
|
||||
builder (3.2.2)
|
||||
capybara (2.4.4)
|
||||
mime-types (>= 1.16)
|
||||
nokogiri (>= 1.3.3)
|
||||
rack (>= 1.0.0)
|
||||
rack-test (>= 0.5.4)
|
||||
xpath (~> 2.0)
|
||||
chunky_png (1.3.4)
|
||||
coffee-script (2.4.1)
|
||||
coffee-script-source
|
||||
execjs
|
||||
coffee-script-source (1.9.1.1)
|
||||
compass (1.0.3)
|
||||
chunky_png (~> 1.2)
|
||||
compass-core (~> 1.0.2)
|
||||
compass-import-once (~> 1.0.5)
|
||||
rb-fsevent (>= 0.9.3)
|
||||
rb-inotify (>= 0.9)
|
||||
sass (>= 3.3.13, < 3.5)
|
||||
compass-core (1.0.3)
|
||||
multi_json (~> 1.0)
|
||||
sass (>= 3.3.0, < 3.5)
|
||||
compass-import-once (1.0.5)
|
||||
sass (>= 3.2, < 3.5)
|
||||
em-websocket (0.5.1)
|
||||
eventmachine (>= 0.12.9)
|
||||
http_parser.rb (~> 0.6.0)
|
||||
erubis (2.7.0)
|
||||
eventmachine (1.0.8)
|
||||
execjs (2.6.0)
|
||||
ffi (1.9.10)
|
||||
haml (4.0.7)
|
||||
tilt
|
||||
hike (1.2.3)
|
||||
hooks (0.4.1)
|
||||
uber (~> 0.0.14)
|
||||
http_parser.rb (0.6.0)
|
||||
i18n (0.7.0)
|
||||
json (1.8.3)
|
||||
kramdown (1.8.0)
|
||||
listen (3.0.3)
|
||||
rb-fsevent (>= 0.9.3)
|
||||
rb-inotify (>= 0.9)
|
||||
middleman (3.4.0)
|
||||
coffee-script (~> 2.2)
|
||||
compass (>= 1.0.0, < 2.0.0)
|
||||
compass-import-once (= 1.0.5)
|
||||
execjs (~> 2.0)
|
||||
haml (>= 4.0.5)
|
||||
kramdown (~> 1.2)
|
||||
middleman-core (= 3.4.0)
|
||||
middleman-sprockets (>= 3.1.2)
|
||||
sass (>= 3.4.0, < 4.0)
|
||||
uglifier (~> 2.5)
|
||||
middleman-blog (3.5.3)
|
||||
addressable (~> 2.3.5)
|
||||
middleman-core (~> 3.2)
|
||||
tzinfo (>= 0.3.0)
|
||||
middleman-core (3.4.0)
|
||||
activesupport (~> 4.1)
|
||||
bundler (~> 1.1)
|
||||
capybara (~> 2.4.4)
|
||||
erubis
|
||||
hooks (~> 0.3)
|
||||
i18n (~> 0.7.0)
|
||||
listen (~> 3.0.3)
|
||||
padrino-helpers (~> 0.12.3)
|
||||
rack (>= 1.4.5, < 2.0)
|
||||
thor (>= 0.15.2, < 2.0)
|
||||
tilt (~> 1.4.1, < 2.0)
|
||||
middleman-livereload (3.4.3)
|
||||
em-websocket (~> 0.5.1)
|
||||
middleman-core (>= 3.3)
|
||||
rack-livereload (~> 0.3.15)
|
||||
middleman-sprockets (3.4.2)
|
||||
middleman-core (>= 3.3)
|
||||
sprockets (~> 2.12.1)
|
||||
sprockets-helpers (~> 1.1.0)
|
||||
sprockets-sass (~> 1.3.0)
|
||||
middleman-syntax (2.0.0)
|
||||
middleman-core (~> 3.2)
|
||||
rouge (~> 1.0)
|
||||
mime-types (2.6.1)
|
||||
mini_portile (0.6.2)
|
||||
minitest (5.8.0)
|
||||
multi_json (1.11.2)
|
||||
nokogiri (1.6.6.2)
|
||||
mini_portile (~> 0.6.0)
|
||||
padrino-helpers (0.12.5)
|
||||
i18n (~> 0.6, >= 0.6.7)
|
||||
padrino-support (= 0.12.5)
|
||||
tilt (~> 1.4.1)
|
||||
padrino-support (0.12.5)
|
||||
activesupport (>= 3.1)
|
||||
rack (1.6.4)
|
||||
rack-livereload (0.3.16)
|
||||
rack
|
||||
rack-test (0.6.3)
|
||||
rack (>= 1.0)
|
||||
rb-fsevent (0.9.5)
|
||||
rb-inotify (0.9.5)
|
||||
ffi (>= 0.5.0)
|
||||
redcarpet (3.3.2)
|
||||
rouge (1.9.1)
|
||||
sass (3.4.18)
|
||||
sprockets (2.12.4)
|
||||
hike (~> 1.2)
|
||||
multi_json (~> 1.0)
|
||||
rack (~> 1.0)
|
||||
tilt (~> 1.1, != 1.3.0)
|
||||
sprockets-helpers (1.1.0)
|
||||
sprockets (~> 2.0)
|
||||
sprockets-sass (1.3.1)
|
||||
sprockets (~> 2.0)
|
||||
tilt (~> 1.1)
|
||||
thor (0.19.1)
|
||||
thread_safe (0.3.5)
|
||||
tilt (1.4.1)
|
||||
tzinfo (1.2.2)
|
||||
thread_safe (~> 0.1)
|
||||
uber (0.0.14)
|
||||
uglifier (2.7.1)
|
||||
execjs (>= 0.3.0)
|
||||
json (>= 1.8.0)
|
||||
xpath (2.0.0)
|
||||
nokogiri (~> 1.3)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
builder (~> 3.2.2)
|
||||
middleman (~> 3.4.0)
|
||||
middleman-blog (~> 3.5.3)
|
||||
middleman-livereload (~> 3.4.3)
|
||||
middleman-syntax (~> 2.0.0)
|
||||
nokogiri (~> 1.6.6.2)
|
||||
redcarpet (~> 3.3.2)
|
||||
|
||||
BUNDLED WITH
|
||||
1.10.6
|
||||
155
README.md
Normal file
155
README.md
Normal file
@ -0,0 +1,155 @@
|
||||
# middleman-casper
|
||||
|
||||
[](https://github.com/TryGhost/Casper)
|
||||
|
||||
The [Casper](https://github.com/TryGhost/Casper) theme
|
||||
([Ghost](https://github.com/TryGhost/Ghost)) for
|
||||
[Middleman-Blog](http://middlemanapp.com/basics/blogging/).
|
||||
|
||||
## Installation
|
||||
|
||||
1. Clone **middleman-casper** into `~/.middleman`.
|
||||
You will need to create this directory if it doesn't exist.
|
||||
```bash
|
||||
$ git clone https://github.com/danielbayerlein/middleman-casper.git ~/.middleman/casper
|
||||
```
|
||||
|
||||
2. Create a new project with the template:
|
||||
```bash
|
||||
$ middleman init blog --template=casper
|
||||
```
|
||||
|
||||
3. Change the `casper` settings in `config.rb`.
|
||||
|
||||
## Usage
|
||||
|
||||
Start a local web server running at `http://localhost:4567/` with:
|
||||
|
||||
```bash
|
||||
$ middleman server
|
||||
```
|
||||
|
||||
Create a static file with:
|
||||
|
||||
```bash
|
||||
$ middleman build
|
||||
```
|
||||
|
||||
For help, see the official [Middleman](http://middlemanapp.com) website.
|
||||
|
||||
### Author
|
||||
|
||||
Configurable in *config.rb*:
|
||||
|
||||
```ruby
|
||||
set :casper, {
|
||||
...
|
||||
author: {
|
||||
name: 'Middleman'
|
||||
}
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
### Navigation
|
||||
|
||||
Configurable in *config.rb*:
|
||||
|
||||
```ruby
|
||||
set :casper, {
|
||||
...
|
||||
navigation: {
|
||||
"Home" => "/",
|
||||
"GitHub" => "https://github.com",
|
||||
"Author" => "/author/middleman/"
|
||||
}
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
### Logo
|
||||
|
||||
Configurable in *config.rb*:
|
||||
|
||||
```ruby
|
||||
set :casper, {
|
||||
...
|
||||
blog: {
|
||||
logo: 'my-awesome-blog-logo.png' # sources/images/my-awesome-blog-logo.png
|
||||
}
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
### Pages
|
||||
|
||||
Content of *example.html.markdown*:
|
||||
|
||||
```markdown
|
||||
---
|
||||
title: Example
|
||||
layout: page
|
||||
---
|
||||
|
||||
Welcome!
|
||||
|
||||
```
|
||||
|
||||
### Covers
|
||||
|
||||
Covers are availible in pages and articles. Content of *example.html.markdown*:
|
||||
|
||||
```markdown
|
||||
---
|
||||
title: Example
|
||||
layout: page
|
||||
cover: my-awesome-blog-cover.png # sources/images/my-awesome-blog-cover.png
|
||||
---
|
||||
|
||||
Welcome!
|
||||
|
||||
```
|
||||
|
||||
## Update middleman-casper to the latest version
|
||||
|
||||
```bash
|
||||
$ git remote add middleman-casper https://github.com/danielbayerlein/middleman-casper.git
|
||||
$ git pull middleman-casper master
|
||||
```
|
||||
|
||||
## Special Thanks
|
||||
|
||||
* [Ghost Foundation](https://github.com/TryGhost/Ghost) for
|
||||
[Casper](https://github.com/TryGhost/Casper)
|
||||
|
||||
## Contributing
|
||||
|
||||
1. Fork it
|
||||
2. Create your feature branch (`git checkout -b my-new-feature`)
|
||||
3. Commit your changes (`git commit -am 'Add some feature'`)
|
||||
4. Push to the branch (`git push origin my-new-feature`)
|
||||
5. Create new [Pull Request](../../pull/new/master)
|
||||
|
||||
## License
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Daniel Bayerlein
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
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 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.
|
||||
149
config.rb
Normal file
149
config.rb
Normal file
@ -0,0 +1,149 @@
|
||||
###
|
||||
# Blog settings
|
||||
###
|
||||
|
||||
# Time.zone = "UTC"
|
||||
|
||||
activate :blog do |blog|
|
||||
# This will add a prefix to all links, template references and source paths
|
||||
# blog.prefix = "blog"
|
||||
|
||||
# blog.permalink = "{year}/{month}/{day}/{title}.html"
|
||||
# Matcher for blog source files
|
||||
blog.sources = "articles/{year}-{month}-{day}-{title}.html"
|
||||
blog.taglink = "tag/{tag}.html"
|
||||
# blog.layout = "layout"
|
||||
# blog.summary_separator = /(READMORE)/
|
||||
# blog.summary_length = 250
|
||||
# blog.year_link = "{year}.html"
|
||||
# blog.month_link = "{year}/{month}.html"
|
||||
# blog.day_link = "{year}/{month}/{day}.html"
|
||||
# blog.default_extension = ".markdown"
|
||||
|
||||
blog.tag_template = "tag.html"
|
||||
# blog.calendar_template = "calendar.html"
|
||||
|
||||
# Enable pagination
|
||||
blog.paginate = true
|
||||
# blog.per_page = 10
|
||||
# blog.page_link = "page/{num}"
|
||||
end
|
||||
|
||||
set :casper, {
|
||||
blog: {
|
||||
url: 'http://www.example.com',
|
||||
name: 'Middleman',
|
||||
description: 'Makes developing websites simple.',
|
||||
date_format: '%d %B %Y',
|
||||
navigation: true,
|
||||
logo: nil # Optional
|
||||
},
|
||||
author: {
|
||||
name: 'Middleman',
|
||||
bio: nil, # Optional
|
||||
location: nil, # Optional
|
||||
website: nil, # Optional
|
||||
gravatar_email: nil # Optional
|
||||
},
|
||||
navigation: {
|
||||
"Home" => "/"
|
||||
}
|
||||
}
|
||||
|
||||
page '/feed.xml', layout: false
|
||||
page '/sitemap.xml', layout: false
|
||||
|
||||
ignore '/partials/*'
|
||||
|
||||
ready do
|
||||
blog.tags.each do |tag, articles|
|
||||
proxy "/tag/#{tag.downcase.parameterize}/feed.xml", '/feed.xml', layout: false do
|
||||
@tagname = tag
|
||||
@articles = articles[0..5]
|
||||
end
|
||||
end
|
||||
|
||||
proxy "/author/#{blog_author.name.parameterize}.html", '/author.html', ignore: true
|
||||
end
|
||||
|
||||
###
|
||||
# Compass
|
||||
###
|
||||
|
||||
# Change Compass configuration
|
||||
# compass_config do |config|
|
||||
# config.output_style = :compact
|
||||
# end
|
||||
|
||||
###
|
||||
# Page options, layouts, aliases and proxies
|
||||
###
|
||||
|
||||
# Per-page layout changes:
|
||||
#
|
||||
# With no layout
|
||||
# page "/path/to/file.html", layout: false
|
||||
#
|
||||
# With alternative layout
|
||||
# page "/path/to/file.html", layout: :otherlayout
|
||||
#
|
||||
# A path which all have the same layout
|
||||
# with_layout :admin do
|
||||
# page "/admin/*"
|
||||
# end
|
||||
|
||||
# Proxy pages (http://middlemanapp.com/basics/dynamic-pages/)
|
||||
# proxy "/this-page-has-no-template.html", "/template-file.html", locals: {
|
||||
# which_fake_page: "Rendering a fake page with a local variable" }
|
||||
|
||||
###
|
||||
# Helpers
|
||||
###
|
||||
|
||||
# Automatic image dimensions on image_tag helper
|
||||
# activate :automatic_image_sizes
|
||||
|
||||
# Reload the browser automatically whenever files change
|
||||
activate :livereload
|
||||
|
||||
# Pretty URLs - http://middlemanapp.com/basics/pretty-urls/
|
||||
activate :directory_indexes
|
||||
|
||||
# Middleman-Syntax - https://github.com/middleman/middleman-syntax
|
||||
set :haml, { ugly: true }
|
||||
set :markdown_engine, :redcarpet
|
||||
set :markdown, fenced_code_blocks: true, smartypants: true
|
||||
activate :syntax, line_numbers: false
|
||||
|
||||
# Methods defined in the helpers block are available in templates
|
||||
# helpers do
|
||||
# def some_helper
|
||||
# "Helping"
|
||||
# end
|
||||
# end
|
||||
|
||||
set :css_dir, 'stylesheets'
|
||||
|
||||
set :js_dir, 'javascripts'
|
||||
|
||||
set :images_dir, 'images'
|
||||
|
||||
set :partials_dir, 'partials'
|
||||
|
||||
# Build-specific configuration
|
||||
configure :build do
|
||||
# For example, change the Compass output style for deployment
|
||||
# activate :minify_css
|
||||
|
||||
# Minify Javascript on build
|
||||
# activate :minify_javascript
|
||||
|
||||
# Enable cache buster
|
||||
# activate :asset_hash
|
||||
|
||||
# Use relative URLs
|
||||
# activate :relative_assets
|
||||
|
||||
# Or use a different image path
|
||||
# set :http_prefix, "/Content/images/"
|
||||
end
|
||||
120
helpers/middleman_casper_helpers.rb
Normal file
120
helpers/middleman_casper_helpers.rb
Normal file
@ -0,0 +1,120 @@
|
||||
require 'ostruct'
|
||||
require 'digest/md5'
|
||||
|
||||
module MiddlemanCasperHelpers
|
||||
def page_title
|
||||
title = blog_settings.name.dup
|
||||
if is_tag_page?
|
||||
title << ": #{current_resource.metadata[:locals]['tagname']}"
|
||||
elsif current_page.data.title
|
||||
title << ": #{current_page.data.title}"
|
||||
elsif is_blog_article?
|
||||
title << ": #{current_article.title}"
|
||||
end
|
||||
title
|
||||
end
|
||||
|
||||
def page_description
|
||||
if is_blog_article?
|
||||
body = strip_tags(current_article.body).gsub(/\s+/, ' ')
|
||||
truncate(body, length: 147)
|
||||
else
|
||||
blog_settings.description
|
||||
end
|
||||
end
|
||||
|
||||
def page_class
|
||||
if is_blog_article? || current_page.data.layout == 'page'
|
||||
'post-template'
|
||||
elsif current_resource.metadata[:locals]['page_number'].to_i > 1
|
||||
'archive-template'
|
||||
else
|
||||
'home-template'
|
||||
end
|
||||
end
|
||||
|
||||
def summary(article)
|
||||
summary_length = article.blog_options[:summary_length]
|
||||
strip_tags(article.summary(summary_length, ''))
|
||||
end
|
||||
|
||||
def read_next_summary(article, words)
|
||||
body = strip_tags(article.body)
|
||||
truncate_words(body, length: words, omission: '')
|
||||
end
|
||||
|
||||
def blog_author
|
||||
OpenStruct.new(casper[:author])
|
||||
end
|
||||
|
||||
def blog_settings
|
||||
OpenStruct.new(casper[:blog])
|
||||
end
|
||||
|
||||
def navigation
|
||||
casper[:navigation]
|
||||
end
|
||||
|
||||
def is_tag_page?
|
||||
current_resource.metadata[:locals]['page_type'] == 'tag'
|
||||
end
|
||||
def tags?(article = current_article)
|
||||
article.tags.present?
|
||||
end
|
||||
def tags(article = current_article, separator = ', ')
|
||||
capture_haml do
|
||||
article.tags.each do |tag|
|
||||
haml_tag(:a, tag, href: tag_path(tag))
|
||||
haml_concat(separator) unless article.tags.last == tag
|
||||
end
|
||||
end.gsub("\n", '')
|
||||
end
|
||||
|
||||
def current_article_url
|
||||
URI.join(blog_settings.url, current_article.url)
|
||||
end
|
||||
|
||||
def cover(page = current_page)
|
||||
if (src = page.data.cover).present?
|
||||
{ style: "background-image: url(#{image_path(src)})" }
|
||||
else
|
||||
{ class: 'no-cover' }
|
||||
end
|
||||
end
|
||||
def cover?(page = current_page)
|
||||
page.data.cover.present?
|
||||
end
|
||||
|
||||
def gravatar(size = 68)
|
||||
md5 = Digest::MD5.hexdigest(blog_author.gravatar_email.downcase)
|
||||
"https://www.gravatar.com/avatar/#{md5}?size=#{size}"
|
||||
end
|
||||
def gravatar?
|
||||
blog_author.gravatar_email.present?
|
||||
end
|
||||
|
||||
def twitter_url
|
||||
"https://twitter.com/share?text=#{current_article.title}" \
|
||||
"&url=#{current_article_url}"
|
||||
end
|
||||
def facebook_url
|
||||
"https://www.facebook.com/sharer/sharer.php?u=#{current_article_url}"
|
||||
end
|
||||
def google_plus_url
|
||||
"https://plus.google.com/share?url=#{current_article_url}"
|
||||
end
|
||||
|
||||
def feed_path
|
||||
if is_tag_page?
|
||||
"#{current_page.url.to_s}feed.xml"
|
||||
else
|
||||
"#{blog.options.prefix.to_s}/feed.xml"
|
||||
end
|
||||
end
|
||||
def home_path
|
||||
"#{blog.options.prefix.to_s}/"
|
||||
end
|
||||
def author_path
|
||||
"#{blog.options.prefix.to_s}/author/#{blog_author.name.parameterize}/"
|
||||
end
|
||||
end
|
||||
83
source/articles/2013-10-26-welcome-to-ghost.html.markdown
Normal file
83
source/articles/2013-10-26-welcome-to-ghost.html.markdown
Normal file
@ -0,0 +1,83 @@
|
||||
---
|
||||
title: Welcome to Ghost
|
||||
date: 2013-10-26
|
||||
tags: Getting Started
|
||||
layout: post
|
||||
---
|
||||
|
||||
You're in! Nice. We've put together a little post to introduce you to the Ghost
|
||||
editor and get you started. Go ahead and edit this post to get going and learn
|
||||
how it all works!
|
||||
|
||||
## Getting Started
|
||||
|
||||
Writing in markdown is really easy. In the left hand panel of Ghost, you simply
|
||||
write as you normally would. Where appropriate, you can use _formatting_
|
||||
shortcuts to style your content. For example, a list:
|
||||
|
||||
* Item number one
|
||||
* Item number two
|
||||
* A nested item
|
||||
* A final item
|
||||
|
||||
or with numbers!
|
||||
|
||||
1. Remember to buy some milk
|
||||
2. Drink the milk
|
||||
3. Tweet that I remembered to buy the milk, and drank it
|
||||
|
||||
## Links
|
||||
|
||||
Want to link to a source? No problem. If you paste in url, like
|
||||
[http://ghost.org](http://ghost.org/) - it'll automatically be linked up. But
|
||||
if you want to customise your anchor text, you can do that too! Here's a link to
|
||||
[the Ghost website](http://ghost.org/). Neat.
|
||||
|
||||
## What about Images?
|
||||
|
||||
Images work too! Already know the URL of the image you want to include in your
|
||||
article? Simply paste it in like this to make it show up:
|
||||
|
||||

|
||||
|
||||
Not sure which image you want to use yet? That's ok too. Leave yourself a
|
||||
descriptive placeholder and keep writing. Come back later and drag and drop the
|
||||
image in to upload:
|
||||
|
||||
## Quoting
|
||||
|
||||
Sometimes a link isn't enough, you want to quote someone on what they've said.
|
||||
It was probably very wisdomous. Is wisdomous a word? Find out in a future
|
||||
release when we introduce spellcheck! For now - it's definitely a word.
|
||||
|
||||
> Wisdomous - it's definitely a word.
|
||||
|
||||
## Working with Code
|
||||
|
||||
Got a streak of geek? We've got you covered there, too. You can write inline
|
||||
`<code>` blocks really easily with back ticks. Want to show off something more
|
||||
comprehensive? 4 spaces of indentation gets you there.
|
||||
|
||||
```
|
||||
awesome-thing {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
```
|
||||
|
||||
## Ready for a Break?
|
||||
|
||||
Throw 3 or more dashes down on any new line and you've got yourself a fancy new
|
||||
divider. Aw yeah.
|
||||
|
||||
---
|
||||
|
||||
## Advanced Usage
|
||||
|
||||
There's one fantastic secret about Markdown. If you want, you can write plain
|
||||
old HTML and it'll still work! Very flexible.
|
||||
|
||||
<input type="text" placeholder="I'm an input field!">
|
||||
|
||||
That should be enough to get you started. Have fun - and let us know what you
|
||||
think :)
|
||||
35
source/author.html.haml
Normal file
35
source/author.html.haml
Normal file
@ -0,0 +1,35 @@
|
||||
---
|
||||
pageable: true
|
||||
per_page: 6
|
||||
---
|
||||
|
||||
%header.main-header.author-head{cover}
|
||||
%nav.main-nav.overlay.clearfix
|
||||
- if blog_settings.logo.present?
|
||||
%a.blog-logo{href: home_path}
|
||||
= image_tag blog_settings.logo, alt: blog_settings.name
|
||||
- if blog_settings.navigation
|
||||
%a.menu-button.icon-menu{href: '#'}
|
||||
%span.word Menu
|
||||
|
||||
%section.author-profile.inner
|
||||
- if gravatar?
|
||||
%figure.author-image
|
||||
.img{style: "background-image: url(#{gravatar(114)})"}
|
||||
%span.hidden #{blog_author.name}'s Picture
|
||||
%h1.author-title= blog_author.name
|
||||
- if blog_author.bio.present?
|
||||
%h2.author-bio= blog_author.bio
|
||||
.author-meta
|
||||
- if blog_author.location.present?
|
||||
%span.author-location.icon-location= blog_author.location
|
||||
- if blog_author.website.present?
|
||||
%span.author-link.icon-link
|
||||
%a{href: blog_author.website}= blog_author.website
|
||||
%span.author-stats
|
||||
%i.icon-stats
|
||||
= pluralize(blog.articles.count, 'post')
|
||||
|
||||
%main#content.content{role: :main}
|
||||
= partial(:page_articles,
|
||||
locals: { page_articles: page_articles, paginate: paginate })
|
||||
27
source/feed.xml.builder
Normal file
27
source/feed.xml.builder
Normal file
@ -0,0 +1,27 @@
|
||||
@articles ||= blog.articles[0..5]
|
||||
title = settings.casper[:blog][:name]
|
||||
subtitle = settings.casper[:blog][:description]
|
||||
|
||||
xml.instruct!
|
||||
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
|
||||
site_url = settings.casper[:blog][:url]
|
||||
xml.title @tagname.present? ? "#{title}: #{@tagname}" : title
|
||||
xml.subtitle @tagname.present? ? "Posts tagged with #{@tagname}" : subtitle
|
||||
xml.id URI.join(site_url, blog.options.prefix.to_s)
|
||||
xml.link "href" => URI.join(site_url, blog.options.prefix.to_s)
|
||||
xml.link "href" => URI.join(site_url, current_page.path), "rel" => "self"
|
||||
xml.updated blog.articles.first.date.to_time.iso8601
|
||||
xml.author { xml.name settings.casper[:author][:name] }
|
||||
|
||||
@articles.each do |article|
|
||||
xml.entry do
|
||||
xml.title article.title
|
||||
xml.link "rel" => "alternate", "href" => URI.join(site_url, article.url)
|
||||
xml.id URI.join(site_url, article.url)
|
||||
xml.published article.date.to_time.iso8601
|
||||
xml.updated File.mtime(article.source_file).iso8601
|
||||
xml.author { xml.name settings.casper[:author][:name] }
|
||||
xml.summary summary(article), "type" => "html"
|
||||
end
|
||||
end
|
||||
end
|
||||
BIN
source/fonts/casper-icons.eot
Normal file
BIN
source/fonts/casper-icons.eot
Normal file
Binary file not shown.
20
source/fonts/casper-icons.svg
Normal file
20
source/fonts/casper-icons.svg
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Generated by IcoMoon</metadata>
|
||||
<defs>
|
||||
<font id="icomoon" horiz-adv-x="512">
|
||||
<font-face units-per-em="512" ascent="480" descent="-32" />
|
||||
<missing-glyph horiz-adv-x="512" />
|
||||
<glyph unicode=" " d="" horiz-adv-x="256" />
|
||||
<glyph unicode="" d="M0 480v-102.4h307.2v102.4h-307.2zM0 275.2v-102.4h512v102.4h-512zM0 70.4v-102.4h204.8v102.4h-204.8zM307.2 70.4v-102.4h204.8v102.4h-204.8zM409.6 480v-102.4h102.4v102.4h-102.4z" />
|
||||
<glyph unicode="" d="M421.344-32c-0.4 229.616-200.752 417.264-421.344 417.696v94.304c270.656 0 512-230.304 512-512h-90.656zM343.6-31.968h-90.608c0.304 56.384-28.336 119.488-73.664 166.736-45.072 47.632-124.96 77.648-179.104 77.36v94.272c169.040-3.648 339.936-163.312 343.376-338.368zM64.256 96.048c35.312 0 63.936-28.656 63.936-64 0-35.328-28.624-63.984-63.936-63.984s-63.936 28.656-63.936 63.984c0 35.344 28.624 64 63.936 64z" />
|
||||
<glyph unicode="" d="M512 382.791c-18.838-8.354-39.082-14.001-60.33-16.54 21.686 13 38.343 33.585 46.186 58.115-20.298-12.039-42.778-20.78-66.705-25.49-19.16 20.415-46.461 33.17-76.673 33.17-58.011 0-105.044-47.029-105.044-105.039 0-8.233 0.929-16.25 2.72-23.939-87.3 4.382-164.701 46.2-216.509 109.753-9.042-15.514-14.223-33.558-14.223-52.809 0-36.444 18.544-68.596 46.73-87.433-17.219 0.546-33.416 5.271-47.577 13.139-0.010-0.438-0.010-0.878-0.010-1.321 0-50.894 36.209-93.348 84.261-103-8.813-2.4-18.094-3.686-27.674-3.686-6.769 0-13.349 0.66-19.764 1.886 13.368-41.73 52.16-72.103 98.126-72.948-35.95-28.175-81.243-44.967-130.458-44.967-8.479 0-16.84 0.497-25.058 1.47 46.486-29.805 101.701-47.197 161.021-47.197 193.211 0 298.868 160.062 298.868 298.872 0 4.554-0.103 9.084-0.305 13.59 20.528 14.81 38.336 33.31 52.418 54.374z" />
|
||||
<glyph unicode="" d="M0.403 45.168c-0.122 1.266-0.226 2.535-0.292 3.815 0.065-1.28 0.17-2.549 0.292-3.815zM117.954 197.426c46.005-1.369 76.867 46.349 68.931 106.599-7.947 60.24-51.698 108.584-97.704 109.961-46.013 1.365-76.87-44.741-68.926-105 7.941-60.234 51.676-110.187 97.699-111.56zM512 352v42.655c0 46.94-38.391 85.345-85.329 85.345h-341.328c-46.138 0-84.006-37.116-85.282-82.963 29.181 25.693 69.662 47.158 111.437 47.158 44.652 0 178.622 0 178.622 0l-39.974-33.809h-56.634c37.565-14.402 57.578-58.062 57.578-102.861 0-37.624-20.905-69.977-50.444-92.984-28.822-22.451-34.286-31.854-34.286-50.939 0-16.289 30.873-44 47.016-55.394 47.191-33.269 62.458-64.156 62.458-115.728 0-8.214-1.021-16.415-3.033-24.48h153.871c46.937 0 85.328 38.375 85.328 85.345v266.654h-96v-95.999h-32v96h-95.999v32h95.999v96h32v-96h96zM92.943 97.032c10.807 0 20.711 0.295 30.968 0.295-13.573 13.167-24.313 29.3-24.313 49.19 0 11.804 3.782 23.168 9.067 33.26-5.391-0.385-10.895-0.497-16.563-0.497-37.178 0-68.753 12.038-92.102 31.927v-33.621l0.003-100.865c26.72 12.687 58.444 20.311 92.94 20.311zM1.71 36.371c-0.556 2.729-0.983 5.503-1.271 8.317 0.287-2.814 0.715-5.588 1.271-8.317zM227.725 3.577c-7.529 29.403-34.227 43.982-71.444 69.784-13.536 4.366-28.447 6.937-44.447 7.104-44.809 0.482-86.554-17.471-110.108-44.186 7.96-38.853 42.517-68.279 83.617-68.279h143.222c0.908 5.564 1.348 11.316 1.348 17.216 0 6.267-0.767 12.396-2.188 18.361z" />
|
||||
<glyph unicode="" d="M426.672 480h-341.33c-46.936 0-85.342-38.407-85.342-85.344v-341.313c0-46.969 38.406-85.343 85.342-85.343l341.33 0.001c46.938 0 85.328 38.373 85.328 85.344v341.311c0 46.937-38.391 85.344-85.328 85.344zM435.296 224h-83.296v-224h-96v224h-46.263v73.282h46.263v47.593c0 64.671 27.896 103.125 103.935 103.125h87.622v-79.285h-71.565c-21.241 0.035-23.876-11.076-23.876-31.756l-0.116-39.677h96l-12.704-73.282z" />
|
||||
<glyph unicode="" d="M368.615 34.099c6.861-6.938 6.861-18.125 0-25.063s-17.945-6.938-24.807 0l-200.448 202.419c-6.861 6.938-6.861 18.15 0 25.063l200.448 202.445c6.861 6.938 17.945 6.938 24.807 0s6.861-18.125 0-25.063l-182.784-189.901 182.784-189.901z" />
|
||||
<glyph unicode="" d="M435.2 454.4h-56.32c-14.131 0-20.48-11.469-20.48-25.6v-435.2h102.4v435.2c0 14.131-11.443 25.6-25.6 25.6zM281.6 300.8h-56.32c-14.131 0-20.48-11.469-20.48-25.6v-281.6h102.4v281.6c0 14.131-11.443 25.6-25.6 25.6zM128 147.2h-56.32c-14.131 0-20.48-11.443-20.48-25.6v-128h102.4v128c0 14.157-11.469 25.6-25.6 25.6z" />
|
||||
<glyph unicode="" d="M256 428.8c-70.707 0-128-57.319-128-128 0-122.214 128-281.6 128-281.6s128 159.386 128 281.6c0 70.681-57.293 128-128 128zM256 230.144c-38.169 0-69.12 30.951-69.12 69.12s30.951 69.12 69.12 69.12 69.12-30.951 69.12-69.12-30.95-69.12-69.12-69.12z" />
|
||||
<glyph unicode="" d="M201.19 103.834l-20.736-20.582c-17.971-17.792-47.181-17.817-65.126 0-8.627 8.576-13.363 19.917-13.363 32.026s4.761 23.475 13.363 32.051l76.288 75.699c15.795 15.693 45.542 38.759 67.226 17.255 9.959-9.881 26.035-9.805 35.891 0.128 9.882 9.933 9.83 26.010-0.128 35.891-36.839 36.557-91.315 29.798-138.752-17.255l-76.288-75.699c-18.279-18.176-28.365-42.343-28.365-68.070 0-25.702 10.087-49.869 28.391-68.045 18.841-18.714 43.571-28.032 68.301-28.032s49.511 9.318 68.352 28.032l20.736 20.608c9.958 9.882 10.010 25.959 0.128 35.865-9.881 9.933-25.958 9.984-35.917 0.128zM432.409 397.85c-39.577 39.27-94.899 41.395-131.558 5.043l-25.831-25.626c-9.959-9.882-10.035-25.933-0.154-35.891 9.907-9.958 25.959-10.010 35.891-0.128l25.83 25.625c18.969 18.841 43.827 11.034 60.058-5.043 8.627-8.55 13.363-19.942 13.363-32.026 0-12.109-4.762-23.475-13.363-32.026l-81.408-80.742c-37.197-36.915-54.682-19.61-62.131-12.211-9.958 9.882-26.010 9.805-35.865-0.128-9.881-9.959-9.831-26.035 0.128-35.891 17.075-16.947 36.608-25.344 57.037-25.344 25.037 0 51.481 12.595 76.621 37.555l81.382 80.743c18.304 18.151 28.39 42.317 28.39 68.019s-10.087 49.894-28.39 68.070z" />
|
||||
<glyph unicode="" d="M64 362.667h384q8.834 0 15.084-6.25t6.25-15.083-6.25-15.084-15.084-6.25h-384q-8.834 0-15.084 6.25t-6.25 15.084 6.25 15.083 15.084 6.25zM64 106.667h384q8.834 0 15.084-6.25t6.25-15.084-6.25-15.084-15.084-6.25h-384q-8.834 0-15.084 6.25t-6.25 15.084 6.25 15.084 15.084 6.25zM64 234.667h384q8.834 0 15.084-6.25t6.25-15.084-6.25-15.084-15.084-6.25h-384q-8.834 0-15.084 6.25t-6.25 15.084 6.25 15.084 15.084 6.25z" />
|
||||
</font></defs></svg>
|
||||
|
After Width: | Height: | Size: 6.1 KiB |
BIN
source/fonts/casper-icons.ttf
Normal file
BIN
source/fonts/casper-icons.ttf
Normal file
Binary file not shown.
BIN
source/fonts/casper-icons.woff
Normal file
BIN
source/fonts/casper-icons.woff
Normal file
Binary file not shown.
BIN
source/images/favicon.ico
Normal file
BIN
source/images/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 318 B |
23
source/index.html.haml
Normal file
23
source/index.html.haml
Normal file
@ -0,0 +1,23 @@
|
||||
---
|
||||
pageable: true
|
||||
per_page: 6
|
||||
---
|
||||
|
||||
%header.main-header{cover}
|
||||
%nav.main-nav.overlay.clearfix
|
||||
- if blog_settings.logo.present?
|
||||
%a.blog-logo{href: home_path}
|
||||
= image_tag blog_settings.logo, alt: blog_settings.name
|
||||
- if blog_settings.navigation
|
||||
%a.menu-button.icon-menu{href: '#'}
|
||||
%span.word Menu
|
||||
.vertical
|
||||
.main-header-content.inner
|
||||
%h1.page-title= blog_settings.name
|
||||
%h2.page-description= blog_settings.description
|
||||
%a.scroll-down.icon-arrow-left{href: '#content', data: {offset: '-45'}}
|
||||
%span.hidden Scroll Down
|
||||
|
||||
%main#content.content{role: :main}
|
||||
= partial(:page_articles,
|
||||
locals: { page_articles: page_articles, paginate: paginate })
|
||||
2
source/javascripts/application.js.coffee
Normal file
2
source/javascripts/application.js.coffee
Normal file
@ -0,0 +1,2 @@
|
||||
#= require vendor/jquery-1.11.2
|
||||
#= require vendor/casper
|
||||
53
source/javascripts/vendor/casper.js
vendored
Normal file
53
source/javascripts/vendor/casper.js
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
/**
|
||||
* Main JS file for Casper behaviours
|
||||
*/
|
||||
|
||||
/* globals jQuery, document */
|
||||
(function ($, undefined) {
|
||||
"use strict";
|
||||
|
||||
var $document = $(document);
|
||||
|
||||
$document.ready(function () {
|
||||
|
||||
$(".scroll-down").arctic_scroll();
|
||||
|
||||
$(".menu-button, .nav-cover, .nav-close").on("click", function(e){
|
||||
e.preventDefault();
|
||||
$("body").toggleClass("nav-opened nav-closed");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// Arctic Scroll by Paul Adam Davis
|
||||
// https://github.com/PaulAdamDavis/Arctic-Scroll
|
||||
$.fn.arctic_scroll = function (options) {
|
||||
|
||||
var defaults = {
|
||||
elem: $(this),
|
||||
speed: 500
|
||||
},
|
||||
|
||||
allOptions = $.extend(defaults, options);
|
||||
|
||||
allOptions.elem.click(function (event) {
|
||||
event.preventDefault();
|
||||
var $this = $(this),
|
||||
$htmlBody = $('html, body'),
|
||||
offset = ($this.attr('data-offset')) ? $this.attr('data-offset') : false,
|
||||
position = ($this.attr('data-position')) ? $this.attr('data-position') : false,
|
||||
toMove;
|
||||
|
||||
if (offset) {
|
||||
toMove = parseInt(offset);
|
||||
$htmlBody.stop(true, false).animate({scrollTop: ($(this.hash).offset().top + toMove) }, allOptions.speed);
|
||||
} else if (position) {
|
||||
toMove = parseInt(position);
|
||||
$htmlBody.stop(true, false).animate({scrollTop: toMove }, allOptions.speed);
|
||||
} else {
|
||||
$htmlBody.stop(true, false).animate({scrollTop: ($(this.hash).offset().top) }, allOptions.speed);
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
})(jQuery);
|
||||
10346
source/javascripts/vendor/jquery-1.11.2.js
vendored
Normal file
10346
source/javascripts/vendor/jquery-1.11.2.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
33
source/layouts/layout.haml
Normal file
33
source/layouts/layout.haml
Normal file
@ -0,0 +1,33 @@
|
||||
!!! 5
|
||||
%html
|
||||
%head
|
||||
%title= page_title
|
||||
%meta{name: :description, content: page_description}
|
||||
%meta{charset: 'utf-8'}
|
||||
%meta{name: :viewport, content: 'width=device-width, initial-scale=1.0'}
|
||||
%meta{'http-equiv' => 'X-UA-Compatible', content: 'IE=edge'}
|
||||
%meta{name: 'HandheldFriendly', content: 'True'}
|
||||
= feed_tag :atom, "#{blog.options.prefix.to_s}/feed.xml", title: "Atom Feed"
|
||||
= favicon_tag 'images/favicon.ico'
|
||||
= stylesheet_link_tag :application
|
||||
%link{rel: :stylesheet, type: 'text/css', href: '//fonts.googleapis.com/css?family=Merriweather:300,700,700italic,300italic|Open+Sans:700,400'}
|
||||
%body{class: "#{page_class} nav-closed"}
|
||||
|
||||
= partial(:navigation)
|
||||
|
||||
.site-wrapper
|
||||
= yield
|
||||
|
||||
%footer.site-footer.clearfix
|
||||
%section.copyright
|
||||
%a{href: home_path}= blog_settings.name
|
||||
©
|
||||
= Time.now.year
|
||||
%section.poweredby
|
||||
-#
|
||||
Proudly published with
|
||||
%a{href: 'http://middlemanapp.com'} Middleman
|
||||
Casper theme powered by
|
||||
%a{href: 'https://ghost.org'} Ghost
|
||||
|
||||
= javascript_include_tag :application
|
||||
15
source/layouts/page.haml
Normal file
15
source/layouts/page.haml
Normal file
@ -0,0 +1,15 @@
|
||||
= wrap_layout :layout do
|
||||
%header.main-header.post-head{cover}
|
||||
%nav.main-nav.clearfix{class: cover? ? 'overlay' : nil}
|
||||
- if blog_settings.logo.present?
|
||||
%a.blog-logo{href: home_path}
|
||||
= image_tag blog_settings.logo, alt: blog_settings.name
|
||||
- if blog_settings.navigation
|
||||
%a.menu-button.icon-menu{href: '#'}
|
||||
%span.word Menu
|
||||
|
||||
%main.content{role: :main}
|
||||
%article.post
|
||||
%header.post-header
|
||||
%h1.post-title= current_page.data.title
|
||||
%section.post-content= yield
|
||||
69
source/layouts/post.haml
Normal file
69
source/layouts/post.haml
Normal file
@ -0,0 +1,69 @@
|
||||
= wrap_layout :layout do
|
||||
%header.main-header.post-head{cover}
|
||||
%nav.main-nav.clearfix{class: cover? ? 'overlay' : nil}
|
||||
- if blog_settings.logo.present?
|
||||
%a.blog-logo{href: home_path}
|
||||
= image_tag blog_settings.logo, alt: blog_settings.name
|
||||
- if blog_settings.navigation
|
||||
%a.menu-button.icon-menu{href: '#'}
|
||||
%span.word Menu
|
||||
|
||||
%main.content{role: :main}
|
||||
%article.post
|
||||
%header.post-header
|
||||
%h1.post-title= current_article.title
|
||||
%section.post-meta
|
||||
%time.post-date{datetime: current_article.date.strftime('%Y-%m-%d')}
|
||||
= current_article.date.strftime(blog_settings.date_format)
|
||||
- if tags?
|
||||
on #{tags}
|
||||
|
||||
%section.post-content= yield
|
||||
|
||||
%footer.post-footer
|
||||
- if gravatar?
|
||||
%figure.author-image
|
||||
%a.img{href: author_path, style: "background-image: url(#{gravatar})"}
|
||||
%span.hidden #{blog_author.name}'s Picture
|
||||
%section.author
|
||||
%h4
|
||||
%a{href: author_path}= blog_author.name
|
||||
|
||||
%p
|
||||
- if blog_author.bio.present?
|
||||
= blog_author.bio
|
||||
- else
|
||||
Read
|
||||
%a{href: author_path} more posts
|
||||
by this author.
|
||||
|
||||
- if blog_author.location.present? || blog_author.website.present?
|
||||
.author-meta
|
||||
- if blog_author.location.present?
|
||||
%span.author-location.icon-location= blog_author.location
|
||||
- if blog_author.website.present?
|
||||
%span.author-link.icon-link
|
||||
%a{href: blog_author.website}= blog_author.website
|
||||
|
||||
%section.share
|
||||
%h4 Share this post
|
||||
%a.icon-twitter{href: twitter_url, onclick: "window.open(this.href, 'twitter-share', 'width=550,height=235');return false;"}
|
||||
%span.hidden Twitter
|
||||
%a.icon-facebook{href: facebook_url, onclick: "window.open(this.href, 'facebook-share','width=580,height=296');return false;"}
|
||||
%span.hidden Facebook
|
||||
%a.icon-google-plus{href: google_plus_url, onclick: "window.open(this.href, 'google-plus-share', 'width=490,height=530');return false;"}
|
||||
%span.hidden Google+
|
||||
|
||||
%aside.read-next
|
||||
- if prev_article = current_article.previous_article
|
||||
- attributes = { href: prev_article.url }.merge(cover(prev_article))
|
||||
%a.read-next-story{attributes}
|
||||
%section.post
|
||||
%h2= prev_article.title
|
||||
%p #{read_next_summary(prev_article, 19)}…
|
||||
- if next_article = current_article.next_article
|
||||
- attributes = { href: next_article.url }.merge(cover(next_article))
|
||||
%a.read-next-story.prev{attributes}
|
||||
%section.post
|
||||
%h2= next_article.title
|
||||
%p #{read_next_summary(next_article, 19)}…
|
||||
12
source/partials/navigation.haml
Normal file
12
source/partials/navigation.haml
Normal file
@ -0,0 +1,12 @@
|
||||
.nav
|
||||
%h3.nav-title Menu
|
||||
%a.nav-close{href: '#'}
|
||||
%span.hidden Close
|
||||
%ul
|
||||
- navigation.try(:each) do |label, href|
|
||||
- css_class = %W(nav-#{label.parameterize})
|
||||
- css_class << "nav-current" if current_page.url == href
|
||||
%li{class: css_class.join(' '), role: :presentation}
|
||||
%a{href: href}= label
|
||||
%a.subscribe-button.icon-feed{href: feed_path} Subscribe
|
||||
%span.nav-cover
|
||||
21
source/partials/page_articles.haml
Normal file
21
source/partials/page_articles.haml
Normal file
@ -0,0 +1,21 @@
|
||||
.extra-pagination.inner
|
||||
= partial(:pagination) if paginate
|
||||
|
||||
- page_articles.each do |article|
|
||||
%article.post
|
||||
%header.post-header
|
||||
%h2.post-title= link_to article.title, article
|
||||
%section.post-excerpt
|
||||
%p
|
||||
= summary(article)
|
||||
= link_to '»', article, class: 'read-more'
|
||||
%footer.post-meta
|
||||
- if gravatar?
|
||||
%img.author-thumb{src: gravatar(24), alt: blog_author.name, nopin: 'nopin'}
|
||||
%a{href: author_path}= blog_author.name
|
||||
- if tags?(article)
|
||||
on #{tags(article)}
|
||||
%time.post-date{datetime: article.date.strftime('%Y-%m-%d')}
|
||||
= article.date.strftime(blog_settings.date_format)
|
||||
|
||||
= partial(:pagination) if paginate
|
||||
12
source/partials/pagination.haml
Normal file
12
source/partials/pagination.haml
Normal file
@ -0,0 +1,12 @@
|
||||
- locals = current_resource.metadata[:locals]
|
||||
- prev_page = locals['prev_page']
|
||||
- page_number = locals['page_number']
|
||||
- num_pages = locals['num_pages']
|
||||
- next_page = locals['next_page']
|
||||
|
||||
%nav.pagination{role: :pagination}
|
||||
- if prev_page
|
||||
= link_to '← Newer Posts', prev_page, class: 'newer-posts'
|
||||
%span.page-number Page #{page_number} of #{num_pages}
|
||||
- if next_page
|
||||
= link_to 'Older Posts →', next_page, class: 'older-posts'
|
||||
17
source/sitemap.xml.builder
Normal file
17
source/sitemap.xml.builder
Normal file
@ -0,0 +1,17 @@
|
||||
xml.instruct!
|
||||
xml.urlset 'xmlns' => "http://www.sitemaps.org/schemas/sitemap/0.9" do
|
||||
sitemap.resources.select { |page| page.destination_path =~ /\.html/ && page.data.noindex != true }.each do |page|
|
||||
xml.url do
|
||||
xml.loc URI.join(settings.casper[:blog][:url], page.destination_path)
|
||||
last_mod = if page.path.start_with?('articles/')
|
||||
File.mtime(page.source_file).to_time
|
||||
else
|
||||
Time.now
|
||||
end
|
||||
xml.lastmod last_mod.iso8601
|
||||
xml.changefreq page.data.changefreq || "monthly"
|
||||
xml.priority page.data.priority || "0.5"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
1
source/stylesheets/_syntax.css.erb
Normal file
1
source/stylesheets/_syntax.css.erb
Normal file
@ -0,0 +1 @@
|
||||
<%= Rouge::Themes::Base16.mode(:light).render %>
|
||||
10
source/stylesheets/application.css.scss
Normal file
10
source/stylesheets/application.css.scss
Normal file
@ -0,0 +1,10 @@
|
||||
@import 'vendor/casper';
|
||||
@import 'syntax';
|
||||
|
||||
// Overwrite some styles from casper.css
|
||||
pre.highlight {
|
||||
word-wrap: normal;
|
||||
code {
|
||||
white-space: pre;
|
||||
}
|
||||
}
|
||||
2066
source/stylesheets/vendor/casper.css
vendored
Normal file
2066
source/stylesheets/vendor/casper.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
21
source/tag.html.haml
Normal file
21
source/tag.html.haml
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
pageable: true
|
||||
per_page: 6
|
||||
---
|
||||
|
||||
%header.main-header.tag-head{cover}
|
||||
%nav.main-nav.overlay.clearfix
|
||||
- if blog_settings.logo.present?
|
||||
%a.blog-logo{href: home_path}
|
||||
= image_tag blog_settings.logo, alt: blog_settings.name
|
||||
- if blog_settings.navigation
|
||||
%a.menu-button.icon-menu{href: '#'}
|
||||
%span.word Menu
|
||||
.vertical
|
||||
.main-header-content.inner
|
||||
%h1.page-title= tagname
|
||||
%h2.page-description A #{page_articles.count}-post collection
|
||||
|
||||
%main#content.content{role: :main}
|
||||
= partial(:page_articles,
|
||||
locals: { page_articles: page_articles, paginate: paginate })
|
||||
Loading…
x
Reference in New Issue
Block a user