Skip to content
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

add a starter template #526

Merged
merged 41 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
c833eab
add a starter template
erral Oct 30, 2022
ff9a37d
Merge branch 'main' into erral-starter-subtemplate
erral Nov 1, 2022
a5bd5f0
rename the template
erral Nov 27, 2022
ba69c7d
Merge branch 'main' into erral-starter-subtemplate
erral Nov 27, 2022
820d0be
Merge branch 'erral-starter-subtemplate' of github.com:plone/bobtempl…
erral Nov 27, 2022
00421ba
Merge branch 'main' into erral-starter-subtemplate
MrTango Jan 20, 2023
21f40c6
Merge branch 'main' into erral-starter-subtemplate
MrTango Jan 25, 2023
3d3a764
rename profile
erral Jan 26, 2023
69ad41c
rename all template to be site_initialization
erral Jan 26, 2023
25d45a9
fix missing comma in testing.py of addon template
MrTango Jan 26, 2023
0b61d48
fix missing tox.ini in addon template
MrTango Jan 26, 2023
f2fe13d
prepare bugfix release
MrTango Jan 26, 2023
009958b
include tox.ini in MANIFEST
MrTango Jan 26, 2023
2c13048
Preparing release 6.2.1
MrTango Jan 26, 2023
d521f44
Back to development: 6.2.2
MrTango Jan 26, 2023
5e5efc1
Merge branch 'main' into erral-starter-subtemplate
erral Jan 26, 2023
95f4bcf
Merge branch 'main' into erral-starter-subtemplate
MrTango Feb 6, 2023
cbee996
fix linting
MrTango Feb 6, 2023
b63d7ca
Merge branch 'main' into erral-starter-subtemplate
erral Apr 14, 2023
6e8f1d4
convert to one-line
erral Apr 14, 2023
1d3ac09
convert to one line
erral Apr 14, 2023
c8ed16c
Merge branch 'main' into erral-starter-subtemplate
MrTango Jun 19, 2023
9990310
Merge branch 'main' into erral-starter-subtemplate
erral Oct 3, 2023
cf38694
make questions mandatory
erral Oct 3, 2023
53c78c6
update tox and CI setup for Py3.11
MrTango Oct 3, 2023
6451155
try to fix tox.ini
MrTango Oct 3, 2023
7906b89
update tox setup
MrTango Oct 3, 2023
829d9dd
test
erral Oct 7, 2023
ef882a2
test
erral Oct 7, 2023
9368cbd
test
erral Oct 7, 2023
63fd819
test
erral Oct 7, 2023
ea46774
test
erral Oct 7, 2023
392e1b6
tes
erral Oct 7, 2023
ca2dd38
fix
erral Oct 7, 2023
104a398
fix tox in CI
MrTango Oct 30, 2023
5c705de
Merge branch 'main' into erral-starter-subtemplate
MrTango Oct 30, 2023
e9e4aa3
Merge branch 'main' into erral-starter-subtemplate
MrTango Feb 22, 2024
571f0dd
recover tox arguments
erral Mar 22, 2024
2509e3f
remove python 3.11 additions
erral Mar 22, 2024
0cd7f11
remove python 3.11 additions
erral Mar 22, 2024
dfda5ee
remove docs
erral Mar 22, 2024
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
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ New features:
6.2 (2022-10-28)
----------------

- Add a starter subtemplate to initialize a Plone site with some sane default values
[erral]

- Improve namespace support #419
[mamico]

Expand Down
8 changes: 8 additions & 0 deletions bobtemplates/plone/bobregistry.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,11 @@ def plone_form():
reg.plonecli_alias = "form"
reg.depend_on = "plone_addon"
return reg


def plone_site_initialization():
reg = RegEntry()
reg.template = "bobtemplates.plone:site_initialization"
reg.plonecli_alias = "site_initialization"
reg.depend_on = "plone_addon"
return reg
16 changes: 16 additions & 0 deletions bobtemplates/plone/site_initialization.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from bobtemplates.plone.base import base_prepare_renderer
from bobtemplates.plone.base import git_commit
from bobtemplates.plone.base import git_support


def prepare_renderer(configurator):
"""Prepare rendering."""
configurator = base_prepare_renderer(configurator)

configurator.target_directory = configurator.variables["package_folder"]


def post_renderer(configurator):
"""Post rendering."""
if git_support(configurator):
git_commit(configurator, "Add Plone site initialization configuration")
24 changes: 24 additions & 0 deletions bobtemplates/plone/site_initialization/.mrbob.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[questions]
; subtemplate_warning.question = Please commit your changes, before using a sub-template! Continue anyway? [N/y]
MrTango marked this conversation as resolved.
Show resolved Hide resolved
; subtemplate_warning.required = True
; subtemplate_warning.default = n
; subtemplate_warning.pre_ask_question = bobtemplates.plone.base:git_clean_state_check
; subtemplate_warning.post_ask_question = mrbob.hooks:validate_choices bobtemplates.plone.base:subtemplate_warning_post_question
; subtemplate_warning.choices = y|n
; subtemplate_warning.choices_delimiter = |

language.question = Enter the 2 letter language code for your site
language.help = Shold be something like 'en'
language.required = True
language.default = 'en'

site_name.question = Enter the name of your site
site_name.help = Should be something like 'My new site'
site_name.required = True
site_name.default = New Plone Site


[template]
post_ask = bobtemplates.plone.base:set_global_vars
pre_render = bobtemplates.plone.site_initialization:prepare_renderer
post_render = bobtemplates.plone.site_initialization:post_renderer
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<registry>
<records interface="plone.base.interfaces.controlpanel.IMailSchema" prefix="plone" purge="false">
<value key="email_from_name">{{{ site_name }}}</value>
</records>
</registry>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<registry>
<records interface="plone.base.interfaces.controlpanel.ISiteSchema" prefix="plone" purge="false">
<value key="site_title">{{{ site_name }}}</value>
</records>
</registry>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version='1.0' encoding='UTF-8'?>
<registry>
<records interface="plone.i18n.interfaces.ILanguageSchema" prefix="plone" purge="false">
<value key="available_languages">
<element>{{{ language }}}</element>
</value>
<value key="default_language">{{{ language }}}</value>
</records>
</registry>
Empty file.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"plone_vocabulary = bobtemplates.plone.bobregistry:plone_vocabulary",
"plone_controlpanel = bobtemplates.plone.bobregistry:plone_controlpanel",
"plone_form = bobtemplates.plone.bobregistry:plone_form",
"plone_site_initialization = bobtemplates.plone.bobregistry:plone_site_initialization",
]
},
)
Loading