├── _layouts ├── blank.html ├── post.html └── default.html ├── images ├── bg.jpg ├── blog.jpg ├── logo.jpg ├── cnt-top.jpg ├── aside-bg.jpg └── cnt-left.jpg ├── _posts ├── 2013-08-11-kunka-back.markdown └── 2012-08-10-typo-css.markdown ├── .gitignore ├── README.md ├── archives.html ├── links.html ├── atom.xml ├── categories.html ├── contact.html ├── index.html ├── _config.yml ├── css ├── syntax.css └── main.css └── Rakefile /_layouts/blank.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pizn/kunka/HEAD/images/bg.jpg -------------------------------------------------------------------------------- /images/blog.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pizn/kunka/HEAD/images/blog.jpg -------------------------------------------------------------------------------- /images/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pizn/kunka/HEAD/images/logo.jpg -------------------------------------------------------------------------------- /images/cnt-top.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pizn/kunka/HEAD/images/cnt-top.jpg -------------------------------------------------------------------------------- /images/aside-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pizn/kunka/HEAD/images/aside-bg.jpg -------------------------------------------------------------------------------- /images/cnt-left.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pizn/kunka/HEAD/images/cnt-left.jpg -------------------------------------------------------------------------------- /_posts/2013-08-11-kunka-back.markdown: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: kunka 主题归来 4 | date: 2013-08-11 12:55:11 5 | category: "主题" 6 | --- 7 | 8 | 很久之前就把视觉稿画好了,周末有时间,把它给写了出来。下面介绍下 Kunka 主题。 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .idea/ 3 | .idea/scopes/scope_settings.xml 4 | .idea/workspace.xml 5 | .ipr 6 | .iws 7 | *~ 8 | ~* 9 | *.diff 10 | *.patch 11 | *.bak 12 | .DS_Store 13 | Thumbs.db 14 | .project 15 | .*proj 16 | .svn/ 17 | *.swp 18 | *.swo 19 | *.pyc 20 | *.pyo 21 | build 22 | node_modules 23 | _site 24 | sea-modules 25 | .cache -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ##Kunka 2 | 3 | > 这只是另外一个 Jekyll 主题文件。 4 | 5 | ![kunka blog theme](images/blog.jpg) 6 | 7 | ###使用方法 8 | 9 | * 把主题文件 clone 到你本地服务器 10 | * 使用```rake post title="title name"```自动添加文章到 ```_posts``` 文件夹。 11 | * 修改 ```_config.yml```,里面有很多可以配置的选项。 12 | * 运行 ```jekyll serve```,浏览器打开 http://localhost:4000 便可以看到新的主题。 13 | 14 | 更多的介绍,详见[Jekyll 博客主题 Kunka](http://www.zhanxin.info/jekyll/2013-08-11-jekyll-theme-kunka.html)。 -------------------------------------------------------------------------------- /archives.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Archives 4 | --- 5 |
6 |

{{ page.title }}

7 | {% capture post_year1 %}{{ 'now' | date: '%Y' }}{% endcapture %} 8 | 14 | 19 |
20 | 21 | -------------------------------------------------------------------------------- /links.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Links 4 | comment: true 5 | --- 6 | 7 |
8 |

{{ page.title }}

9 | 19 |
20 | {% if site.disqus.config %} 21 |
22 | {% else %} 23 | {% if site.duoshuo.config %} 24 |
25 | {% endif %} 26 | {% endif %} 27 |
28 |
-------------------------------------------------------------------------------- /atom.xml: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blank 3 | --- 4 | 5 | 6 | 7 | {{ site.title }} 8 | 9 | 10 | {{ site.time | date_to_xmlschema }} 11 | {{ site.url }} 12 | 13 | {{ site.author.name }} 14 | {{ site.author.email }} 15 | 16 | 17 | {% for post in site.posts limit:10 %} 18 | 19 | {{ post.title }} 20 | 21 | {{ post.date | date_to_xmlschema }} 22 | {{ site.url }}{{ post.id }} 23 | {{ post.content | xml_escape }} 24 | 25 | {% endfor %} 26 | 27 | 28 | -------------------------------------------------------------------------------- /categories.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Categories 4 | --- 5 |
6 |

{{ page.title }}

7 | 15 | 16 |
17 | {% for category in site.categories %} 18 |

{{ category[0] | join: "/" }}

19 | 30 | {% endfor %} 31 |
32 |
33 | -------------------------------------------------------------------------------- /contact.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Contact 4 | comment: true 5 | --- 6 | 7 |
8 |

{{ page.title }}

9 |
10 | 11 |
12 |

{{ site.author.simpleIntro }}

13 | {{ site.author.detailIntro }} 14 |
15 |
16 | 17 |
18 |
19 |
20 |
21 | {% for link in site.follow %} 22 | 23 | {% endfor %} 24 |
25 |
26 |
27 | {{ site.author.email }} 28 |
29 |
30 | {% if site.disqus.config %} 31 |
32 | {% else %} 33 | {% if site.duoshuo.config %} 34 |
35 | {% endif %} 36 | {% endif %} 37 |
38 |
-------------------------------------------------------------------------------- /_layouts/post.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | comment: true 4 | --- 5 |
6 |

{{ page.title }}

7 |
8 | Published: 9 | {{ page.date | date_to_string }} 10 | Category: 11 | {{ page.category }} 12 |
13 | {{ content }} 14 | 22 |
23 | {% if site.disqus.config %} 24 |
25 | {% else %} 26 | {% if site.duoshuo.config %} 27 |
28 | {% endif %} 29 | {% endif %} 30 |
31 |
32 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Kunka 4 | keywords: Jekyll theme, Kunka 5 | --- 6 | {% for post in paginator.posts %} 7 |
8 |

{{ post.title }}

9 |
10 |

{{ post.excerpt }}

11 |
12 | 13 |
14 | Published: 15 | {{ post.date | date_to_string }} 16 |
17 |
18 | {% endfor %} 19 | {% if paginator.total_pages > 1 %} 20 | 32 | {% endif %} -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | # Where things are 2 | source: . 3 | destination: ./_site 4 | plugins: ./_plugins 5 | layouts: ./_layouts 6 | paginate: 8 7 | 8 | # Handling Reading 9 | safe: false 10 | include: [".htaccess"] 11 | exclude: [] 12 | keep_files: [".git", ".svn"] 13 | encoding: "utf-8" 14 | markdown_ext: "markdown,mkdown,mkdn,mkd,md" 15 | textile_ext: "textile" 16 | 17 | # Filtering Content 18 | show_drafts: null 19 | limit_posts: 0 20 | future: true 21 | unpublished: false 22 | 23 | # Conversion 24 | markdown: kramdown 25 | highlighter: pygments 26 | lsi: false 27 | excerpt_separator: "\n\n" 28 | 29 | # Serving 30 | detach: false 31 | port: 4000 32 | host: 127.0.0.1 33 | baseurl: "" # does not include hostname 34 | 35 | # Outputting 36 | permalink: date 37 | paginate_path: /page:num 38 | timezone: null 39 | 40 | 41 | #Site config 42 | title: Jekyll Theme 43 | description: Just another Jekyll theme design and code by zhanxin.info. 44 | keywords: Jekyll Theme 45 | url: http://pizn.github.io/kunka 46 | feed: /atom.xml 47 | favicon: http://jekyllrb.com/favicon.png 48 | 49 | #Nav config 50 | nav: 51 | - text: 首页 52 | url: /index.html 53 | - text: 分类目录 54 | url: /categories.html 55 | - text: 文章归档 56 | url: /archives.html 57 | - text: 联系我 58 | url: /contact.html 59 | - text: 友情链接 60 | url: /links.html 61 | 62 | #Author config 63 | author: 64 | name: 掌心 65 | email: zhanxin.info@gmail.com 66 | imageLink: http://tp2.sinaimg.cn/1832671293/180/40020872447/1 67 | simpleIntro: 我是「展新展新」,一个矛盾体的化身,在你的掌心里。 68 | detailIntro: 69 |

Jekyll 是一个简洁的、特别针对博客平台的 静态网站 生成器。它使用一个模板目录作为网站布局的基础框架,并在其上运行 Textile 、 Markdown 或 Liquid 标记语言的转换器,最终生成一个完整的静态Web站点,可以被放置在Apache或者你喜欢的其他任何Web服务器上。它同时也是 GitHub Pages 、一个由 GitHub 提供的用于托管项目主页或博客的服务,在后台所运行的引擎。

70 |

很早之前,使用过 wordpress 来写博客。但是还要处理很多的底层问题。而使用 Jekyll 来写博客,可以很简单,写 Markdown 就好。然而,Jekyll 还很年轻,没有很多主题的支持。这里的主题,就是为 Jekyll 而写的。希望你能喜欢。

71 | 72 | #Follow me, you can choose your icon by http://fortawesome.github.io/Font-Awesome/icons/#brand 73 | follow: 74 | - class: icon-rss 75 | url: /atom.xml 76 | - class: icon-weibo 77 | url: http://weibo.com/pizn 78 | - class: icon-renren 79 | url: http://renren.com 80 | - class: icon-github-alt 81 | url: http://github.com/pizn 82 | - class: icon-twitter 83 | url: http://twitter.com/piznlin 84 | - class: icon-google-plus 85 | url: http://google.com 86 | 87 | #Links 88 | customLinks: 89 | - item: 90 | - text: 掌心 91 | url: http://www.zhanxin.info 92 | - text: Jekyll 93 | url: http://jekyllrb.com 94 | - text: Jekyll Theme 95 | url: http://www.zhanxin.info/themes.html 96 | message: Friends 97 | - item: 98 | - text: Font Awesome 99 | url: http://fortawesome.github.io/Font-Awesome/ 100 | - text: Google Font 101 | url: http://www.google.com/fonts/ 102 | - text: jQuery 103 | url: http://jquery.com/ 104 | message: 其他相关链接 105 | 106 | #googleAnaly, your id link UA-12345678-X 107 | googleAnaly: 108 | config: true 109 | id: UA-40169250-1 110 | 111 | #comment config 112 | disqus: 113 | config: false 114 | id: piznblog 115 | 116 | duoshuo: 117 | config: true 118 | id: zhanxin -------------------------------------------------------------------------------- /css/syntax.css: -------------------------------------------------------------------------------- 1 | .highlight .c { color: #999988; font-style: italic } /* Comment */ 2 | .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ 3 | .highlight .k { font-weight: bold } /* Keyword */ 4 | .highlight .o { font-weight: bold } /* Operator */ 5 | .highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */ 6 | .highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */ 7 | .highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */ 8 | .highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ 9 | .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ 10 | .highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */ 11 | .highlight .ge { font-style: italic } /* Generic.Emph */ 12 | .highlight .gr { color: #aa0000 } /* Generic.Error */ 13 | .highlight .gh { color: #999999 } /* Generic.Heading */ 14 | .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ 15 | .highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */ 16 | .highlight .go { color: #888888 } /* Generic.Output */ 17 | .highlight .gp { color: #555555 } /* Generic.Prompt */ 18 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 19 | .highlight .gu { color: #aaaaaa } /* Generic.Subheading */ 20 | .highlight .gt { color: #aa0000 } /* Generic.Traceback */ 21 | .highlight .kc { font-weight: bold } /* Keyword.Constant */ 22 | .highlight .kd { font-weight: bold } /* Keyword.Declaration */ 23 | .highlight .kp { font-weight: bold } /* Keyword.Pseudo */ 24 | .highlight .kr { font-weight: bold } /* Keyword.Reserved */ 25 | .highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */ 26 | .highlight .m { color: #009999 } /* Literal.Number */ 27 | .highlight .s { color: #d14 } /* Literal.String */ 28 | .highlight .na { color: #008080 } /* Name.Attribute */ 29 | .highlight .nb { color: #0086B3 } /* Name.Builtin */ 30 | .highlight .nc { color: #445588; font-weight: bold } /* Name.Class */ 31 | .highlight .no { color: #008080 } /* Name.Constant */ 32 | .highlight .ni { color: #800080 } /* Name.Entity */ 33 | .highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */ 34 | .highlight .nf { color: #990000; font-weight: bold } /* Name.Function */ 35 | .highlight .nn { color: #555555 } /* Name.Namespace */ 36 | .highlight .nt { color: #000080 } /* Name.Tag */ 37 | .highlight .nv { color: #008080 } /* Name.Variable */ 38 | .highlight .ow { font-weight: bold } /* Operator.Word */ 39 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 40 | .highlight .mf { color: #009999 } /* Literal.Number.Float */ 41 | .highlight .mh { color: #009999 } /* Literal.Number.Hex */ 42 | .highlight .mi { color: #009999 } /* Literal.Number.Integer */ 43 | .highlight .mo { color: #009999 } /* Literal.Number.Oct */ 44 | .highlight .sb { color: #d14 } /* Literal.String.Backtick */ 45 | .highlight .sc { color: #d14 } /* Literal.String.Char */ 46 | .highlight .sd { color: #d14 } /* Literal.String.Doc */ 47 | .highlight .s2 { color: #d14 } /* Literal.String.Double */ 48 | .highlight .se { color: #d14 } /* Literal.String.Escape */ 49 | .highlight .sh { color: #d14 } /* Literal.String.Heredoc */ 50 | .highlight .si { color: #d14 } /* Literal.String.Interpol */ 51 | .highlight .sx { color: #d14 } /* Literal.String.Other */ 52 | .highlight .sr { color: #009926 } /* Literal.String.Regex */ 53 | .highlight .s1 { color: #d14 } /* Literal.String.Single */ 54 | .highlight .ss { color: #990073 } /* Literal.String.Symbol */ 55 | .highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */ 56 | .highlight .vc { color: #008080 } /* Name.Variable.Class */ 57 | .highlight .vg { color: #008080 } /* Name.Variable.Global */ 58 | .highlight .vi { color: #008080 } /* Name.Variable.Instance */ 59 | .highlight .il { color: #009999 } /* Literal.Number.Integer.Long */ 60 | -------------------------------------------------------------------------------- /_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 14 | {% if page.title %}{{ page.title }} - {{ site.title }}{% else %}{{ site.title }}{% endif %} 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | {% if site.googleAnaly.config %} 30 | 41 | {% endif %} 42 | 43 | 44 |
45 |
46 |

47 | 48 |

49 | 65 | 70 |
71 |
72 |
73 |
74 |
75 | {{ content }} 76 |
77 |
78 |
79 |

About me

80 |
81 |
82 | 83 |
84 |
85 |

{{ site.author.simpleIntro }}

86 |
87 |
88 |
89 | 90 |
91 |

Recent Posts

92 |
    93 | {% for rpost in site.posts limit:6 %} 94 |
  • {{ rpost.title }}
  • 95 | {% endfor %} 96 |
97 |
98 | 99 |
100 |

Links

101 |
    102 | {% for i in site.customLinks %} 103 | {% if i.message == "Friends" %} 104 | {% for link in i.item %} 105 |
  • {{ link.text }}
  • 106 | {% endfor %} 107 | {% endif %} 108 | {% endfor %} 109 |
110 |
111 | 112 |
113 |
114 |
115 |
116 | 119 |
120 | 121 | {% if page.comment %} 122 | {% if site.disqus.config %} 123 | 133 | {% else %} 134 | {% if site.duoshuo.config %} 135 | 146 | {% endif %} 147 | {% endif %} 148 | {% endif %} 149 | 150 | 151 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require "rubygems" 2 | require 'rake' 3 | require 'yaml' 4 | require 'time' 5 | 6 | SOURCE = "." 7 | CONFIG = { 8 | 'version' => "0.3.0", 9 | 'themes' => File.join(SOURCE, "_includes", "themes"), 10 | 'layouts' => File.join(SOURCE, "_layouts"), 11 | 'posts' => File.join(SOURCE, "_posts"), 12 | 'post_ext' => "md", 13 | 'theme_package_version' => "0.1.0" 14 | } 15 | 16 | # Path configuration helper 17 | module JB 18 | class Path 19 | SOURCE = "." 20 | Paths = { 21 | :layouts => "_layouts", 22 | :themes => "_includes/themes", 23 | :theme_assets => "assets/themes", 24 | :theme_packages => "_theme_packages", 25 | :posts => "_posts" 26 | } 27 | 28 | def self.base 29 | SOURCE 30 | end 31 | 32 | # build a path relative to configured path settings. 33 | def self.build(path, opts = {}) 34 | opts[:root] ||= SOURCE 35 | path = "#{opts[:root]}/#{Paths[path.to_sym]}/#{opts[:node]}".split("/") 36 | path.compact! 37 | File.__send__ :join, path 38 | end 39 | 40 | end #Path 41 | end #JB 42 | 43 | # Usage: rake post title="A Title" [date="2012-02-09"] [tags=[tag1, tag2]] 44 | desc "Begin a new post in #{CONFIG['posts']}" 45 | task :post do 46 | abort("rake aborted: '#{CONFIG['posts']}' directory not found.") unless FileTest.directory?(CONFIG['posts']) 47 | title = ENV["title"] || "new-post" 48 | tags = ENV["tags"] || "[]" 49 | slug = title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '') 50 | begin 51 | date = (ENV['date'] ? Time.parse(ENV['date']) : Time.now).strftime('%Y-%m-%d') 52 | rescue Exception => e 53 | puts "Error - date format must be YYYY-MM-DD, please check you typed it correctly!" 54 | exit -1 55 | end 56 | filename = File.join(CONFIG['posts'], "#{date}-#{slug}.#{CONFIG['post_ext']}") 57 | if File.exist?(filename) 58 | abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n' 59 | end 60 | 61 | puts "Creating new post: #{filename}" 62 | open(filename, 'w') do |post| 63 | post.puts "---" 64 | post.puts "layout: post" 65 | post.puts "title: \"#{title.gsub(/-/,' ')}\"" 66 | post.puts 'description: ""' 67 | post.puts "category: " 68 | post.puts "tags: []" 69 | post.puts "---" 70 | #post.puts "{% include JB/setup %}" 71 | end 72 | end # task :post 73 | 74 | # Usage: rake page name="about.html" 75 | # You can also specify a sub-directory path. 76 | # If you don't specify a file extention we create an index.html at the path specified 77 | desc "Create a new page." 78 | task :page do 79 | name = ENV["name"] || "new-page.md" 80 | filename = File.join(SOURCE, "#{name}") 81 | filename = File.join(filename, "index.html") if File.extname(filename) == "" 82 | title = File.basename(filename, File.extname(filename)).gsub(/[\W\_]/, " ").gsub(/\b\w/){$&.upcase} 83 | if File.exist?(filename) 84 | abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n' 85 | end 86 | 87 | mkdir_p File.dirname(filename) 88 | puts "Creating new page: #{filename}" 89 | open(filename, 'w') do |post| 90 | post.puts "---" 91 | post.puts "layout: page" 92 | post.puts "title: \"#{title}\"" 93 | post.puts 'description: ""' 94 | post.puts "---" 95 | post.puts "{% include JB/setup %}" 96 | end 97 | end # task :page 98 | 99 | desc "Launch preview environment" 100 | task :preview do 101 | system "jekyll --auto --server" 102 | end # task :preview 103 | 104 | # Public: Alias - Maintains backwards compatability for theme switching. 105 | task :switch_theme => "theme:switch" 106 | 107 | namespace :theme do 108 | 109 | # Public: Switch from one theme to another for your blog. 110 | # 111 | # name - String, Required. name of the theme you want to switch to. 112 | # The the theme must be installed into your JB framework. 113 | # 114 | # Examples 115 | # 116 | # rake theme:switch name="the-program" 117 | # 118 | # Returns Success/failure messages. 119 | desc "Switch between Jekyll-bootstrap themes." 120 | task :switch do 121 | theme_name = ENV["name"].to_s 122 | theme_path = File.join(CONFIG['themes'], theme_name) 123 | settings_file = File.join(theme_path, "settings.yml") 124 | non_layout_files = ["settings.yml"] 125 | 126 | abort("rake aborted: name cannot be blank") if theme_name.empty? 127 | abort("rake aborted: '#{theme_path}' directory not found.") unless FileTest.directory?(theme_path) 128 | abort("rake aborted: '#{CONFIG['layouts']}' directory not found.") unless FileTest.directory?(CONFIG['layouts']) 129 | 130 | Dir.glob("#{theme_path}/*") do |filename| 131 | next if non_layout_files.include?(File.basename(filename).downcase) 132 | puts "Generating '#{theme_name}' layout: #{File.basename(filename)}" 133 | 134 | open(File.join(CONFIG['layouts'], File.basename(filename)), 'w') do |page| 135 | if File.basename(filename, ".html").downcase == "default" 136 | page.puts "---" 137 | page.puts File.read(settings_file) if File.exist?(settings_file) 138 | page.puts "---" 139 | else 140 | page.puts "---" 141 | page.puts "layout: default" 142 | page.puts "---" 143 | end 144 | page.puts "{% include JB/setup %}" 145 | page.puts "{% include themes/#{theme_name}/#{File.basename(filename)} %}" 146 | end 147 | end 148 | 149 | puts "=> Theme successfully switched!" 150 | puts "=> Reload your web-page to check it out =)" 151 | end # task :switch 152 | 153 | # Public: Install a theme using the theme packager. 154 | # Version 0.1.0 simple 1:1 file matching. 155 | # 156 | # git - String, Optional path to the git repository of the theme to be installed. 157 | # name - String, Optional name of the theme you want to install. 158 | # Passing name requires that the theme package already exist. 159 | # 160 | # Examples 161 | # 162 | # rake theme:install git="https://github.com/jekyllbootstrap/theme-twitter.git" 163 | # rake theme:install name="cool-theme" 164 | # 165 | # Returns Success/failure messages. 166 | desc "Install theme" 167 | task :install do 168 | if ENV["git"] 169 | manifest = theme_from_git_url(ENV["git"]) 170 | name = manifest["name"] 171 | else 172 | name = ENV["name"].to_s.downcase 173 | end 174 | 175 | packaged_theme_path = JB::Path.build(:theme_packages, :node => name) 176 | 177 | abort("rake aborted! 178 | => ERROR: 'name' cannot be blank") if name.empty? 179 | abort("rake aborted! 180 | => ERROR: '#{packaged_theme_path}' directory not found. 181 | => Installable themes can be added via git. You can find some here: http://github.com/jekyllbootstrap 182 | => To download+install run: `rake theme:install git='[PUBLIC-CLONE-URL]'` 183 | => example : rake theme:install git='git@github.com:jekyllbootstrap/theme-the-program.git' 184 | ") unless FileTest.directory?(packaged_theme_path) 185 | 186 | manifest = verify_manifest(packaged_theme_path) 187 | 188 | # Get relative paths to packaged theme files 189 | # Exclude directories as they'll be recursively created. Exclude meta-data files. 190 | packaged_theme_files = [] 191 | FileUtils.cd(packaged_theme_path) { 192 | Dir.glob("**/*.*") { |f| 193 | next if ( FileTest.directory?(f) || f =~ /^(manifest|readme|packager)/i ) 194 | packaged_theme_files << f 195 | } 196 | } 197 | 198 | # Mirror each file into the framework making sure to prompt if already exists. 199 | packaged_theme_files.each do |filename| 200 | file_install_path = File.join(JB::Path.base, filename) 201 | if File.exist? file_install_path and ask("#{file_install_path} already exists. Do you want to overwrite?", ['y', 'n']) == 'n' 202 | next 203 | else 204 | mkdir_p File.dirname(file_install_path) 205 | cp_r File.join(packaged_theme_path, filename), file_install_path 206 | end 207 | end 208 | 209 | puts "=> #{name} theme has been installed!" 210 | puts "=> ---" 211 | if ask("=> Want to switch themes now?", ['y', 'n']) == 'y' 212 | system("rake switch_theme name='#{name}'") 213 | end 214 | end 215 | 216 | # Public: Package a theme using the theme packager. 217 | # The theme must be structured using valid JB API. 218 | # In other words packaging is essentially the reverse of installing. 219 | # 220 | # name - String, Required name of the theme you want to package. 221 | # 222 | # Examples 223 | # 224 | # rake theme:package name="twitter" 225 | # 226 | # Returns Success/failure messages. 227 | desc "Package theme" 228 | task :package do 229 | name = ENV["name"].to_s.downcase 230 | theme_path = JB::Path.build(:themes, :node => name) 231 | asset_path = JB::Path.build(:theme_assets, :node => name) 232 | 233 | abort("rake aborted: name cannot be blank") if name.empty? 234 | abort("rake aborted: '#{theme_path}' directory not found.") unless FileTest.directory?(theme_path) 235 | abort("rake aborted: '#{asset_path}' directory not found.") unless FileTest.directory?(asset_path) 236 | 237 | ## Mirror theme's template directory (_includes) 238 | packaged_theme_path = JB::Path.build(:themes, :root => JB::Path.build(:theme_packages, :node => name)) 239 | mkdir_p packaged_theme_path 240 | cp_r theme_path, packaged_theme_path 241 | 242 | ## Mirror theme's asset directory 243 | packaged_theme_assets_path = JB::Path.build(:theme_assets, :root => JB::Path.build(:theme_packages, :node => name)) 244 | mkdir_p packaged_theme_assets_path 245 | cp_r asset_path, packaged_theme_assets_path 246 | 247 | ## Log packager version 248 | packager = {"packager" => {"version" => CONFIG["theme_package_version"].to_s } } 249 | open(JB::Path.build(:theme_packages, :node => "#{name}/packager.yml"), "w") do |page| 250 | page.puts packager.to_yaml 251 | end 252 | 253 | puts "=> '#{name}' theme is packaged and available at: #{JB::Path.build(:theme_packages, :node => name)}" 254 | end 255 | 256 | end # end namespace :theme 257 | 258 | # Internal: Download and process a theme from a git url. 259 | # Notice we don't know the name of the theme until we look it up in the manifest. 260 | # So we'll have to change the folder name once we get the name. 261 | # 262 | # url - String, Required url to git repository. 263 | # 264 | # Returns theme manifest hash 265 | def theme_from_git_url(url) 266 | tmp_path = JB::Path.build(:theme_packages, :node => "_tmp") 267 | abort("rake aborted: system call to git clone failed") if !system("git clone #{url} #{tmp_path}") 268 | manifest = verify_manifest(tmp_path) 269 | new_path = JB::Path.build(:theme_packages, :node => manifest["name"]) 270 | if File.exist?(new_path) && ask("=> #{new_path} theme package already exists. Override?", ['y', 'n']) == 'n' 271 | remove_dir(tmp_path) 272 | abort("rake aborted: '#{manifest["name"]}' already exists as theme package.") 273 | end 274 | 275 | remove_dir(new_path) if File.exist?(new_path) 276 | mv(tmp_path, new_path) 277 | manifest 278 | end 279 | 280 | # Internal: Process theme package manifest file. 281 | # 282 | # theme_path - String, Required. File path to theme package. 283 | # 284 | # Returns theme manifest hash 285 | def verify_manifest(theme_path) 286 | manifest_path = File.join(theme_path, "manifest.yml") 287 | manifest_file = File.open( manifest_path ) 288 | abort("rake aborted: repo must contain valid manifest.yml") unless File.exist? manifest_file 289 | manifest = YAML.load( manifest_file ) 290 | manifest_file.close 291 | manifest 292 | end 293 | 294 | def ask(message, valid_options) 295 | if valid_options 296 | answer = get_stdin("#{message} #{valid_options.to_s.gsub(/"/, '').gsub(/, /,'/')} ") while !valid_options.include?(answer) 297 | else 298 | answer = get_stdin(message) 299 | end 300 | answer 301 | end 302 | 303 | def get_stdin(message) 304 | print message 305 | STDIN.gets.chomp 306 | end 307 | 308 | #Load custom rake scripts 309 | Dir['_rake/*.rake'].each { |r| load r } 310 | -------------------------------------------------------------------------------- /_posts/2012-08-10-typo-css.markdown: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: TYPO.CSS 4 | date: 2012-08-10 12:55:11 5 | category: "介绍" 6 | --- 7 | 8 |

一致化浏览器排版效果,构建最适合中文阅读的网页排版

9 | 10 |
    11 |
  1. 关于 TYPO.CSS
  2. 12 |
  3. 排版实例 13 | 17 |
  4. 18 |
  5. 附录 19 |
      20 |
    1. TYPO.CSS 排版偏重点
    2. 21 |
    3. 开源许可
    4. 22 |
    23 |
  6. 24 |
25 | 26 |

一、关于 TYPO.CSS

27 |

TYPO.CSS 的目的是,在一致化浏览器排版效果的同时,构建最适合中文阅读的网页排版。

28 |

现状和如何去做:

29 |

排版是一个麻烦的问题,需要精心设计,而这个设计却是常被视觉设计师所忽略的。前端工程师更常看到这样的问题,但不便变更。因为在多个 OS 中的不同浏览器渲染不同,改动需要多的时间做回归测试,所以改变变得更困难。而像我们一般使用的 Yahoo、Eric Meyer 和 Alice base.css 中采用的 Reset 都没有很好地考虑中文排版。TYPO.CSS 要做的就是解决中文排版的问题。

30 |

TYPO.CSS 测试于如下平台:

31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 |
OS/浏览器FirefoxChromeSafariOperaIE9IE8IE7IE6
Mac OS X----
Windows 7-
Windows XP-
Ubuntu Linux-----
92 | 93 |

中文排版的重点和难点

94 |

在中文排版中,HTML4 的很多标准在语义在都有照顾到。但从视觉效果上,却很难利用单独的 CSS 来实现,像着重号。在 HTML4 中,着重号标签(<u>)已经被放弃,而 HTML5 被重新提起。TYPO.CSS 也根据实际情况提供相应的方案。我们重要要注意的两点是:

95 |
    96 |
  1. 语义:语义对应的用法和样式是否与中文排版一致
  2. 97 |
  3. 表现:在各浏览器中的字体、大小和缩放是否如排版预期
  4. 98 |
99 |

对于这些,TYPO.CSS 排版项目的中文偏重注意点,都添加在附录中,详见:

100 |
101 | 附录一TYPO.CSS 排版偏重点 102 |
103 | 104 |

目前仍处于 alpha 开发阶段,测试平台的覆盖,特别是在移动端上还没有覆盖完主流平台,希望有能力的同学能加入测试行列,或者加入到 TYPO.CSS 的开发。加入方法:参与 TYPO.CSS 开发。如有批评、建议和意见,也随时欢迎给在 Github 直接提 issues,或给邮件

105 | 106 | 107 |

二、排版实例:

108 |

提供2个排版实例,第一个中文实例来自于来自于张燕婴的《论语》,由于古文排版涉及到的元素比较多,所以采用《论语》中《学而》的第一篇作为排版实例介绍;第2个来自到经典的 Lorem Ipsum,并加入了一些代码和列表等比较具有代表性的排版元素。

109 | 110 |

例1:论语学而篇第一

111 |

作者:孔子

112 | 113 |

本篇引语

114 |

《学而》是《论语》第一篇的篇名。《论语》中各篇一般都是以第一章的前二三个字作为该篇的篇名。《学而》一篇包括16章,内容涉及诸多方面。其中重点是“吾日三省吾身”;“节用而爱人,使民以时”;“礼之用,和为贵”以及仁、孝、信等道德范畴。

115 | 116 |

原文

117 |

子曰[1]:“学[2]而时习[3]之,不亦说[4]乎?有朋[5]自远方来,不亦乐[6]乎?人不知[7],而不愠[8],不亦君子[9]乎?”

118 | 119 |

注释

120 |

121 | 122 | [1] 子:中国古代对于有地位、有学问的男子的尊称,有时也泛称男子。《论语》书中“子曰”的子,都是指孔子而言。
123 | [2] 学:孔子在这里所讲的“学”,主要是指学习西周的礼、乐、诗、书等传统文化典籍。
124 | [3] 时习:在周秦时代,“时”字用作副词,意为“在一定的时候”或者“在适当的时候”。但朱熹在《论语集注》一书中把“时”解释为“时常”。“习”,指演习礼、乐;复习诗、书。也含有温习、实习、练习的意思。
125 | [4] 说:音yuè,同悦,愉快、高兴的意思。
126 | [5] 有朋:一本作“友朋”。旧注说,“同门曰朋”,即同在一位老师门下学习的叫朋,也就是志同道合的人。
127 | [6] 乐:与说有所区别。旧注说,悦在内心,乐则见于外。
128 | [7] 人不知:此句不完整,没有说出人不知道什么。缺少宾语。一般而言,知,是了解的意思。人不知,是说别人不了解自己。
129 | [8] 愠:音yùn,恼怒,怨恨。
130 | [9] 君子:《论语》书中的君子,有时指有德者,有时指有位者。此处指孔子理想中具有高尚人格的人。 131 |
132 |

133 | 134 |

译文

135 |

孔子说:“学了又时常温习和练习,不是很愉快吗?有志同道合的人从远方来,不是很令人高兴的吗?人家不了解我,我也不怨恨、恼怒,不也是一个有德的君子吗?”

136 | 137 |

评析

138 |

宋代著名学者朱熹对此章评价极高,说它是“入道之门,积德之基”。本章这三句话是人们非常熟悉的。历来的解释都是:学了以后,又时常温习和练习,不也高兴吗等等。三句话,一句一个意思,前后句子也没有什么连贯性。但也有人认为这样解释不符合原义,指出这里的“学”不是指学习,而是指学说或主张;“时”不能解为时常,而是时代或社会的意思,“习”不是温习,而是使用,引申为采用。而且,这三句话不是孤立的,而是前后相互连贯的。这三句的意思是:自己的学说,要是被社会采用了,那就太高兴了;退一步说,要是没有被社会所采用,可是很多朋友赞同的学说,纷纷到我这里来讨论问题,我也感到快乐;再退一步说,即使社会不采用,人们也不理解我,我也不怨恨,这样做,不也就是君子吗?(见《齐鲁学刊》1986年第6期文)这种解释可以自圆其说,而且也有一定的道理,供读者在理解本章内容时参考。

139 |

此外,在对“人不知,而不愠”一句的解释中,也有人认为,“人不知”的后面没有宾语,人家不知道什么呢?当时因为孔子有说话的特定环境,他不需要说出知道什么,别人就可以理解了,却给后人留下一个谜。有人说,这一句是接上一句说的,从远方来的朋友向我求教,我告诉他,他还不懂,我却不怨恨。这样,“人不知”就是“人家不知道我所讲述的”了。这样的解释似乎有些牵强。

140 |

总之,本章提出以学习为乐事,做到人不知而不愠,反映出孔子学而不厌、诲人不倦、注重修养、严格要求自己的主张。这些思想主张在《论语》书中多处可见,有助于对第一章内容的深入了解。

141 | 142 |

例2:英文排版

143 |

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

144 |
145 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 146 |
147 | 148 |

The standard Lorem Ipsum passage, used since the 1500s

149 |

"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."

150 | 151 |

Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC

152 |

"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"

153 | 154 |

List style in action

155 | 166 | 167 |

You may want to create a perfect <hr /> line, despite the fact that there will never have one

168 |
169 |

La Racheforcauld said: "Few things are impossible in themselves; and it is often for want of will, rather than of means, that man fails to succeed". You just need to follow the browser's behavior, and set a right margin to it。it will works nice as the demo you're watching now. The following code is the best way to render typo in Chinese:

170 | 171 | {% highlight css %} 172 | /* 标题应该更贴紧内容,并与其他块区分,margin 值要相应做优化 */ 173 | h1,h2,h3,h4,h5,h6 { 174 | line-height:1;font-family:Arial,sans-serif;margin:1.4em 0 0.8em; 175 | } 176 | h1{font-size:1.8em;} 177 | h2{font-size:1.6em;} 178 | h3{font-size:1.4em;} 179 | h4{font-size:1.2em;} 180 | h5,h6{font-size:1em;} 181 | 182 | /* 现代排版:保证块/段落之间的空白隔行 */ 183 | .typo p, .typo pre, .typo ul, .typo ol, .typo dl, .typo form, .typo hr { 184 | margin:1em 0 0.6em; 185 | } 186 | {% endhighlight %} 187 | 188 |

三、附录

189 | 190 |
1、TYPO.CSS 排版偏重点
191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 |
类型语义标签注意点
基础标签标题h1h6全局不强制大小,.typo 中标题与其对应的内容应紧贴,并且有相应的大小设置
上、下标sup/sub保持与 MicroSoft Office Word 等程序的日常排版一致
引用blockquote显示/嵌套样式
缩写abbr是否都有下划线,鼠标 hover 是否为帮助手势
分割线hr显示的 paddingmargin正确
列表ul/ol/dl在全局没有 list-style,在 .typo 中对齐正确
定义列表dl全局 paddingmargin为0, .typo 中对齐正确
选项input[type=radio[, checkbox]]与其他 form 元素排版时是否居中
斜体i只设置一种斜体,让 emcite 显示为正体
强调em在全局显示正体,在 .typo 中显示与 bstrong 的样式一致,为粗休
加强strong/b显示为粗体
标记mark类似荧光笔
印刷small保持为正确字体的 80% 大小,颜色设置为浅灰色
表格table全局不显示线条,在 table 中显示表格外框,并且表头有浅灰背景
代码pre/code字体使用 courier 系字体,保持与 serif 有比较一致的显示效果
特殊符号着重号在文字下加点(•)在支持 :after:before 的浏览器可以做渐进增强实现
专名号林建锋专名号,有下划线,使用 u 或都 .typo-u
破折号——保持一划,而非两划
人民币¥使用两平等线的符号,或者 HTML 实体符号 &yen;
删除符已删除(deleted)一致化各浏览器显示,中英混排正确
加强类专名号.typo-u由于 u 被 HTML4 放弃,在向后兼容上推荐使用
着重符.typo-em利用 :after:before 实现着重符
首字下沉.typo-first特殊排版
清除浮动.clearfix与一般 CSS Reset 保持一对致 API
注意点(1)中英文混排行高/行距
(2)上下标在 IE 中显示效果
(3)块/段落分割空白是否符合设计原则
(4)input 多余空间问题
(5)默认字体色彩,目前采用 #333 在各种浏览显示比较好
342 |
2、开源许可
343 |

TYPO.CSS 基于 MIT License 开源,使用代码只需说明来源,或者引用 license.txt 即可。

344 | -------------------------------------------------------------------------------- /css/main.css: -------------------------------------------------------------------------------- 1 | /*****************************************************************************/ 2 | /* 3 | /* Common 4 | /* 5 | /*****************************************************************************/ 6 | 7 | /* Global Reset */ 8 | * { 9 | margin: 0; 10 | padding: 0; 11 | } 12 | 13 | html, body { height: 100%; } 14 | body, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, textarea, p, blockquote, th, td, hr, button, article, aside, details, figcaption, figure, footer, header, group, menu, nav, section { margin: 0; padding: 0; } 15 | ul, ol { 16 | list-style-type: none; 17 | } 18 | body { 19 | background: #92b3a2 url(../images/bg.jpg) repeat 0 0; 20 | font-size: 14px; 21 | line-height: 1.5; 22 | font-family: Georgia, Hiragino Sans GB,\5b8b\4f53; 23 | text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.2); 24 | } 25 | 26 | h1, h2, h3, h4, h5, h6 { 27 | font-size: 100%; } 28 | 29 | h1 { margin-bottom: 1em; } 30 | p { margin: 1em 0; } 31 | 32 | a { color: #91736b; text-decoration: none; } 33 | 34 | ::-moz-selection {background: rgba(252, 252, 82,0.2)} 35 | ::selection {background: rgba(252, 252, 82,0.2)} 36 | 37 | .fn-clear:after { visibility:hidden; display:block; font-size:0; content:" "; clear:both; height:0; } 38 | 39 | /*****************************************************************************/ 40 | /* 41 | /* Jekyll theme 42 | /* 43 | /*****************************************************************************/ 44 | 45 | /* --- head --- */ 46 | .head { 47 | width: 100%; 48 | height: 120px; 49 | } 50 | .header { 51 | width: 960px; 52 | height: 120px; 53 | margin: 0 auto; 54 | } 55 | .logo { 56 | display: block; 57 | float: left; 58 | width: 72px; 59 | height: 104px; 60 | text-align: center; 61 | } 62 | .logo a, .logo a:hover { 63 | display: block; 64 | width: 72px; 65 | height: 104px; 66 | font-size: 38px; 67 | line-height: 100px; 68 | vertical-align: middle; 69 | text-decoration: none; 70 | color: rgba(255, 255, 255, 0.9); 71 | background: url(../images/logo.jpg) no-repeat -72px 0; 72 | -webkit-transition: color 200ms ease-in-out; 73 | -moz-transition: color 200ms ease-in-out; 74 | -ms-transition: color 200ms ease-in-out; 75 | -o-transition: color 200ms ease-in-out; 76 | transition: color 200ms ease-in-out; 77 | } 78 | .logo a:hover { 79 | color: rgba(255, 255, 255, 0.7); 80 | background-position: 0 0; 81 | } 82 | .nav { 83 | width: 610px; 84 | padding-top: 82px; 85 | height: 30px; 86 | float: left; 87 | } 88 | .nav-item { 89 | float: left; 90 | line-height: 30px; 91 | margin: 0 0 0 20px; 92 | } 93 | .nav-item a { 94 | color: #46635e; 95 | font-size: 14px; 96 | text-decoration: none; 97 | } 98 | .nav-item a:hover { 99 | border-bottom: 3px double #46635e; 100 | } 101 | .nav-item-active a { 102 | color: #f2eeec; 103 | } 104 | .nav-item-active a:hover { 105 | border-bottom: 3px double rgba(255, 255, 255, 0.3); 106 | } 107 | .follow { 108 | float: left; 109 | width: 270px; 110 | padding-top: 80px; 111 | height: 30px; 112 | text-align: center; 113 | } 114 | .follow a { 115 | text-decoration: none; 116 | color: rgba(255, 255, 255, 0.82); 117 | width: 30px; 118 | height: 30px; 119 | line-height: 30px; 120 | background: #496661; 121 | display: block; 122 | float: left; 123 | font-size: 16px; 124 | border-radius: 60px; 125 | vertical-align: middle; 126 | margin-right: 10px; 127 | } 128 | .follow a:hover { 129 | color: rgba(255, 255, 255, 0.98); 130 | } 131 | 132 | /* --- contain --- */ 133 | .contain { 134 | width: 100%; 135 | height: auto; 136 | } 137 | .container { 138 | position: relative; 139 | width: 960px; 140 | height: auto; 141 | min-height: 500px; 142 | margin: 0 auto; 143 | } 144 | 145 | .main { 146 | float: left; 147 | width: 600px; 148 | padding: 40px 30px; 149 | min-height: 600px; 150 | height: auto; 151 | box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.1); 152 | background: #e3ded8 url(../images/cnt-top.jpg) repeat-x 0 0; 153 | } 154 | 155 | .main .article { 156 | line-height: 1.6; 157 | position: relative; 158 | margin-bottom: 40px; 159 | } 160 | .main .article h1 { font-size: 22px; color: #4d4d4d; } 161 | .main .article h2 { font-size: 20px; color: #4d4d4d; } 162 | .main .article h3 { font-size: 18px; color: #4d4d4d; } 163 | .main .article h4 { font-size: 16px; color: #4d4d4d; } 164 | .main .article h5 { color: #4d4d4d; } 165 | .main .article h6 { color: #4d4d4d; } 166 | 167 | .main .article .title { 168 | font-size: 24px; 169 | line-height: 32px; 170 | border-bottom: 4px double rgba(0, 0, 0, 0.1); 171 | } 172 | .main .article .title a { 173 | color: #4a4a4a; 174 | line-height: 32px; 175 | text-decoration: none; 176 | } 177 | .main .article .title a:hover { 178 | border-bottom: none; 179 | } 180 | .main .article p { 181 | line-height: 1.6; 182 | color: #565656; 183 | } 184 | .main .article ul, .main .article ol { 185 | list-style-type: disc; 186 | padding-left: 20px; 187 | margin-bottom: 1em; 188 | } 189 | .main .article li { 190 | line-height: 24px; 191 | } 192 | .main .article a:hover { 193 | border-bottom: 3px double rgba(0, 0, 0, 0.1); 194 | } 195 | .main .article blockquote { 196 | position: relative; 197 | padding: 10px 10px; 198 | background: rgba(0, 0, 0, 0.1); 199 | margin-bottom: 1em; 200 | } 201 | .main .article blockquote:after { 202 | width: 32px; 203 | height: 32px; 204 | display: block; 205 | position: absolute; 206 | top: 0; 207 | left: -62px; 208 | content: "❝"; 209 | background: #44635d; 210 | background: -moz-linear-gradient(0deg, #44635d 0%, #44635d 90%, #263733 100%); 211 | background: -webkit-linear-gradient(0deg, #44635d 0%, #44635d 90%, #263733 100%); 212 | background: -o-linear-gradient(0deg, #44635d 0%,#44635d 90%, #263733 100%); 213 | background: -ms-linear-gradient(to 0deg, #44635d 0%, #44635d 90%, #263733 100%); 214 | background: linear-gradient(to 0deg, #44635d 0%,#44635d 90%, #263733 100%); 215 | font-size: 18px; 216 | line-height: 32px; 217 | text-align: center; 218 | color: rgba(255, 255, 255, 0.8); 219 | } 220 | .main .article blockquote p { 221 | margin: 0 0; 222 | padding-bottom: 10px; 223 | } 224 | .main .article blockquote p:last-child { 225 | padding-bottom: 0; 226 | } 227 | 228 | .main .article table { 229 | position: relative; 230 | width: 100%; 231 | margin-bottom: 1em; 232 | color: #4d4d4d; 233 | } 234 | 235 | .main .article table:after { 236 | content: "⊞"; 237 | width: 32px; 238 | height: 32px; 239 | display: block; 240 | position: absolute; 241 | top: 0; 242 | left: -62px; 243 | background: #44635d; 244 | background: -moz-linear-gradient(0deg, #44635d 0%, #44635d 90%, #263733 100%); 245 | background: -webkit-linear-gradient(0deg, #44635d 0%, #44635d 90%, #263733 100%); 246 | background: -o-linear-gradient(0deg, #44635d 0%,#44635d 90%, #263733 100%); 247 | background: -ms-linear-gradient(to 0deg, #44635d 0%, #44635d 90%, #263733 100%); 248 | background: linear-gradient(to 0deg, #44635d 0%,#44635d 90%, #263733 100%); 249 | font-size: 18px; 250 | line-height: 32px; 251 | text-align: center; 252 | color: rgba(255, 255, 255, 0.8); 253 | } 254 | .main .article table th, .main .article table td { 255 | padding: 4px 0; 256 | } 257 | .main .article table th { 258 | background: rgba(0, 0, 0, 0.1); 259 | } 260 | .main .article table td { 261 | background: rgba(255, 255, 255, 0.3); 262 | text-indent: 6px; 263 | } 264 | 265 | .main .article pre { 266 | margin-bottom: 1em; 267 | padding: 10px 10px; 268 | color: #4d4d4d; 269 | background: rgba(0, 0, 0, 0.1); 270 | overflow: auto; 271 | } 272 | .main .highlight { 273 | position: relative; 274 | } 275 | 276 | .main .highlight pre:after { 277 | content: ""; 278 | width: 32px; 279 | height: 32px; 280 | display: block; 281 | position: absolute; 282 | top: 0; 283 | left: -62px; 284 | background: #44635d; 285 | background: -moz-linear-gradient(0deg, #44635d 0%, #44635d 90%, #263733 100%); 286 | background: -webkit-linear-gradient(0deg, #44635d 0%, #44635d 90%, #263733 100%); 287 | background: -o-linear-gradient(0deg, #44635d 0%,#44635d 90%, #263733 100%); 288 | background: -ms-linear-gradient(to 0deg, #44635d 0%, #44635d 90%, #263733 100%); 289 | background: linear-gradient(to 0deg, #44635d 0%,#44635d 90%, #263733 100%); 290 | font-size: 12px; 291 | line-height: 32px; 292 | text-align: center; 293 | color: rgba(255, 255, 255, 0.8); 294 | } 295 | 296 | .main .article img { 297 | position: relative; 298 | max-width: 100%; 299 | } 300 | 301 | 302 | .main .article .more { 303 | position: absolute; 304 | width: 32px; 305 | height: 32px; 306 | background: #e54e4d; 307 | background: -moz-linear-gradient(0deg, #e54e4d 0%, #e54e4d 90%, #b13c3c 100%); 308 | background: -webkit-linear-gradient(0deg, #e54e4d 0%, #e54e4d 90%, #b13c3c 100%); 309 | background: -o-linear-gradient(0deg, #e54e4d 0%,#e54e4d 90%, #b13c3c 100%); 310 | background: -ms-linear-gradient(to 0deg, #e54e4d 0%, #e54e4d 90%, #b13c3c 100%); 311 | background: linear-gradient(to 0deg, #e54e4d 0%,#e54e4d 90%, #b13c3c 100%); 312 | display: block; 313 | top: 0; 314 | left: -62px; 315 | text-decoration: none; 316 | font-size: 18px; 317 | line-height: 32px; 318 | text-align: center; 319 | color: rgba(255, 255, 255, 0.98); 320 | } 321 | .main .article .more:hover { 322 | border-bottom: none; 323 | color: rgba(255, 255, 255, 0.86); 324 | } 325 | .main .article .info { 326 | font-size: 14px; 327 | line-height: 24px; 328 | vertical-align: middle; 329 | } 330 | .main .article-post .info { 331 | margin-bottom: 30px; 332 | } 333 | .main .article .info-title { 334 | color: #888; 335 | vertical-align: middle; 336 | line-height: 24px; 337 | } 338 | .main .article .info-date { 339 | margin-right: 15px; 340 | color: #565656; 341 | line-height: 24px; 342 | vertical-align: middle; 343 | } 344 | .main .article .info-link { 345 | margin-right: 15px; 346 | line-height: 24px; 347 | vertical-align: middle; 348 | border-bottom: none; 349 | } 350 | .main .article .info-link a:hover { 351 | border-bottom: none; 352 | } 353 | 354 | .main .pagination { 355 | line-height: 32px; 356 | padding-top: 20px; 357 | 358 | } 359 | .main .pagination li { 360 | float: left; 361 | margin: 0 10px 10px 0; 362 | } 363 | 364 | .main .pagination-icon { 365 | width: 32px; 366 | height: 32px; 367 | display: block; 368 | float: left; 369 | font-size: 16px; 370 | line-height: 32px; 371 | text-align: center; 372 | color: #fefefe; 373 | background: #99b9c4; 374 | } 375 | .main .pagination-list { 376 | margin-left: 10px; 377 | width: 550px; 378 | height: 32px; 379 | line-height: 32px; 380 | float: left; 381 | } 382 | .main .pagination-list li a { 383 | width: 32px; 384 | height: 32px; 385 | display: block; 386 | background: #f2eeec; 387 | text-align: center; 388 | } 389 | .main .pagination-list .current a { 390 | background: #e54e4d; 391 | color: #fefefe; 392 | } 393 | 394 | .main .article .article-year { 395 | position: relative; 396 | margin: 30px 0; 397 | padding: 0 0; 398 | list-style: none; 399 | } 400 | .main .article-year:after { 401 | content: attr(data-year); 402 | width: 32px; 403 | height: 32px; 404 | display: block; 405 | position: absolute; 406 | top: 0; 407 | left: -62px; 408 | background: #e54e4d; 409 | background: -moz-linear-gradient(0deg, #e54e4d 0%, #e54e4d 90%, #b13c3c 100%); 410 | background: -webkit-linear-gradient(0deg, #e54e4d 0%, #e54e4d 90%, #b13c3c 100%); 411 | background: -o-linear-gradient(0deg, #e54e4d 0%,#e54e4d 90%, #b13c3c 100%); 412 | background: -ms-linear-gradient(to 0deg, #e54e4d 0%, #e54e4d 90%, #b13c3c 100%); 413 | background: linear-gradient(to 0deg, #e54e4d 0%,#e54e4d 90%, #b13c3c 100%); 414 | font-size: 12px; 415 | line-height: 32px; 416 | text-align: center; 417 | color: rgba(255, 255, 255, 0.8); 418 | } 419 | .main .article-year li { 420 | line-height: 32px; 421 | padding-bottom: 10px; 422 | } 423 | .main .article-year li span { 424 | width: 60px; 425 | text-align: right; 426 | padding: 0 10px; 427 | display: block; 428 | float: left; 429 | line-height: 32px; 430 | background: #99b9c4; 431 | color: #fefefe; 432 | } 433 | .main .article-year li a { 434 | width: 500px; 435 | display: block; 436 | float: left; 437 | line-height: 32px; 438 | background: #f2eeec; 439 | padding: 0 10px; 440 | } 441 | .main .article-year li a:hover { 442 | color: #45625d; 443 | border-bottom: none; 444 | } 445 | .main .article .about { 446 | margin: 30px 0; 447 | position: relative; 448 | height: auto; 449 | } 450 | .main .article .about:after { 451 | content: "❍"; 452 | width: 32px; 453 | height: 32px; 454 | display: block; 455 | position: absolute; 456 | top: 0; 457 | left: -62px; 458 | background: #e54e4d; 459 | background: -moz-linear-gradient(0deg, #e54e4d 0%, #e54e4d 90%, #b13c3c 100%); 460 | background: -webkit-linear-gradient(0deg, #e54e4d 0%, #e54e4d 90%, #b13c3c 100%); 461 | background: -o-linear-gradient(0deg, #e54e4d 0%,#e54e4d 90%, #b13c3c 100%); 462 | background: -ms-linear-gradient(to 0deg, #e54e4d 0%, #e54e4d 90%, #b13c3c 100%); 463 | background: linear-gradient(to 0deg, #e54e4d 0%,#e54e4d 90%, #b13c3c 100%); 464 | font-size: 12px; 465 | line-height: 32px; 466 | text-align: center; 467 | color: rgba(255, 255, 255, 0.8); 468 | } 469 | .main .article .about-image { 470 | width: 200px; 471 | float: left; 472 | height: auto; 473 | } 474 | .main .article .about-image img { 475 | width: 196px; 476 | height: auto; 477 | border: 2px solid #99b9c4; 478 | } 479 | .main .article .about-image img:hover { 480 | border: 2px solid #43625c; 481 | } 482 | .main .article .about-text { 483 | width: 380px; 484 | float: left; 485 | margin-right: 20px; 486 | } 487 | .main .article .about-text p:first-child { 488 | margin-top: 0; 489 | } 490 | .main .article .social { 491 | margin: 30px 0; 492 | position: relative; 493 | clear: both; 494 | height: auto; 495 | } 496 | .main .article .social:after { 497 | content: "☛"; 498 | width: 32px; 499 | height: 32px; 500 | display: block; 501 | position: absolute; 502 | top: 0; 503 | left: -62px; 504 | background: #e54e4d; 505 | background: -moz-linear-gradient(0deg, #e54e4d 0%, #e54e4d 90%, #b13c3c 100%); 506 | background: -webkit-linear-gradient(0deg, #e54e4d 0%, #e54e4d 90%, #b13c3c 100%); 507 | background: -o-linear-gradient(0deg, #e54e4d 0%,#e54e4d 90%, #b13c3c 100%); 508 | background: -ms-linear-gradient(to 0deg, #e54e4d 0%, #e54e4d 90%, #b13c3c 100%); 509 | background: linear-gradient(to 0deg, #e54e4d 0%,#e54e4d 90%, #b13c3c 100%); 510 | font-size: 12px; 511 | line-height: 32px; 512 | text-align: center; 513 | color: rgba(255, 255, 255, 0.8); 514 | } 515 | .main .article .social a { 516 | width: 32px; 517 | height: 32px; 518 | display: block; 519 | text-align: center; 520 | line-height: 32px; 521 | margin: 0 10px 10px 0; 522 | background: #f2eeec; 523 | float: left; 524 | } 525 | .main .article .social a:hover { 526 | background: #99b9c4; 527 | color: #fefefe; 528 | border-bottom: none; 529 | } 530 | .main .article .contact { 531 | margin: 30px 0; 532 | position: relative; 533 | height: auto; 534 | } 535 | .main .article .contact a { 536 | line-height: 32px; 537 | height: 32px; 538 | display: inline-block; 539 | text-align: center; 540 | padding: 0 10px; 541 | background: #f2eeec; 542 | width: auto; 543 | } 544 | .main .article .contact a:hover { 545 | background: #99b9c4; 546 | color: #fefefe; 547 | border-bottom: none; 548 | } 549 | 550 | .main .article .links { 551 | margin: 30px 0; 552 | } 553 | .main .article .links-category { 554 | margin-bottom: 10px; 555 | } 556 | .main .article .links-list { 557 | width: 100%; 558 | clear: both; 559 | list-style-type: none; 560 | padding: 0 0; 561 | } 562 | .main .article .links-list li { 563 | width: 40%; 564 | margin: 0 10% 10px 0; 565 | padding: 0 0; 566 | float: left; 567 | } 568 | 569 | .main .article .links-list li a { 570 | display: block; 571 | line-height: 32px; 572 | height: 32px; 573 | padding: 0 10px; 574 | background: #f2eeec; 575 | } 576 | .main .article .links-list li a:hover { 577 | border-bottom: none; 578 | color: #45625d; 579 | } 580 | .main .article .article-previous { 581 | margin: 20px 0; 582 | border-top: 1px solid rgba(0, 0, 0, 0.1); 583 | padding: 10px 0; 584 | position: relative; 585 | } 586 | .main .article .article-previous .prev, 587 | .main .article .article-previous .next { 588 | display: inline-block; 589 | height: 32px; 590 | line-height: 32px; 591 | padding: 0 10px; 592 | background: #f2eeec; 593 | border-bottom: none; 594 | } 595 | .main .article .article-previous .prev { 596 | float: left; 597 | } 598 | .main .article .article-previous .next { 599 | float: right; 600 | } 601 | .main .article .article-previous .prev:hover, 602 | .main .article .article-previous .next:hover { 603 | border-bottom: none; 604 | color: #45625d; 605 | } 606 | .main .article .comment { 607 | margin: 30px 0 0 0; 608 | } 609 | 610 | .main .article .categories { 611 | width: 100%; 612 | overflow: hidden; 613 | margin: 20px 0; 614 | padding-left: 0; 615 | } 616 | .main .categories .categories-item { 617 | list-style-type: none; 618 | background: #99b9c4; 619 | color: #fff; 620 | margin-right: 10px; 621 | padding: 3px 20px; 622 | float: left; 623 | } 624 | .main .categories .categories-item a { 625 | color: #fff; 626 | } 627 | 628 | .aside { 629 | padding: 20px 20px 40px 20px; 630 | margin-top: 26px; 631 | float: left; 632 | background: #f2eeec url(../images/aside-bg.jpg) no-repeat 0px 0px; 633 | width: 240px; 634 | min-height: 500px; 635 | height: auto; 636 | box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.1), 1px 0 4px rgba(0, 0, 0, 0.3) inset; 637 | } 638 | .aside-contact { 639 | width: 220px; 640 | height: auto; 641 | padding: 10px 10px; 642 | border-radius: 5px 5px; 643 | background: rgba(110, 70, 60, 0.72); 644 | text-align: left; 645 | } 646 | .aside-contact .title { 647 | line-height: 24px; 648 | color: #232323; 649 | font-size: 14px; 650 | line-height: 24px; 651 | font-family: 'Spirax', cursive; 652 | text-transform: uppercase; 653 | } 654 | .aside-contact .det { 655 | padding: 10px 0; 656 | line-height: 24px; 657 | color: #232323; 658 | clear: both; 659 | height: auto; 660 | } 661 | .aside-contact .det-image { 662 | width: 48px; 663 | height: 48px; 664 | float: left; 665 | padding: 2px 2px; 666 | background: #fff; 667 | border: 1px solid #9d6156; 668 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); 669 | } 670 | .aside-contact .det-image img { 671 | width: 48px; 672 | height: 48px; 673 | display: block; 674 | text-align: center; 675 | vertical-align: middle; 676 | } 677 | .aside-contact .det-text { 678 | width: 150px; 679 | padding-left: 10px; 680 | float: left; 681 | font-size: 12px; 682 | line-height: 18px; 683 | } 684 | .aside-contact .det-text p { 685 | padding-top: 0; 686 | margin-top: 0; 687 | } 688 | .aside-contact .det-text p:last-child { 689 | padding-bottom: 0; 690 | margin-bottom: 0; 691 | } 692 | .aside-item { 693 | margin: 20px 0; 694 | } 695 | .aside-item .title { 696 | line-height: 24px; 697 | color: #232323; 698 | font-size: 14px; 699 | line-height: 24px; 700 | padding-bottom: 3px; 701 | border-bottom: 1px solid rgba(0, 0, 0, 0.1); 702 | box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2); 703 | font-family: 'Spirax', cursive; 704 | text-transform: uppercase; 705 | } 706 | .aside-item .list { 707 | padding: 10px 0; 708 | margin-bottom: 10px; 709 | font-size: 14px; 710 | font-family: Arial; 711 | list-style-type: disc; 712 | line-height: 24px; 713 | padding-left: 18px; 714 | text-decoration: none; 715 | } 716 | .aside-item .list a { 717 | color: #91736b; 718 | text-decoration: none; 719 | } 720 | .aside-item .list a:hover { 721 | border-bottom: 3px double rgba(0, 0, 0, 0.1); 722 | } 723 | /* --- foot --- */ 724 | .foot { 725 | width: 100%; 726 | height: 100px; 727 | } 728 | .footer { 729 | width: 960px; 730 | padding-top: 20px; 731 | height: 80px; 732 | margin: 0 auto; 733 | } --------------------------------------------------------------------------------