Functions
create_site
Core logic for creating a new site.
🏗️ Create a new Bengal site with optional structure initializ…
create_site
def create_site(name: str | None, theme: str, template: str, no_init: bool, init_preset: str | None) -> None
Core logic for creating a new site.
🏗️ Create a new Bengal site with optional structure initialization.
Creates a new site directory with configuration, content structure, and optional sample content. Use --template to choose a preset layout.
Parameters 5
| Name | Type | Default | Description |
|---|---|---|---|
name |
str | None |
— | Site name (or None to prompt) |
theme |
str |
— | Theme to use |
template |
str |
— | Site template name |
no_init |
bool |
— | Skip structure initialization wizard |
init_preset |
str | None |
— | Preset name if provided via flag |
_prompt_for_baseurl
Prompt user for base URL or return default.
_prompt_for_baseurl
def _prompt_for_baseurl(no_init: bool, cli: CLIOutput) -> str
Prompt user for base URL or return default.
Parameters 2
| Name | Type | Default | Description |
|---|---|---|---|
no_init |
bool |
— | |
cli |
CLIOutput |
— |
Returns
str
_determine_template
Determine the effective template based on wizard selection.
_determine_template
def _determine_template(template: str, no_init: bool, init_preset: str | None) -> tuple[str, bool, str | None]
Determine the effective template based on wizard selection.
Parameters 3
| Name | Type | Default | Description |
|---|---|---|---|
template |
str |
— | |
no_init |
bool |
— | |
init_preset |
str | None |
— |
Returns
Tuple of (effective_template, is_custom, wizard_selection)tuple[str, bool, str | None]
—
_create_directory_structure
Create the site directory structure.
_create_directory_structure
def _create_directory_structure(site_path: Path, site_template: SiteTemplate) -> None
Create the site directory structure.
Parameters 2
| Name | Type | Default | Description |
|---|---|---|---|
site_path |
Path |
— | |
site_template |
SiteTemplate |
— |
_create_template_files
Create files from template. Returns count of files created.
_create_template_files
def _create_template_files(site_path: Path, site_template: SiteTemplate) -> int
Create files from template. Returns count of files created.
Parameters 2
| Name | Type | Default | Description |
|---|---|---|---|
site_path |
Path |
— | |
site_template |
SiteTemplate |
— |
Returns
int
_show_post_creation_hints
Show hints and next steps after site creation.
_show_post_creation_hints
def _show_post_creation_hints(cli: CLIOutput, wizard_selection: str | None, init_preset: str | None, is_custom: bool, site_dir_name: str, baseurl: str) -> None
Show hints and next steps after site creation.
Parameters 6
| Name | Type | Default | Description |
|---|---|---|---|
cli |
CLIOutput |
— | |
wizard_selection |
str | None |
— | |
init_preset |
str | None |
— | |
is_custom |
bool |
— | |
site_dir_name |
str |
— | |
baseurl |
str |
— |
site_command
Create a new Bengal site (bengal new site).
site_command
def site_command(name: str, theme: str, template: str, no_init: bool, init_preset: str) -> None
Create a new Bengal site (bengal new site).
Parameters 5
| Name | Type | Default | Description |
|---|---|---|---|
name |
str |
— | |
theme |
str |
— | |
template |
str |
— | |
no_init |
bool |
— | |
init_preset |
str |
— |