Browse Source

Added wiki config

master
Holger Frey 7 years ago
parent
commit
423ead1aa1
  1. 3
      hooks/pre_gen_project.py
  2. 37
      {{cookiecutter.directory_name}}/{{cookiecutter.directory_name}}.py

3
hooks/pre_gen_project.py

@ -18,8 +18,7 @@ try:
except ModuleNotFoundError: except ModuleNotFoundError:
pass pass
wiki_path = Path(MOIN_PATH) / module_name wiki_path = Path(MOIN_PATH) / module_name
if wiki_path.exists(): if wiki_path.exists():
print('ERROR: wiki %s already exists!' % module_name) print('ERROR: wiki %s already exists!' % module_name)
sys.exit(1) sys.exit(3)

37
{{cookiecutter.directory_name}}/{{cookiecutter.directory_name}}.py

@ -0,0 +1,37 @@
# -*- coding: iso-8859-1 -*-
# IMPORTANT! This encoding (charset) setting MUST be correct! If you live in a
# western country and you don't know that you use utf-8, you probably want to
# use iso-8859-1 (or some other iso charset). If you use utf-8 (a Unicode
# encoding) you MUST use: coding: utf-8
# That setting must match the encoding your editor uses when you modify the
# settings below. If it does not, special non-ASCII chars will be wrong.
"""
This is a sample config for a wiki that is part of a wiki farm and uses
farmconfig for common stuff. Here we define what has to be different from
the farm's common settings.
"""
# we import the FarmConfig class for common defaults of our wikis:
from farmconfig import FarmConfig
# now we subclass that config (inherit from it) and change what's different:
class Config(FarmConfig):
# basic options (you normally need to change these)
sitename = u'{{cookiecutter.directory_name}}' # [Unicode]
interwikiname = '{{cookiecutter.directory_name}}'
# name of entry page / front page [Unicode], choose one of those:
page_front_page = u"FrontPage"
data_dir = '/var/www/moin/wikis/{{cookiecutter.directory_name}}/data/'
acl_rights_before = u"HolgerFrey:read,write,delete,revert,admin OswaldPrucker:read,write,delete,revert,admin"
acl_rights_default = u"{{cookiecutter.wiki_name}}Group:read,write,delete,revert All:"
logo_string = u'<img src="/static/logo-{{cookiecutter.directory_name}}.png" alt="Logo">'
# style the "today" calendar cell
html_head = u'<style>table td.cal-today{border:3pt solid #0af;}</style>'
Loading…
Cancel
Save