Skip to content

benpigchu/pikablog.generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

#pikablog.generator The data generator for pikablog. It will be used on benpigchu.com/blog .

##another NODE! Yes, JS is good!

##how to use just like this:

main.js [input folder] [output folder]

##input folder Input folder should include all your blog articles in html like below

<!--@title:test article-->
<!--@tag:test box art-->
<!--@time:2000-10-10T10:10:10.100Z-->
<p>this is a test</p>
<!--@more-->
<div id="left" class="left">left</div>
<style>.right{align:right}</style>
<script>document.getElementById("left").className="right"</script>

Title should in the @title comment ,all tags should include in the @tag comment, and only the content before the @more comment should be shown in list view. @time comment can be used to override mtime of the document.

Style and Script should only work when you entered the article, and should not work in list view.

But all the behaviors depend on how do you use the data.

notice:include @comments, style and script in each others may make an unexpected prase result appear.

##output folder

###the list files and the article files article files is json files like below:

{
	"title": "test",
	"time": "2016-03-23T05:26:07.964Z",
	"content": "<p>just a test</p>\r\n",
	"tag": [
		"test",
		"testing",
		"example",
		"instance"
	],
	"style": [
		"p{color:#ff7f00}"
	],
	"script": [
		"alert(\"test\")"
	]
}

list files is json files include array of articles sorted by time like below:

{
	"name": "test2",
	"time": "2016-03-23T06:17:37.285Z",
	"tag": [
		"test",
		"tag",
		"try"
	],
	"preview": "<p>this is preview</p>\r\n",
	"title": "another test"
}

###the article folder include all article files.

###the list folder include list file of all articles(10 in every slices) and a meta.json with number of slices.

###the tag folder include a data.json with number of articles in tags like below:

{
	"test": 2,
	"try": 2,
	"tag": 1,
	"example": 1,
	"instance": 1
}

and folders named by tags inlude list file of all articles with this tag(10 in every slices) and a meta.json with number of slices.

###the time folder include a data.json with number of articles in monthes like below:

{
	"2016-3": 2,
	"2016-2": 2
}

and folders named by monthes inlude list file of all articles in this monthes(10 in every slices) and a meta.json with number of slices.

About

Simple blog data generator used on benpigchu.com/blog

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published