Skip to content

1.8.8 release #728

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

Merged
merged 6 commits into from
Mar 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions localgov_base.theme
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\DeprecationHelper;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
use Drupal\views\ViewExecutable;
Expand Down Expand Up @@ -135,12 +134,7 @@ function localgov_base_preprocess_page(&$variables): void {

/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = \Drupal::service('renderer');
$rendered = DeprecationHelper::backwardsCompatibleCall(
currentVersion: \Drupal::VERSION,
deprecatedVersion: '10.3',
currentCallable: fn() => $renderer->renderInIsolation($copy),
deprecatedCallable: fn() => $renderer->renderPlain($copy),
);
$rendered = $renderer->renderInIsolation($copy);

$variables['has_' . $region] = strlen(trim(strip_tags($rendered, '<drupal-render-placeholder><embed><hr><iframe><img><input><link><object><script><source><style><video>'))) > 0;
}
Expand Down Expand Up @@ -206,6 +200,12 @@ function localgov_base_preprocess_node(&$variables): void {
$variables['label'] = t('[Draft]') . " " . $variables['node']->label();
}
}

if ($variables['node']->getType() === 'localgov_guides_page') {
if (theme_get_setting('localgov_base_localgov_guides_stacked_heading') === TRUE) {
$variables['stacked_heading'] = TRUE;
}
}
}

/**
Expand Down
18 changes: 15 additions & 3 deletions scripts/create_subtheme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,38 @@ echo "+ themes/custom/$LGD_SUB_THEME folder created"

cd $LGD_SUB_THEME

mkdir -p config/schema
echo "+ themes/custom/$LGD_SUB_THEME/config/install folder created"

cp ../../contrib/localgov_base/logo.svg .
echo "+ themes/custom/$LGD_SUB_THEME/logo.svg copied"

cp ../../contrib/localgov_base/scripts/subtheme-items/_subtheme.info.yml_ $LGD_SUB_THEME.info.yml
echo "+ themes/custom/$LGD_SUB_THEME/$LGD_SUB_THEME.info.yml created"

cp ../../contrib/localgov_base/scripts/subtheme-items/subtheme.libraries.yml $LGD_SUB_THEME.libraries.yml
echo "+ themes/custom/$LGD_SUB_THEME/$LGD_SUB_THEME.libraries.yml created"

cp ../../contrib/localgov_base/scripts/subtheme-items/subtheme.theme $LGD_SUB_THEME.theme
echo "+ themes/custom/$LGD_SUB_THEME/$LGD_SUB_THEME.theme created"

cp ../../contrib/localgov_base/scripts/subtheme-items/config/schema/_subtheme.schema.yml_ config/schema/$LGD_SUB_THEME.schema.yml
echo "+ themes/custom/$LGD_SUB_THEME/config/schema/$LGD_SUB_THEME.schema.yml created"

cp ../../contrib/localgov_base/scripts/subtheme-items/package.json package.json
echo "+ themes/custom/$LGD_SUB_THEME/package.json created"

cp ../../contrib/localgov_base/scripts/subtheme-items/.nvmrc .nvmrc
echo "+ themes/custom/$LGD_SUB_THEME/.nvmrc created"

cp ../../contrib/localgov_base/scripts/subtheme-items/.stylelintrc.json .stylelintrc.json
echo "+ themes/custom/$LGD_SUB_THEME/.stylelintrc.json created"

cp ../../contrib/localgov_base/scripts/subtheme-items/_.eslintrc.json_ .eslintrc.json
echo "+ themes/custom/$LGD_SUB_THEME/.eslintrc.json created"

perl -i -pe "s/LGD_SUB_THEME_NAME/$LGD_SUB_THEME_NAME/g" *
perl -i -pe "s/LGD_SUB_THEME/$LGD_SUB_THEME/g" *
find . -type f -exec perl -i -pe "s/LGD_SUB_THEME_NAME/$LGD_SUB_THEME_NAME/g" {} +
find . -type f -exec perl -i -pe "s/LGD_SUB_THEME/$LGD_SUB_THEME/g" {} +
echo "+ variables replaced"

cp -r ../../contrib/localgov_base/scripts/subtheme-items/.gitignore .
Expand All @@ -95,4 +107,4 @@ echo "+ added default favicons - you will probably want to create new ones for y
echo ""
echo "# Your new localgov_base sub-theme has been created."
echo "# Check the themes/custom folder to access the theme files."
echo "# Install your sub-theme using drush or from the Drupal Appearance menu"
echo "# Install your sub-theme using drush - drush then $LGD_SUB_THEME - or from the Drupal Appearance menu"
2 changes: 2 additions & 0 deletions scripts/subtheme-items/config/schema/_subtheme.schema.yml_
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
LGD_SUB_THEME.settings:
type: localgov_base.settings
4 changes: 4 additions & 0 deletions templates/content/node--localgov-guides-page--full.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@
<article{{ attributes.addClass(classes).removeAttribute('role') }}>
<div class="lgd-container padding-horizontal">
{{ title_prefix }}
{% if stacked_heading %}
<div id="lgd-guides__title"></div>
{% else %}
<h2{{ title_attributes.addClass('lgd-guides__title').setAttribute('id', 'lgd-guides__title') }}>
{{ node.label }}
</h2>
{% endif %}
{{ title_suffix }}

{% if content %}
Expand Down