Skip to content

Commit

Permalink
Remove Site title from <title> tag
Browse files Browse the repository at this point in the history
  • Loading branch information
k-coidan committed Oct 10, 2024
1 parent 51b083e commit 413e5cc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 29 deletions.
39 changes: 11 additions & 28 deletions deploy/recipe/silverstripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,20 @@
$dbUser = ask('Please enter the database username', !empty($dbName) ? $dbName : null);
$dbPass = str_replace("'", "\\'", ask('Please enter the database password'));
$sentryDSN = ask('Please enter the Sentry DSN (if applicable)');
$domain = ask('Please enter the full domain name including protocol, please exclude trailing /');
$stage = Context::get()->getHost()->getConfig()->get('stage');
$type = $stage === 'production' ? 'live' : 'test';
$type = $stage === 'production' ? 'production' : 'staging';

$contents = <<<ENV
SS_DATABASE_CLASS='MySQLDatabase'
SS_DATABASE_USERNAME='{$dbUser}'
SS_DATABASE_PASSWORD='{$dbPass}'
SS_DATABASE_SERVER='{$dbServer}'
SS_DATABASE_NAME='{$dbName}'
SS_ENVIRONMENT_TYPE='{$type}'
DB_NAME='{$dbName}'
DB_USER='{$dbUser}'
DB_PASSWORD='{$dbPass}'
DB_HOST='{$dbServer}'
DB_PREFIX='wp_'
WP_ENV='{$stage}'
WP_HOME="{$domain}"
WP_SITEURL="{$domain}/wp"
ENV;

if ($sentryDSN) {
Expand All @@ -47,27 +51,6 @@
run('cd {{release_path}} && {{bin/composer}} vendor-expose');
});

desc('Create silverstripe-cache directory');
task('silverstripe:create_cache_dir', function () {
run("cd {{release_path}} && if [ ! -d silverstripe-cache ]; then mkdir silverstripe-cache; fi");
})->setPrivate();

desc('Run dev/build');
task('silverstripe:dev_build', function () {
// If we have permission to run commands as the http_user, do so, otherwise run as the current user
$httpUser = get('http_user') ?: 'www-data';
if (test("[ `sudo -u {$httpUser} whoami` ]")) {
run("sudo -u {$httpUser} {{release_path}}/vendor/bin/sake dev/build flush");
} else {
run("{{release_path}}/vendor/bin/sake dev/build flush");
}
});

desc('Create directory for sspak dumps');
task('silverstripe:create_dump_dir', function () {
run("cd {{deploy_path}} && if [ ! -d dumps ]; then mkdir dumps; fi");
})->setPrivate();

desc('Upload assets');
task('silverstripe:upload_assets', function () {
$stage = Context::get()->getHost()->getConfig()->get('stage') === 'production' ? 'live' : 'staging';
Expand Down
2 changes: 1 addition & 1 deletion themes/default/templates/App/Includes/Head.ss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<% base_tag %>
<title><% if $MetaTitle %>{$MetaTitle.XML}<% else %>{$Title.XML} | {$SiteConfig.Title}<% end_if %></title>
<title><% if $MetaTitle %>{$MetaTitle.XML}<% else %>{$Title.XML}<% end_if %></title>

<%-- Synchronous scripts --%>

Expand Down

0 comments on commit 413e5cc

Please sign in to comment.