Skip to content

Gh pages blog #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.sublime-*
node_modules
59 changes: 59 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*global module:false*/
module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
shell: {
hexogen: {
command: 'hexo generate',
options: {
execOptions: {
cwd: '_blog_src'
}
}
}
},

stylus: {
compile: {
options: {
compress: true
},
files: {
'blog/css/style.css': '_blog_src/themes/casper_custom/source/css/style.styl'
}
}
},

connect: {
server: {
options: {
port: 4000,
base: '.',
livereload: true
}
}
},

watch: {
hexo: {
files: ['_blog_src/_config.yml', '_blog_src/themes/**', '_blog_src/scaffolds/**', '_blog_src/scripts/**', '_blog_src/source/**'],
tasks: ['shell:hexogen']
},
livereload: {
options: { livereload: true },
files: ['blog/**'],
}
}
});

// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-stylus');
grunt.loadNpmTasks('grunt-shell');

// Default task.
grunt.registerTask('dev', ['shell:hexogen', 'connect', 'watch']);
grunt.registerTask('default', ['shell:hexogen']);
};
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ ui-grid.info
============

Website for ui-grid

[Using the blog system](_blog_src/Blogging.md)
7 changes: 7 additions & 0 deletions _blog_src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.DS_Store
Thumbs.db
db.json
debug.log
node_modules/
public/
.deploy/
27 changes: 27 additions & 0 deletions _blog_src/Blogging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

# UI-Grid.info Blog

The "blog" uses [hexo](http://hexo.io) to generate a pretty simple static site.

## Installing

To use it you need to install hexo:

npm install -g [email protected]

Then install dependencies in both the parent and _blog_src directories. This needs to be done bcause hexo's cwd needs to be the blog source directory.

npm install
cd _blog_src
npm install

Then go back up and run the dev task:

cd ..
grund dev

You'll get a server running on [http://localhost:4000](http://localhost:4000) with auto-watch on the blog directory to rebuild when you change files.

## Creating Posts

New posts can be created in `_blog_src/source/_posts` or by running `hexo new` in _blog_src. You can find further documentation on hexo's site: http://hexo.io
54 changes: 54 additions & 0 deletions _blog_src/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*global module:false*/
module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
shell: {
hexogen: {
command: 'hexo generate'
}
},

stylus: {
compile: {
options: {
compress: true
},
files: {
'public/css/style.css': 'themes/landscape/source/css/style.styl'
}
}
},

connect: {
server: {
options: {
port: 4000,
base: 'public',
livereload: true
}
}
},

watch: {
hexo: {
files: ['_config.yml', 'themes/**', 'scaffolds/**', 'scripts/**', 'source/**'],
tasks: ['shell:hexogen']
},
livereload: {
options: { livereload: true },
files: ['public/**'],
}
}
});

// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-stylus');
grunt.loadNpmTasks('grunt-shell');

// Default task.
grunt.registerTask('dev', ['shell:hexogen', 'connect', 'watch']);

};
109 changes: 109 additions & 0 deletions _blog_src/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Hexo Configuration
## Docs: http://hexo.io/docs/configuration.html
## Source: https://github.com/tommy351/hexo/

# Site
# UI-Grid Blog
title: UI Grid
subtitle: An AngularJS data grid
description: "Tips, tricks and news for UI Grid"
author: UI Grid Team
email: [email protected]
language:

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://ui-grid.info/blog
root: /blog/
permalink: :title/
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code

# Directory
source_dir: source
public_dir: ../blog

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
auto_spacing: false # Add spaces between asian characters and western characters
titlecase: false # Transform title into titlecase
external_link: true # Open external links in new tab
max_open_file: 100
multi_thread: true
filename_case: 0
render_drafts: false
post_asset_folder: false
highlight:
enable: true
line_number: true
tab_replace:

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Archives
## 2: Enable pagination
## 1: Disable pagination
## 0: Fully Disable
archive: 2
category: 1
tag: 1

# Server
## Hexo uses Connect as a server
## You can customize the logger format as defined in
## http://www.senchalabs.org/connect/logger.html
port: 4000
server_ip: 0.0.0.0
logger: false
logger_format:

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: MMM D YYYY
time_format: H:mm:ss

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Disqus
disqus_shortname:

# Extensions
## Plugins: https://github.com/tommy351/hexo/wiki/Plugins
## Themes: https://github.com/tommy351/hexo/wiki/Themes
theme: casper_custom
exclude_generator:

# Deployment
## Docs: http://hexo.io/docs/deployment.html
deploy:
type:

sitemap:
path: ../sitemap.xml

# casper theme config
cover:
logo:
bio:

# Content
excerpt_link: Read More

# Miscellaneous
rss:

feed:
type: atom
path: atom.xml
limit: 20
12 changes: 12 additions & 0 deletions _blog_src/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "ui-grid.info.blog",
"version": "2.8.3",
"private": true,
"dependencies": {
"hexo-renderer-ejs": "*",
"hexo-renderer-stylus": "0.1.x",
"hexo-renderer-marked": "0.1.x",
"hexo-generator-cherrypick": "https://github.com/c0bra/hexo-generator-cherrypick/tarball/0.0.1",
"hexo-generator-feed": "^0.2.1"
}
}
3 changes: 3 additions & 0 deletions _blog_src/scaffolds/draft.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title: {{ title }}
tags:
---
3 changes: 3 additions & 0 deletions _blog_src/scaffolds/page.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title: {{ title }}
date: {{ date }}
---
5 changes: 5 additions & 0 deletions _blog_src/scaffolds/photo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
layout: {{ layout }}
title: {{ title }}
date: {{ date }}
tags:
---
4 changes: 4 additions & 0 deletions _blog_src/scaffolds/post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
title: {{ title }}
date: {{ date }}
tags:
---
Loading