Code Monkey home page Code Monkey logo

zhangkn.github.io's Introduction

不要学你工作中用不上的东西,不经过实战检验的东西会一直停留在demo阶段;如果想学,你就一定要想方设法找点场景落地

Github Pages 整体思路

本地编写符合Jekyll规范的网站源码,然后上传到github,由github生成并托管整个网站;享受git的版本管理功能;用自己喜欢的编辑器写文章 缺点:不适合大型网站,因为没有用到数据库,每运行一次都必须遍历全部的文本文件,网站越大,生成时间越长 适合暂时还没买服务器,数据库的人

使用条件

Jekyll 支持 Mac 、Windows、ubuntu 、Linux 操作系统
Jekyll 需要依赖:Ruby、bundler

安装Jekyll

  • {{ page.title }}表示文章标题,
  • {{ content }}表示文章内容
  • { page.date }}则是嵌入文件名的日期(也可以在文件头重新定义date变量),"| date_to_string"表示将page.date变量转化成人类可读的格式
  • {% for post in site.posts %},表示对所有帖子进行一个遍历。 *这里要注意的是,Liquid模板语言规定,输出内容使用两层大括号,单纯的命令使用一层大括号。
  • 每篇文章的头部,必须有一个yaml文件头 用来设置一些元数据 每一行设置一种元数据; title :该文章的标题 如果不设置这个值,默认使用嵌入文件名的标题
  • [重要文件]
devzkndeMacBook-Pro:zhangkn.github.io devzkn$ git checkout --  css/main.css
devzkndeMacBook-Pro:zhangkn.github.io devzkn$ git checkout --  _layouts/post.html
devzkndeMacBook-Pro:zhangkn.github.io devzkn$ git checkout --   _includes/footer.html
devzkndeMacBook-Pro:zhangkn.github.io devzkn$ git diff  _config.yml

1) 目前此博客版本,缺少catalog,我打算采用新的版本,可能暂时不更新。


  • [devzkndeMacBook-Pro:~ devzkn$ cat .bash_profile]
使用别名快速的开启本地调试模式
alias sio='bundle exec jekyll server -s ~/githubPages/zhangkn.github.io'


Configuration file: /Users/devzkn/githubPages/zhangkn.github.io/_config.yml
            Source: /Users/devzkn/githubPages/zhangkn.github.io
       Destination: /Users/devzkn/githubPages/zhangkn.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
                    done in 32.002 seconds.
 Auto-regeneration: enabled for '/Users/devzkn/githubPages/zhangkn.github.io'
    Server address: http://127.0.0.1:4000
  Server running... press ctrl-c to stop.
      Regenerating: 1 file(s) changed at 2018-04-19 14:49:31 

添加动态功能必须使用外部服务

  • 访问量统计分析
  • comment

访问量统计分析

html标签验证 网站首页html代码的标签与标签之间

comment

zhangkn.github.io's People

Contributors

zhangkn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.