Permalink
Browse files

core: move skeleton modules and menu to site config.

  • Loading branch information...
kaos committed Nov 16, 2012
1 parent 24898c9 commit b8898062050fd305771b0fb09f4b528cc46c9dda
@@ -86,7 +86,15 @@ The following options can be configured:
``{skeleton, blog}``
Set by the ``zotonic addsite`` command, this settings tells Zotonic
which skeleton site to use.
-
+
+``{install_menu, [<menu-item>...]}``
+ Creates the initial main menu when installing mod_menu. A `menu-item`
+ is a erlang tuple with a resource id and a list of child menu-items,
+ if any: ``{rsc_name, []}``.
+
+``{install_modules, [<modules>...]}``
+ List all modules that should be enabled when installing the site data.
+
Database connection options
...........................
View
@@ -1,39 +1,76 @@
-% Zotonic site configuration for %%SITE%%.
+%% Zotonic site configuration for %%SITE%%.
[
- % This site is enabled or not.
- {enabled, true},
-
- % Hostname on which this site runs
- {hostname, "%%SITE%%:8000"},
-
- % Aliases which should redirect to the primary hostname
- %{hostalias, "www.example.com"},
- %{hostalias, "example.com"},
-
- % PostgreSQL database connection
- {dbhost, "%%DBHOST%%"},
- {dbport, %%DBPORT%%},
- {dbuser, "%%DBUSER%%"},
- {dbpassword, "%%DBPASSWORD%%"},
- {dbdatabase, "%%DBDATABASE%%"},
- {dbschema, "%%DBSCHEMA%%"},
-
- % Depcache settings, maximum size in mbs
- {depcache_memory_max, 100},
-
- % Password for the 'admin' user.
- {admin_password, "%%ADMINPASSWORD%%"},
-
- % What skeleton site this site is based on; for installing the initial data.
- {skeleton, %%SKEL%%},
-
- %% Specific options
-
- %% Title of your site
- {title, <<"Your first blog">>},
- %% Subtitle
- {subtitle, <<"built with Zotonic, the Erlang CMS.">>},
-
- %% Page length
- {pagelen, 5}
+ %% This site is enabled or not.
+ {enabled, true},
+
+ %% Hostname on which this site runs
+ {hostname, "%%SITE%%:8000"},
+
+ %% Aliases which should redirect to the primary hostname
+ %%{hostalias, "www.example.com"},
+ %%{hostalias, "example.com"},
+
+ %% PostgreSQL database connection
+ {dbhost, "%%DBHOST%%"},
+ {
+ dbport, %%DBPORT%%
+ },
+ {dbuser, "%%DBUSER%%"},
+ {dbpassword, "%%DBPASSWORD%%"},
+ {dbdatabase, "%%DBDATABASE%%"},
+ {dbschema, "%%DBSCHEMA%%"},
+
+ %% Depcache settings, maximum size in mbs
+ {depcache_memory_max, 100},
+
+ %% Password for the 'admin' user.
+ {admin_password, "%%ADMINPASSWORD%%"},
+
+ %% What skeleton site this site is based on; for installing the initial data.
+ {
+ skeleton, %%SKEL%%
+ },
+ {install_menu, [{page_home, []}, {page_about, []}, {page_contact, []}]},
+ {install_modules,
+ [
+ mod_base,
+ mod_base_site,
+ mod_menu,
+ mod_oauth,
+ mod_search,
+ mod_oembed,
+ mod_atom_feed,
+ mod_translation,
+ mod_signal,
+ mod_logging,
+
+ mod_seo,
+ mod_seo_google,
+ mod_seo_sitemap,
+
+ mod_authentication,
+ mod_acl_adminonly,
+
+ mod_admin,
+ mod_admin_category,
+ mod_admin_config,
+ mod_admin_identity,
+ mod_admin_modules,
+ mod_admin_predicate,
+
+ mod_l10n,
+ mod_geomap,
+
+ mod_comment,
+ mod_bootstrap,
+ ]},
+ %% Specific options
+
+ %% Title of your site
+ {title, <<"Your first blog">>},
+ %% Subtitle
+ {subtitle, <<"built with Zotonic, the Erlang CMS.">>},
+
+ %% Page length
+ {pagelen, 5}
].
View
@@ -1,29 +1,54 @@
-% Zotonic site configuration for %%SITE%%.
+%% Zotonic site configuration for %%SITE%%.
[
- % This site is enabled or not.
- {enabled, true},
+ %% This site is enabled or not.
+ {enabled, true},
- % Hostname on which this site runs
- {hostname, "%%SITE%%:8000"},
+ %% Hostname on which this site runs
+ {hostname, "%%SITE%%:8000"},
- % Aliases which should redirect to the primary hostname
- %{hostalias, "www.example.com"},
- %{hostalias, "example.com"},
+ %% Aliases which should redirect to the primary hostname
+ %%{hostalias, "www.example.com"},
+ %%{hostalias, "example.com"},
- % PostgreSQL database connection
- {dbhost, "%%DBHOST%%"},
- {dbport, %%DBPORT%%},
- {dbuser, "%%DBUSER%%"},
- {dbpassword, "%%DBPASSWORD%%"},
- {dbdatabase, "%%DBDATABASE%%"},
- {dbschema, "%%DBSCHEMA%%"},
+ %% PostgreSQL database connection
+ {dbhost, "%%DBHOST%%"},
+ {
+ dbport, %%DBPORT%%
+ },
+ {dbuser, "%%DBUSER%%"},
+ {dbpassword, "%%DBPASSWORD%%"},
+ {dbdatabase, "%%DBDATABASE%%"},
+ {dbschema, "%%DBSCHEMA%%"},
- % Depcache settings. The maximum size in Mbs
- {depcache_memory_max, 100},
+ %% Depcache settings. The maximum size in Mbs
+ {depcache_memory_max, 100},
- % Password for the 'admin' user.
- {admin_password, "%%ADMINPASSWORD%%"},
+ %% Password for the 'admin' user.
+ {admin_password, "%%ADMINPASSWORD%%"},
- % What skeleton site this site is based on; for installing the initial data.
- {skeleton, %%SKEL%%}
+ %% What skeleton site this site is based on; for installing the initial data.
+ {
+ skeleton, %%SKEL%%
+ },
+ %%{install_menu, []},
+ {install_modules,
+ [
+ mod_base,
+ mod_menu,
+ mod_oauth,
+ mod_search,
+ mod_oembed,
+ mod_signal,
+ mod_logging,
+
+ mod_authentication,
+ mod_acl_adminonly,
+
+ mod_admin,
+ mod_admin_category,
+ mod_admin_config,
+ mod_admin_identity,
+ mod_admin_modules,
+ mod_admin_predicate
+ ]}
].
View
@@ -1,37 +1,39 @@
-% Zotonic site configuration for %%SITE%%.
+%% Zotonic site configuration for %%SITE%%.
[
- % This site is enabled or not.
- {enabled, true},
-
- % Hostname on which this site runs
- {hostname, "%%SITE%%:8000"},
-
- % Aliases which should redirect to the primary hostname
- %{hostalias, "www.example.com"},
- %{hostalias, "example.com"},
-
- %% This site doesn't use a database connection
- {dbdatabase, none},
-
- %% Installed modules, defined here as there is no database connection
- {modules, [
- %%SITE%%,
- mod_base,
- mod_admin,
- mod_bootstrap,
- mod_zotonic_status_vcs,
- mod_zotonic_tracer
- ]},
-
- %% Default config keys
- {site, [{language, "en"}]},
-
- % Depcache settings. The maximum size in Mbs
- {depcache_memory_max, 100},
-
- % Password for the 'admin' user.
- {admin_password, "%%ADMINPASSWORD%%"},
-
- % What skeleton site this site is based on; for installing the initial data.
- {skeleton, %%SKEL%%}
+ %% This site is enabled or not.
+ {enabled, true},
+
+ %% Hostname on which this site runs
+ {hostname, "%%SITE%%:8000"},
+
+ %% Aliases which should redirect to the primary hostname
+ %%{hostalias, "www.example.com"},
+ %%{hostalias, "example.com"},
+
+ %% This site doesn't use a database connection
+ {dbdatabase, none},
+
+ %% Installed modules, defined here as there is no database connection
+ {modules, [
+ %%SITE%%,
+ mod_base,
+ mod_admin,
+ mod_bootstrap,
+ mod_zotonic_status_vcs,
+ mod_zotonic_tracer
+ ]},
+
+ %% Default config keys
+ {site, [{language, "en"}]},
+
+ %% Depcache settings. The maximum size in Mbs
+ {depcache_memory_max, 100},
+
+ %% Password for the 'admin' user.
+ {admin_password, "%%ADMINPASSWORD%%"},
+
+ %% What skeleton site this site is based on; for installing the initial data.
+ {
+ skeleton, %%SKEL%%
+ }
].
@@ -58,11 +58,9 @@ pre_install(_, _) ->
%% @spec install(Host) -> ok
install(Host) ->
{ok, C} = pgsql_pool:get_connection(Host),
- Skeleton = proplists:get_value(skeleton, z_sites_manager:get_site_config(Host)),
-
ok = pgsql:with_transaction(C, fun (C2) ->
install_sql_list(C, model_pgsql()),
- z_install_data:install(Skeleton, Host, C2),
+ z_install_data:install(Host, C2),
ok
end
),
Oops, something went wrong.

0 comments on commit b889806

Please sign in to comment.