civictheme/civictheme_govcms 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

civictheme/civictheme_govcms

Composer 安装命令:

composer require civictheme/civictheme_govcms

包简介

GovCMS adjustments for CivicTheme Drupal theme.

README 文档

README

Version: {{ VERSION }}

CivicTheme Setup Script for GovCMS

This script automates the installation and configuration of CivicTheme, the civictheme_govcms support module, and a new custom subtheme within your GovCMS project.

Prerequisites

  1. GovCMS Project: You must have a GovCMS project / scaffold already set up.
  2. Ahoy: ahoy must be installed and configured for your project (i.e., you can run ahoy commands).
  3. Docker: Docker must be running, as ahoy typically interacts with Docker containers.
  4. tar and curl: These command-line utilities must be available in your shell environment where you run the script.
  5. Bash: The script is written for Bash.

What the Script Does

The script will perform the following actions:

  1. Download and extract the specified CivicTheme version into themes/custom/civictheme.
  2. Run initial CivicTheme provisioning commands.
  3. Clear Drupal caches.
  4. Enable CivicTheme and set it as the default theme temporarily.
  5. Download, install, configure, and then uninstall and remove the civictheme_govcms module (as per the specified workflow).
  6. Generate a new subtheme based on CivicTheme using the provided names and description.
  7. Enable the new subtheme and set it as the site's default theme.

After the script completes successfully, your new subtheme will be active and ready for customisation in themes/custom/<your_subtheme_machine_name>.

Running the script and setting up CivicTheme for your GovCMS SaaS installation

  1. Download and Setup the Script: From your GovCMS project root directory, run:
    curl -o setup_civictheme.sh \
      https://raw.githubusercontent.com/civictheme/civictheme_govcms/refs/heads/main/scripts/setup_civictheme.sh \
      && chmod +x setup_civictheme.sh

Note: Download the script to your GovCMS project root directory on your host machine (not inside a Docker container).

How to Use

  1. Run the Script: Execute the script from your GovCMS project's root directory. You'll need to provide values for all the required arguments.

    Command Structure:

    ./setup_civictheme.sh -c <civictheme_version> \
                          -g <govcms_module_ref> \
                          -m <subtheme_machine_name> \
                          -u "<subtheme_human_name>" \
                          -d "<subtheme_description>" \
                          [-n] \
                          [-p]

Note: Make sure to run the script from your GovCMS project root directory on your host machine (not inside a Docker container).

  1. After completing installation, delete the setup_civictheme.sh file from your repository.

Arguments:

  • -c <civictheme_version>: (Required) The version of the CivicTheme base theme to download (e.g., "1.11.0").
  • -g <govcms_module_ref>: (Required) The Git reference (branch or tag) for the civictheme_govcms module.
    • For a branch: e.g., "main"
    • For a tag: e.g., "1.0.1" or "v1.0.1"
  • -m <subtheme_machine_name>: (Required) The machine-readable name for your new subtheme. Use lowercase letters, numbers, and hyphens/underscores (e.g., "my_custom_site_theme").
  • -u "<subtheme_human_name>": (Required) The human-readable name for your new subtheme. Enclose in quotes if it contains spaces (e.g., "My Custom Site Theme").
  • -d "<subtheme_description>": (Required) A short description for your new subtheme. Enclose in quotes (e.g., "A custom theme for My Awesome GovCMS Project").
  • -n: (Optional) Skip content provisioning. By default, the script will provision demo content. Use this flag to skip that step.
  • -p: (Optional) Apply Drupal cache backend patch (drupal.org issue). This patches LayoutPluginManager to add cache tags for better cache invalidation.
  1. Example:

    ./setup_civictheme.sh -c "{{ VERSION }}" \
                          -g "main" \
                          -m "my_gov_project_theme" \
                          -u "My Gov Project Theme" \
                          -d "Custom theme for the My Gov Project website on GovCMS."
    ./setup_civictheme.sh \
      -c "1.11.0" \
      -g "{{ VERSION }}" \
      -m "my_gov_theme" \
      -u "My Awesome Gov Theme" \
      -d "A custom subtheme for GovCMS." \
      -p

    To skip content provisioning:

    ./setup_civictheme.sh \
      -c "1.11.0" \
      -g "{{ VERSION }}" \
      -m "my_gov_theme" \
      -u "My Awesome Gov Theme" \
      -d "A custom subtheme for GovCMS." \
      -n
  2. View Help: For a reminder of the options and usage:

    ./setup_civictheme.sh -h

How to use this module manually

These instructions are not needed if you are using the automated script.

  1. Enable module
  2. Run Drush drush civictheme_govcms:remove-config command to remove GovCMS configurations.

Drush Commands

Remove all GovCMS configurations:

drush civictheme_govcms:remove-config

Remove all GovCMS configurations, but preserve media_types and content_types:

drush civictheme_govcms:remove-config --preserve=media_types,content_types

List of --preserve options:

  • media_types
  • text_format
  • fields
  • content_types
  • vocabularies
  • user_roles
  • menus
  • pathauto_patterns

Other resources

civictheme/civictheme_govcms 适用场景与选型建议

civictheme/civictheme_govcms 是一款 基于 Shell 开发的 Composer 扩展包,目前已累计 57 次下载、GitHub Stars 达 2, 最近一次更新时间为 2024 年 06 月 29 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 civictheme/civictheme_govcms 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 civictheme/civictheme_govcms 我们能提供哪些服务?
定制开发 / 二次开发

基于 civictheme/civictheme_govcms 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 57
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 14
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 3
  • Forks: 3
  • 开发语言: Shell

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2024-06-29