Giter Site home page Giter Site logo

openhw's Introduction

本地运行网站

要在本地运行网站,你需要安装Ruby以及Jekyll,详情请看这里

安装

输入

git clone https://github.com/Zenfendson/OpenHW.git 

在本地的根路径下打开powerershell,输入Jekyll bundle等命令创建依赖

这个项目的依赖通过Gemfile管理,Gemfile.lock里面有着当前Jekyll版本下对应的依赖,你需要根据你的Jekyll版本更新,尝试bundle update指令

成功后输入bundle exec Jekyll serve运行,也可在命令后加入后缀--livereload, 可是执行_config.yml的更改

如何添加新的文章

添加文章只需要简单的添加markdown文件,不需要参与到很多的html的开发,甚至不需要本地环境配置

有时加入新文章会发生gitpages新文章的部署出错,这是还是考虑本地化运行看看,或者把文件删了重来

添加文本

在_post路径下创建新的.md file 注意命名格式为:Year-Month-Day-name.md

Jekyll 自动根据文件名的前缀对文章排序,该时间也对应文章发布时间。

注意文件名应为全英文且小写,并且name这部分不能与其它某一文件相同,该框架使用这部分名字生成对应的html

添加图片

_asset/image/下存放所有图片,文件名应为全小写,推荐一篇文章单独建立一个文件夹存放图片,方便管理 图片大小比例推荐为3:2

网站的大致结构和配置

本网站使用了GitHub pages 默支持的Jekyll编译工具开发静态网站

那Jekyll是如何进行编译的呢?相关的文件起什么作用呢?

关于 _config.yml 文件

该文件描述了网站的相关配置,一些基本设置需要在其中更改,如用到的插件,作者和联系方式等等。

关于 index.html 文件

网站的home界面由本文件设置

关于 _includes 文件夹

该路径下存放了网站要用的各种小插件

关于 _layouts 文件夹

该路径下存放了网站相关页面的布局

关于 _pages 文件夹

该路径下存放了网站页面的模板

关于 _site 文件夹

存放Jekyll编译过后的网站的html

其它路径暂不做过多介绍

参考视频

openhw's People

Contributors

zenfendson avatar wowthemesnet avatar clerissonmn 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.