Skip to content

Commit 0055e07

Browse files
committed
Simplify dev environment installation
This patch include a setup.py file which allows the developer to use pip to install the dev environment in an easiest way. It also contains some documentation in a README file Fix some small issues: missing list_dir.tplt and not needed imports in pelicanconf.py
1 parent d171bbe commit 0055e07

File tree

5 files changed

+95
-9
lines changed

5 files changed

+95
-9
lines changed

README.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Gitoyen website
2+
3+
The gitoyen website is build on
4+
[pelican](http://docs.getpelican.com/en/3.6.3/),
5+
this repo contains the source code and content needed to generate the
6+
static website.
7+
8+
9+
## Getting started
10+
11+
Pelican is based on python in order to make the site works you will need
12+
at least python and pip installed.
13+
Once this has been done run the following commands into this repository
14+
folder:
15+
16+
### Virtualenv
17+
18+
If you want to keep things isolated on your machine you will have to
19+
install virtualenv, this step is not mandatory but is recommended.
20+
On debian just type: `apt-get install python-virtualenv`
21+
22+
Create a virtualenv in the root of the repository: `virtualenv ./venv`
23+
24+
Source the virtualenv in order to isolate your current session:
25+
`source venv/bin/activate`, you can disable it later by typing `deactivate`
26+
in the same shell session.
27+
28+
29+
### Install and run
30+
31+
- `pip install -e .` will install the dependencies needed
32+
by pelican
33+
- `gitoyen serve` will serve the website in development mode
34+
(i.e: livereload, local port)
35+
36+
37+
## Repository organisation
38+
39+
The website is build on multiple sources:
40+
41+
- `gitoyen.py` this is the command line helper file, it provides a list
42+
of usefull command for development. This script is installed when running
43+
`pip install -e .`. It is based on [Click](http://click.pocoo.org/5/)
44+
- `pelicanconf.py` is a python file for the configuration of the pelican
45+
engine. It contains for example the path of the different directories which
46+
will be used to build the website.
47+
- `filters.py` some jinja2 filters which will add features for generating
48+
the website.
49+
- `content/` contains the site content in Markdown files, it is separated
50+
in two subdirs: `pages`, `blog` the first subdir contains the pages of the
51+
site, the second contains a list of blog articles.
52+
- `templates/` some jinja templates for administration, it is used by
53+
`gitoyen.py` file.
54+
- `theme/` jinja templates and static files for generating the website.
55+
- `plugins/` pelican plugins, currently there is only one installed to
56+
generate tables of content.
57+
- `setup.py` contains instructions on how to install the gitoyen cli and
58+
the dependencies for running the dev environment.

pelicanconf.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
# -*- coding: utf-8 -*- #
33
from __future__ import unicode_literals
44

5-
import sys
6-
sys.path.append('.')
75
import filters
86

97
AUTHOR = u'gitoyen'

requirements.txt

-7
This file was deleted.

setup.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from setuptools import setup
2+
3+
setup(
4+
name='Gitoyen',
5+
version='1.0',
6+
py_modules=['gitoyen'],
7+
install_requires=[
8+
'Click',
9+
'pelican',
10+
'markdown',
11+
'ghp-import',
12+
'click',
13+
'path.py',
14+
'livereload',
15+
'beautifulsoup4',
16+
],
17+
entry_points='''
18+
[console_scripts]
19+
gitoyen=gitoyen:cli
20+
'''
21+
22+
)

templates/list_dir.tplt

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<html>
2+
<head>
3+
<title>Directory listing for {{directory}}</title>
4+
</head>
5+
<body>
6+
<h2>Directory listing for {{directory}}</h2>
7+
<hr>
8+
<ul>
9+
{% for link in links %}
10+
<li><a href="{{ link }}">{{ link }}</a></li>
11+
{% endfor %}
12+
</ul>
13+
<hr>
14+
</body>
15+
</html>

0 commit comments

Comments
 (0)