Skip to content

Commit

Permalink
重新添加spring框架来使用github issue blog
Browse files Browse the repository at this point in the history
  • Loading branch information
ufologist committed Mar 18, 2016
1 parent 650bb19 commit c24b3e7
Show file tree
Hide file tree
Showing 47 changed files with 16,280 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
*.iml
.idea/
.ipr
.iws
*~
~*
*.diff
*.patch
*.bak
.DS_Store
Thumbs.db
.svn/
*.swp
.project
.settings/
node_modules/
_site/
15 changes: 15 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"asi" : true,
"boss" : true,
"browser" : true,
"curly" : false,
"debug" : true,
"devel" : true,
"eqeqeq" : false,
"eqnull" : true,
"expr" : true,
"laxbreak" : true,
"laxcomma" : true,
"validthis": true,
"multistr" : true
}
Empty file added .nojekyll
Empty file.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: node_js
node_js:
- 0.10
before_script:
- npm install -g grunt-cli
93 changes: 93 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
module.exports = function(grunt) {
'use strict';

// Project configuration.
grunt.initConfig({

// Task configuration.
jshint: {
options: {
jshintrc: '.jshintrc'
},
gruntfile: {
src: 'Gruntfile.js'
},
build: {
src: 'js/*.js'
}
},

concat: {
js: {
options: {
separator: ';'
},
src: [
'js/lib/zepto.js',
'js/lib/detect.js',
'js/lib/touch.js',
'js/lib/spa.js',
'js/lib/template.js',
'js/lib/marked.js',
'js/lib/highlight.js',
'js/boot.js',
'js/pull2refresh.js',
'js/issuelist.js',
'js/side.js',
'js/menu.js',
'js/home.js',
'js/labels.js',
'js/issues.js'
],
dest: 'dist/main.js'
}
},

uglify: {
js: {
files: {
'dist/main.min.js': 'dist/main.js'
}
}
},

less: {
production: {
options: {
cleancss: true
},
files: {
'dist/main.min.css': 'css/boot.less'
}
}
},

clean: {
temporary: ['dist/main.js', 'dest/main.min.css']
}

})

// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-concat')
grunt.loadNpmTasks('grunt-contrib-jshint')
grunt.loadNpmTasks('grunt-contrib-uglify')
grunt.loadNpmTasks('grunt-contrib-less')
grunt.loadNpmTasks('grunt-contrib-clean')


// Default task.
grunt.registerTask(
'default',
[
'jshint',
'concat',
'uglify',
'less',
'clean'
])

// // Test task.
grunt.registerTask('test', ['jshint'])

}
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2014 zhaoda(赵达)

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.
159 changes: 159 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
# Spring [![Build Status](https://img.shields.io/travis/zhaoda/spring.svg)](https://travis-ci.org/zhaoda/spring)

Spring is a blog engine written by GitHub Issues, or is a simple, static web site generator. No more server and database, you can setup it in free hosting with GitHub Pages as a repository, then post the blogs in the repository Issues.

You can add some labels in your repository Issues as the blog category, and create Issues for writing blog content through Markdown.

Spring has responsive templates, looking good on mobile, tablet, and desktop.Gracefully degrading in older browsers. Compatible with Internet Explorer 10+ and all modern browsers.

Get up and running in seconds.

[中文介绍](http://zhaoda.net/2014/03/21/%E4%BD%BF%E7%94%A8Spring%E5%BF%AB%E9%80%9F%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2.html)

## Quick start guide

For the impatient, here's how to get a Spring blog site up and running.

### First of all

* Fork the [Spring](https://github.com/zhaoda/spring "Spring") repository as yours.
* Goto your repository settings page to rename `Repository Name`.
* Hosted directly on [GitHub Pages](http://pages.github.com "GitHub Pages") from your project repository, you can take it as *User or organization site* or *Project site(create a gh-pages branch)*.
* Also, you can [set up a custom domain with Pages](https://help.github.com/articles/setting-up-a-custom-domain-with-pages).

### Secondly

* Open the `index.html` file to edit the config variables with yours below.

```javascript
$.extend(spring.config, {
// my blog title
title: 'Spring',
// my blog description
desc: "A blog engine written by github issues [Fork me on GitHub](https://github.com/zhaoda/spring)",
// my github username
owner: 'zhaoda',
// creator's username
creator: 'zhaoda',
// the repository name on github for writting issues
repo: 'spring',
// custom page
pages: [
]
})
```
* Put your domain into the `CNAME ` file if you have.
* Commit your change and push it.

### And then

* Goto your repository settings page to turn on the `Issues` feature.
* Browser this repository's issues page, like this `https://github.com/your-username/your-repo-name/issues?state=open`.
* Click the `New Issue` button to just write some content as a new one blog.
### Finally
* Browser this repository's GitHub Pages url, like this `http://your-username.github.io/your-repo-name`, you will see your Spring blog, have a test.
* And you're done!
## Custom development
### Installation
* You will need a web server installed on your system, for example, Nginx, Apache etc.
* Configure your spring project to your local web server directory.
* Run and browser it, like `http://localhost/spring/dev.html` .
* `dev.html` is used to develop, `index.html` is used to runtime.
### Folder Structure
```bash
spring/
├── css/
| ├── boot.less #import other less files
| ├── github.less #github highlight style
| ├── home.less #home page style
| ├── issuelist.less #issue list widget style
| ├── issues.less #issues page style
| ├── labels.less #labels page style
| ├── main.less #commo style
| ├── markdown.less #markdown format style
| ├── menu.less #menu panel style
| ├── normalize.less #normalize style
| ├── pull2refresh.less #pull2refresh widget style
| └── side.html #side panel style
├── dist/
| ├── main.min.css #css for runtime
| └── main.min.js #js for runtime
├── img/ #some icon, startup images
├── js/
| ├── lib/ #some js librarys need to use
| ├── boot.js #boot
| ├── home.js #home page
| ├── issuelist.js #issue list widget
| ├── issues.js #issues page
| ├── labels.js #labels page
| ├── menu.js #menu panel
| ├── pull2refresh.less #pull2refresh widget
| └── side.html #side panel
├── css/
| ├── boot.less #import other less files
| ├── github.less #github highlight style
| ├── home.less #home page style
| ├── issuelist.less #issue list widget style
| ├── issues.less #issues page style
| ├── labels.less #labels page style
| ├── main.less #commo style
| ├── markdown.less #markdown format style
| ├── menu.less #menu panel style
| ├── normalize.less #normalize style
| ├── pull2refresh.less #pull2refresh widget style
| └── side.html #side panel style
├── dev.html #used to develop
├── favicon.ico #website icon
├── Gruntfile.js #Grunt task config
├── index.html #used to runtime
└── package.json #nodejs install config
```
### Customization
* Browser `http://localhost/spring/dev.html`, enter the development mode.
* Changes you want to modify the source code, like `css`, `js` etc.
* Refresh `dev.html` view change.
### Building
* You will need [Node.js](http://nodejs.org/ "Node.js") installed on your system.
* Installation package.
```bash
$ npm install
```
* Run grunt task.
```bash
$ grunt
```
* Browser `http://localhost/spring/index.html`, enter the runtime mode.
* If there is no problem, commit and push the code.
* Don't forget to merge `master` branch into `gh-pages` branch if you have.
* And you're done! Good luck!
## Report a bug
* Check if the bug is already fixed in the [master branch](https://github.com/zhaoda/spring/commits/master) since the last release.
* Check [existing issues](https://github.com/zhaoda/spring/issues).
* [Open a new one](https://github.com/zhaoda/spring/issues/new), including exact browser & platform information.
## Who used
* http://zhaoda.net/spring
* http://zhaoda.net/blog
If you are using, please [tell me](https://github.com/zhaoda/spring/issues/6).
## License
Spring is available under the terms of the [MIT License](https://raw.githubusercontent.com/zhaoda/spring/master/LICENSE "MIT License")
11 changes: 11 additions & 0 deletions css/boot.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@import "normalize";
@import "github";
@import "main";
@import "markdown";
@import "pull2refresh";
@import "issuelist";
@import "side";
@import "menu";
@import "home";
@import "labels";
@import "issues";
Loading

0 comments on commit c24b3e7

Please sign in to comment.