Cleaned git repo + updated README for a more useful doc

Set a beerware type license
This commit is contained in:
Phyks 2013-07-22 23:06:14 +02:00
parent 079d3a8cdf
commit 71f618a27a
11 changed files with 53 additions and 199 deletions

11
LICENSE
View File

@ -0,0 +1,11 @@
/*
* --------------------------------------------------------------------------------
* "THE NO-ALCOHOL BEER-WARE LICENSE" (Revision 42):
* Phyks (webmaster@phyks.me) wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff (and you can also do whatever you want
* with this stuff without retaining it, but that's not cool...). If we meet some
* day, and you think this stuff is worth it, you can buy me a soda (--beer--) in
* return.
* Phyks
* ---------------------------------------------------------------------------------
*/

View File

@ -1,22 +1,49 @@
blogit
Blogit
======
A git based blogging software
A git based blogging software. Just as Jekyll and so, it takes your articles as html files and computes them to generate static page and RSS feed to serve behind a webserver. It uses git as a backend file manager (as git provide some useful features like history and hooks) and Python for scripting the conversion process. You can customize the python scripts to handle special tags (ie, not standard HTML tags) just as <code> for example.
This is a WIP and it's not usable as is. Will be available soon ! :)
This project is still a WIP.
Some infos that need to be explained better
===========================================
How it works ?
==============
raw contains raw files from which the conversion will be made
website contains the working copy of the blog to serve via Apache for example
There are three directories under the tree : raw for your raw HTML articles and header/footer, gen (created by the script) for the temporary generated files and blog for the blog folder to serve behind the webserver.
Articles must be in folders year/month/ARTICLE.html (ARTICLE is whatever you want) and some extras comments must be put in the article file for the script to handle it correctly. See the test.html example file for more info on how to do it.
example of syntax for an article :
You can put a file in "wait mode" and don't publish it yet, just by adding .ignore at the end of its filename; Every file that you put in raw and that is not a .html file is just copied at the same place in the blog dir (to put images in your articles, for example, just put them beside your articles and make a relative link in your HTML article).
You should change the params file (raw/params) before starting to correctly set your blog url, your email address and the blog title (among other parameters).
When you finish editing an article, just git add it and commit. The pre-commit.py hook will run automatically and generate your working copy.
Note about tags : Tags are automatically handled and a page for each tag is automatically generated. A page with all the articles for each month and each year is also automatically generated.
Note : Don't remove gen/ content unless you know what you're doing. These files are temporary files for the blog generation but they are useful to regenerate the RSS feed for example. If you delete them, you may need to regenerate them.
Important note : This is currently a beta version and the hook isn't set to run automatically for now. You have to manually run pre-commit.py (or move it to .git/hooks but this has never been tested ^^).
Example of syntax for an article
================================
<!--
@tags=***
@titre=***
@author=Phyks
@date=23062013-1337
@tags=*** //put here the tags for your article, comma-separated list
@titre=***i //Title for your article
@author=Phyks //Name of the author (not displayed by now)
@date=23062013-1337 //Date in the format DDMMYYYY-HHMM
->
<article content>
<article content> (== Whatever you want)
LICENSE
=======
/*
* --------------------------------------------------------------------------------
* "THE NO-ALCOHOL BEER-WARE LICENSE" (Revision 42):
* Phyks (webmaster@phyks.me) wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff (and you can also do whatever you want
* with this stuff without retaining it, but that's not cool...). If we meet some
* day, and you think this stuff is worth it, you can buy me a soda (--beer--) in
* return.
* Phyks
* ---------------------------------------------------------------------------------
*/

1
TODO
View File

@ -1,6 +1,7 @@
Search ?
What happen when a file is moved with git ?
Flake8 the whole thing ! :)
pass parameters via command line to force regeneration of files
Known bugs:
==========

View File

@ -1,46 +0,0 @@
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>@titre</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="wrapper">
<div id="left">
<h1 id="head_title">Phyks' Blog</h1>
<hr/><hr/>
<h2>Catégories</h2>
<div id="categories">
<ul><li><a href="tags/test.html">test</a></li></ul>
</div>
<hr/>
<h2>Derniers articles</h2>
<div id="last_articles">
<ul><li><a href="2013/06/test.html">Un exemple d'article</a></li></ul>
</div>
<hr/>
<h2>Liens</h2>
<ul class="links">
<li><a href="contact.html">Me contacter</a></li>
<li><a href="http://links.phyks.me">Mon shaarli</a></li>
<li><a href="http://projet.phyks.me">Mes projets</a></li>
</ul>
</div>
<div id="articles">
<article><nav class="aside_article"></nav><div class="article"><h1>Un exemple d'article</h1><!--
@author=Phyks
@date=06062013-0045
@title=Un exemple d'article
@tags=test
-->
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
<p class="date">Le 06/06/2013 à 00:45</p></div>
</div>
</div>
</body>
</html>

View File

@ -1,46 +0,0 @@
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>@titre</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="wrapper">
<div id="left">
<h1 id="head_title">Phyks' Blog</h1>
<hr/><hr/>
<h2>Catégories</h2>
<div id="categories">
<ul><li><a href="tags/test.html">test</a></li></ul>
</div>
<hr/>
<h2>Derniers articles</h2>
<div id="last_articles">
<ul><li><a href="2013/06/test.html">Un exemple d'article</a></li></ul>
</div>
<hr/>
<h2>Liens</h2>
<ul class="links">
<li><a href="contact.html">Me contacter</a></li>
<li><a href="http://links.phyks.me">Mon shaarli</a></li>
<li><a href="http://projet.phyks.me">Mes projets</a></li>
</ul>
</div>
<div id="articles">
<article><nav class="aside_article"></nav><div class="article"><h1>Un exemple d'article</h1><!--
@author=Phyks
@date=06062013-0045
@title=Un exemple d'article
@tags=test
-->
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
<p class="date">Le 06/06/2013 à 00:45</p></div>
</div>
</div>
</body>
</html>

View File

@ -1,46 +0,0 @@
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>@titre</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="wrapper">
<div id="left">
<h1 id="head_title">Phyks' Blog</h1>
<hr/><hr/>
<h2>Catégories</h2>
<div id="categories">
<ul><li><a href="tags/test.html">test</a></li></ul>
</div>
<hr/>
<h2>Derniers articles</h2>
<div id="last_articles">
<ul><li><a href="2013/06/test.html">Un exemple d'article</a></li></ul>
</div>
<hr/>
<h2>Liens</h2>
<ul class="links">
<li><a href="contact.html">Me contacter</a></li>
<li><a href="http://links.phyks.me">Mon shaarli</a></li>
<li><a href="http://projet.phyks.me">Mes projets</a></li>
</ul>
</div>
<div id="articles">
<article><nav class="aside_article"></nav><div class="article"><h1>Un exemple d'article</h1><!--
@author=Phyks
@date=06062013-0045
@title=Un exemple d'article
@tags=test
-->
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
<p class="date">Le 06/06/2013 à 00:45</p></div>
</div>
</div>
</body>
</html>

View File

@ -1,12 +0,0 @@
<article><nav class="aside_article"></nav><div class="article"><h1>Un exemple d'article</h1><!--
@author=Phyks
@date=06062013-0045
@title=Un exemple d'article
@tags=test
-->
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>
<p class="date">Le 06/06/2013 à 00:45</p></div>

View File

@ -1,4 +0,0 @@
</div>
</div>
</body>
</html>

View File

@ -1,30 +0,0 @@
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>@titre</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="wrapper">
<div id="left">
<h1 id="head_title">Phyks' Blog</h1>
<hr/><hr/>
<h2>Catégories</h2>
<div id="categories">
<ul><li><a href="tags/test.html">test</a></li></ul>
</div>
<hr/>
<h2>Derniers articles</h2>
<div id="last_articles">
<ul><li><a href="2013/06/test.html">Un exemple d'article</a></li></ul>
</div>
<hr/>
<h2>Liens</h2>
<ul class="links">
<li><a href="contact.html">Me contacter</a></li>
<li><a href="http://links.phyks.me">Mon shaarli</a></li>
<li><a href="http://projet.phyks.me">Mes projets</a></li>
</ul>
</div>
<div id="articles">

View File

@ -1 +0,0 @@
2013/06/test.html

View File

@ -31,7 +31,7 @@ def get_tags(fh):
line = line.strip() # Delete \n at the end of the line
tag_pos = line.find("@tags=")
tags = line[tag_pos+6:].split(",")
tags = [x.strip() for x in line[tag_pos+6:].split(",")]
return tags