diff --git a/Gemfile b/Gemfile deleted file mode 100755 index 0612ed55db..0000000000 --- a/Gemfile +++ /dev/null @@ -1,5 +0,0 @@ -source 'https://rubygems.org' -gem 'jekyll' -gem 'redcarpet' -gem 'jekyll-paginate' -gem 'jekyll-sitemap' diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100755 index afef6f8693..0000000000 --- a/Gemfile.lock +++ /dev/null @@ -1,70 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - addressable (2.6.0) - public_suffix (>= 2.0.2, < 4.0) - colorator (1.1.0) - concurrent-ruby (1.1.4) - em-websocket (0.5.1) - eventmachine (>= 0.12.9) - http_parser.rb (~> 0.6.0) - eventmachine (1.2.7) - ffi (1.10.0) - forwardable-extended (2.6.0) - http_parser.rb (0.6.0) - i18n (0.9.5) - concurrent-ruby (~> 1.0) - jekyll (3.8.5) - addressable (~> 2.4) - colorator (~> 1.0) - em-websocket (~> 0.5) - i18n (~> 0.7) - jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 2.0) - kramdown (~> 1.14) - liquid (~> 4.0) - mercenary (~> 0.3.3) - pathutil (~> 0.9) - rouge (>= 1.7, < 4) - safe_yaml (~> 1.0) - jekyll-paginate (1.1.0) - jekyll-sass-converter (1.5.2) - sass (~> 3.4) - jekyll-sitemap (1.1.1) - jekyll (~> 3.3) - jekyll-watch (2.1.2) - listen (~> 3.0) - kramdown (1.17.0) - liquid (4.0.1) - listen (3.1.5) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - ruby_dep (~> 1.2) - mercenary (0.3.6) - pathutil (0.16.2) - forwardable-extended (~> 2.6) - public_suffix (3.0.3) - rb-fsevent (0.10.3) - rb-inotify (0.10.0) - ffi (~> 1.0) - redcarpet (3.4.0) - rouge (3.3.0) - ruby_dep (1.5.0) - safe_yaml (1.0.4) - sass (3.7.3) - sass-listen (~> 4.0.0) - sass-listen (4.0.0) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - -PLATFORMS - ruby - -DEPENDENCIES - jekyll - jekyll-paginate - jekyll-sitemap - redcarpet - -BUNDLED WITH - 1.16.1 diff --git a/README.md b/README.md index 2a9187d4c6..152fa8799b 100755 --- a/README.md +++ b/README.md @@ -1,115 +1 @@ - -[leopard](http://leopardpan.cn) 是一个简洁的博客模板,响应式主题, 适配了电脑、手机各种屏幕,看效果直接点击下面链接 - - * [博客链接](http://leopardpan.cn) (部署在国内,访问更快) - * [Demo链接](http://leopardpan.github.io/) (部署在github page) - -如果你喜欢请 Star ,你的 Star 是我持续更新的动力, 谢谢 😄. - -### 你在搭建个人博客遇到任何问题都可以找我 - -遇到解决不了的问题 [需要技术支持联系我](http://leopardpan.cn/support/) - - -### 环境要求 - -* Jekyll 支持: Mac 、Windows、ubuntu 、Linux 操作系统 -* Jekyll 需要依赖: Ruby、bundler - -### 使用手册 - -[Jekyll搭建个人博客](http://leopardpan.cn/2016/10/jekyll_tutorials1/) : 使用Jekyll搭建个人博客的教程,及如何把这个博客模板修改成你自己的博客,里面也有大量的评论、Jekyll 搭建博客各种环境出现过的问题。 - -[HEXO搭建个人博客](http://leopardpan.cn/2015/08/HEXO%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/) : 使用 HEXO 基于 Github Page 搭建个人博客, 教程里面累计了大量提问和评论,如果你在搭建博客时遇到问题,可以看看这个教程。 - - -#### 安装Jekyll - -[Jekyll中文官方文档](http://jekyll.bootcss.com/) , 如果你已经安装过了 Jekyll,可以忽略此处。 - -> $ gem install jekyll - -#### 获取博客模板 - -> $ git clone https://github.com/leopardpan/leopardpan.github.io.git - -或者直接[下载博客](https://github.com/leopardpan/leopardpan.github.io/archive/master.zip) - -进leopardpan.github.io/ 目录下, 开启本地服务 - -> $ jekyll server - -在浏览器输入 [127.0.0.1:4000](127.0.0.1:4000) , 就可以看到博客效果了。 - - -### 提示 - ->* 如果你想使用我的模板,请把 _posts/ 目录下的文章都去掉。 ->* 修改 _config.yml 文件里面的内容为你自己的个人信息。 - -如果在部署博客的时候发现问题,可以直接在[Issues](https://github.com/leopardpan/leopardpan.github.io/issues)里面提问。 - - -### 把这个博客变成你自己的博客 - -根据上面【提示】修改过后,在你的github里创建一个username.github.io的仓库,username指的值你的github的用户名。 -创建完成后,把我的这个模板使用git push到你的username.github.io仓库下就行了。 -搭建博客如果遇到问题可以看看我教程[Jekyll搭建个人博客](http://leopardpan.cn/2016/10/jekyll_tutorials1/)。 - - -### 赞助 - -你可以通过下方二维码赞助本项目,资金将用于服务器开销以及今后的公共服务 - -感谢所有赞助过本项目的朋友,你们都为本项目贡献了自己的一份力量 - -
- -微信二维码 -wechat -
- -
- -支付宝二维码 -alipay -
- - -### 效果预览 - -#### 头像效果 - -![](http://leopardpan.github.io/images/readme/icon.gif) - -如果你只想要我博客里的头像效果,你只需要拿 leopardpan.github.io/_includes/side-panel.html 文件里面 `头像效果` 和 leopardpan.github.io/css/main.css 里面最后面 `头像效果` 部分就行了。 - - -*** - -#### 博客首页 - -![](http://leopardpan.github.io//images/readme/img4.png) - -*** - -#### 每篇文章下面都支持打赏 - -![](http://leopardpan.github.io/images/readme/img3.png) - -#### 文章详情 - -![](http://leopardpan.github.io/images/readme/img1.png) - - -#### 文章支持标签分类 - -![](http://leopardpan.github.io/images/readme/img2.png) - -#### 手机端效果 - -wechat - -#### 感谢 - -本博客在[Vno Jekyll](https://github.com/onevcat/vno-jekyll)基础上修改的。 \ No newline at end of file +CYCLUS diff --git a/Rakefile b/Rakefile deleted file mode 100644 index 0c0aa416dc..0000000000 --- a/Rakefile +++ /dev/null @@ -1,311 +0,0 @@ -require "rubygems" -require 'rake' -require 'yaml' -require 'time' - -SOURCE = "." -CONFIG = { - 'version' => "0.3.0", - 'themes' => File.join(SOURCE, "_includes", "themes"), - 'layouts' => File.join(SOURCE, "_layouts"), - 'posts' => File.join(SOURCE, "_posts"), - 'post_ext' => "md", - 'theme_package_version' => "0.1.0" -} - -# Path configuration helper -module JB - class Path - SOURCE = "." - Paths = { - :layouts => "_layouts", - :themes => "_includes/themes", - :theme_assets => "assets/themes", - :theme_packages => "_theme_packages", - :posts => "_posts" - } - - def self.base - SOURCE - end - - # build a path relative to configured path settings. - def self.build(path, opts = {}) - opts[:root] ||= SOURCE - path = "#{opts[:root]}/#{Paths[path.to_sym]}/#{opts[:node]}".split("/") - path.compact! - File.__send__ :join, path - end - - end #Path -end #JB - -# Usage: rake post title="A Title" [date="2012-02-09"] [tags=[tag1,tag2]] [category="category"] -desc "Begin a new post in #{CONFIG['posts']}" -task :post do - abort("rake aborted: '#{CONFIG['posts']}' directory not found.") unless FileTest.directory?(CONFIG['posts']) - title = ENV["title"] || "new-post" - tags = ENV["tags"] || "[]" - category = ENV["category"] || "" - category = "\"#{category.gsub(/-/,' ')}\"" if !category.empty? - slug = title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '') - begin - date = (ENV['date'] ? Time.parse(ENV['date']) : Time.now).strftime('%Y-%m-%d') - rescue => e - puts "Error - date format must be YYYY-MM-DD, please check you typed it correctly!" - exit -1 - end - filename = File.join(CONFIG['posts'], "#{date}-#{slug}.#{CONFIG['post_ext']}") - if File.exist?(filename) - abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n' - end - - puts "Creating new post: #{filename}" - open(filename, 'w') do |post| - post.puts "---" - post.puts "layout: post" - post.puts "title: \"#{title.gsub(/-/,' ')}\"" - post.puts 'description: ""' - post.puts "category: #{category}" - post.puts "tags: #{tags}" - post.puts "---" - post.puts "{% include JB/setup %}" - end -end # task :post - -# Usage: rake page name="about.html" -# You can also specify a sub-directory path. -# If you don't specify a file extention we create an index.html at the path specified -desc "Create a new page." -task :page do - name = ENV["name"] || "new-page.md" - filename = File.join(SOURCE, "#{name}") - filename = File.join(filename, "index.html") if File.extname(filename) == "" - title = File.basename(filename, File.extname(filename)).gsub(/[\W\_]/, " ").gsub(/\b\w/){$&.upcase} - if File.exist?(filename) - abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n' - end - - mkdir_p File.dirname(filename) - puts "Creating new page: #{filename}" - open(filename, 'w') do |post| - post.puts "---" - post.puts "layout: page" - post.puts "title: \"#{title}\"" - post.puts 'description: ""' - post.puts "---" - post.puts "{% include JB/setup %}" - end -end # task :page - -desc "Launch preview environment" -task :preview do - system "jekyll serve -w" -end # task :preview - -# Public: Alias - Maintains backwards compatability for theme switching. -task :switch_theme => "theme:switch" - -namespace :theme do - - # Public: Switch from one theme to another for your blog. - # - # name - String, Required. name of the theme you want to switch to. - # The theme must be installed into your JB framework. - # - # Examples - # - # rake theme:switch name="the-program" - # - # Returns Success/failure messages. - desc "Switch between Jekyll-bootstrap themes." - task :switch do - theme_name = ENV["name"].to_s - theme_path = File.join(CONFIG['themes'], theme_name) - settings_file = File.join(theme_path, "settings.yml") - non_layout_files = ["settings.yml"] - - abort("rake aborted: name cannot be blank") if theme_name.empty? - abort("rake aborted: '#{theme_path}' directory not found.") unless FileTest.directory?(theme_path) - abort("rake aborted: '#{CONFIG['layouts']}' directory not found.") unless FileTest.directory?(CONFIG['layouts']) - - Dir.glob("#{theme_path}/*") do |filename| - next if non_layout_files.include?(File.basename(filename).downcase) - puts "Generating '#{theme_name}' layout: #{File.basename(filename)}" - - open(File.join(CONFIG['layouts'], File.basename(filename)), 'w') do |page| - if File.basename(filename, ".html").downcase == "default" - page.puts "---" - page.puts File.read(settings_file) if File.exist?(settings_file) - page.puts "---" - else - page.puts "---" - page.puts "layout: default" - page.puts "---" - end - page.puts "{% include JB/setup %}" - page.puts "{% include themes/#{theme_name}/#{File.basename(filename)} %}" - end - end - - puts "=> Theme successfully switched!" - puts "=> Reload your web-page to check it out =)" - end # task :switch - - # Public: Install a theme using the theme packager. - # Version 0.1.0 simple 1:1 file matching. - # - # git - String, Optional path to the git repository of the theme to be installed. - # name - String, Optional name of the theme you want to install. - # Passing name requires that the theme package already exist. - # - # Examples - # - # rake theme:install git="https://github.com/jekyllbootstrap/theme-twitter.git" - # rake theme:install name="cool-theme" - # - # Returns Success/failure messages. - desc "Install theme" - task :install do - if ENV["git"] - manifest = theme_from_git_url(ENV["git"]) - name = manifest["name"] - else - name = ENV["name"].to_s.downcase - end - - packaged_theme_path = JB::Path.build(:theme_packages, :node => name) - - abort("rake aborted! - => ERROR: 'name' cannot be blank") if name.empty? - abort("rake aborted! - => ERROR: '#{packaged_theme_path}' directory not found. - => Installable themes can be added via git. You can find some here: http://github.com/jekyllbootstrap - => To download+install run: `rake theme:install git='[PUBLIC-CLONE-URL]'` - => example : rake theme:install git='git@github.com:jekyllbootstrap/theme-the-program.git' - ") unless FileTest.directory?(packaged_theme_path) - - manifest = verify_manifest(packaged_theme_path) - - # Get relative paths to packaged theme files - # Exclude directories as they'll be recursively created. Exclude meta-data files. - packaged_theme_files = [] - FileUtils.cd(packaged_theme_path) { - Dir.glob("**/*.*") { |f| - next if ( FileTest.directory?(f) || f =~ /^(manifest|readme|packager)/i ) - packaged_theme_files << f - } - } - - # Mirror each file into the framework making sure to prompt if already exists. - packaged_theme_files.each do |filename| - file_install_path = File.join(JB::Path.base, filename) - if File.exist? file_install_path and ask("#{file_install_path} already exists. Do you want to overwrite?", ['y', 'n']) == 'n' - next - else - mkdir_p File.dirname(file_install_path) - cp_r File.join(packaged_theme_path, filename), file_install_path - end - end - - puts "=> #{name} theme has been installed!" - puts "=> ---" - if ask("=> Want to switch themes now?", ['y', 'n']) == 'y' - system("rake switch_theme name='#{name}'") - end - end - - # Public: Package a theme using the theme packager. - # The theme must be structured using valid JB API. - # In other words packaging is essentially the reverse of installing. - # - # name - String, Required name of the theme you want to package. - # - # Examples - # - # rake theme:package name="twitter" - # - # Returns Success/failure messages. - desc "Package theme" - task :package do - name = ENV["name"].to_s.downcase - theme_path = JB::Path.build(:themes, :node => name) - asset_path = JB::Path.build(:theme_assets, :node => name) - - abort("rake aborted: name cannot be blank") if name.empty? - abort("rake aborted: '#{theme_path}' directory not found.") unless FileTest.directory?(theme_path) - abort("rake aborted: '#{asset_path}' directory not found.") unless FileTest.directory?(asset_path) - - ## Mirror theme's template directory (_includes) - packaged_theme_path = JB::Path.build(:themes, :root => JB::Path.build(:theme_packages, :node => name)) - mkdir_p packaged_theme_path - cp_r theme_path, packaged_theme_path - - ## Mirror theme's asset directory - packaged_theme_assets_path = JB::Path.build(:theme_assets, :root => JB::Path.build(:theme_packages, :node => name)) - mkdir_p packaged_theme_assets_path - cp_r asset_path, packaged_theme_assets_path - - ## Log packager version - packager = {"packager" => {"version" => CONFIG["theme_package_version"].to_s } } - open(JB::Path.build(:theme_packages, :node => "#{name}/packager.yml"), "w") do |page| - page.puts packager.to_yaml - end - - puts "=> '#{name}' theme is packaged and available at: #{JB::Path.build(:theme_packages, :node => name)}" - end - -end # end namespace :theme - -# Internal: Download and process a theme from a git url. -# Notice we don't know the name of the theme until we look it up in the manifest. -# So we'll have to change the folder name once we get the name. -# -# url - String, Required url to git repository. -# -# Returns theme manifest hash -def theme_from_git_url(url) - tmp_path = JB::Path.build(:theme_packages, :node => "_tmp") - abort("rake aborted: system call to git clone failed") if !system("git clone #{url} #{tmp_path}") - manifest = verify_manifest(tmp_path) - new_path = JB::Path.build(:theme_packages, :node => manifest["name"]) - if File.exist?(new_path) && ask("=> #{new_path} theme package already exists. Override?", ['y', 'n']) == 'n' - remove_dir(tmp_path) - abort("rake aborted: '#{manifest["name"]}' already exists as theme package.") - end - - remove_dir(new_path) if File.exist?(new_path) - mv(tmp_path, new_path) - manifest -end - -# Internal: Process theme package manifest file. -# -# theme_path - String, Required. File path to theme package. -# -# Returns theme manifest hash -def verify_manifest(theme_path) - manifest_path = File.join(theme_path, "manifest.yml") - manifest_file = File.open( manifest_path ) - abort("rake aborted: repo must contain valid manifest.yml") unless File.exist? manifest_file - manifest = YAML.load( manifest_file ) - manifest_file.close - manifest -end - -def ask(message, valid_options) - if valid_options - answer = get_stdin("#{message} #{valid_options.to_s.gsub(/"/, '').gsub(/, /,'/')} ") while !valid_options.include?(answer) - else - answer = get_stdin(message) - end - answer -end - -def get_stdin(message) - print message - STDIN.gets.chomp -end - -#Load custom rake scripts -Dir['_rake/*.rake'].each { |r| load r } diff --git a/_config.yml b/_config.yml index 9795797653..2bbe89a5fd 100755 --- a/_config.yml +++ b/_config.yml @@ -1,43 +1,43 @@ # Basic -title: 潘柏信 +title: CYC subtitle: 个人站 description: 欢迎来到我的个人站~ # 头像里面的标题 -avatarTitle: leopardpan +avatarTitle: CYCLUS # 头像里面的描述 -avatarDesc: iOS / 机器学习 -url: "http://leopardpan.cn" +avatarDesc: Java / 机器学习 +# url: "http://leopardpan.cn" # 博客是否自动生成目录,false为不生成 enableToc: true # Comment -comment: - # livere: MTAyMC81MDk5NC8yNzQ3Ng # https://www.livere.com - disqus: leopard - # uyan: 2143225 # 有言id,登录有言官网申请 +# comment: +# # livere: MTAyMC81MDk5NC8yNzQ3Ng # https://www.livere.com +# disqus: leopard +# # uyan: 2143225 # 有言id,登录有言官网申请 # Social social: - weibo: 5366874726 - github: leopardpan + weibo: CYCLUS + github: CYCLUS # zhihu: panpanleopard # juejin: xxx - jianshu: 2ada30d8d0f7 + jianshu: CYCLUS # twitter: - mail: leopardpan@icloud.com + mail: CYCLUS@icloud.com # 百度统计 # 使用博客模板请去掉或者更换 id -baidu: - id: 8ba1c6be0953b6f9c2ba38e57f615421 +# baidu: +# id: 8ba1c6be0953b6f9c2ba38e57f615421 # Google Analytics # 使用博客模板请去掉或者更换 id -ga: - id: UA-84134159-3 - host: auto +# ga: +# id: UA-84134159-3 +# host: auto # 《----------------- 上面的信息修改成你自己的 ---------------------------》 @@ -76,4 +76,5 @@ gems: [jekyll-paginate,jekyll-sitemap] paginate: 20 paginate_path: "page/:num/" - +plugins: + - jekyll-paginate \ No newline at end of file diff --git a/_includes/footer.html b/_includes/footer.html index b3fc22ce43..9d651b2c71 100755 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -87,7 +87,7 @@