wpextra/bridge

此包的最新版本(dev-master)没有可用的许可证信息。

用于编写面向对象代码和Twig模板引擎的WordPress主题的插件

dev-master 2018-07-27 22:36 UTC

This package is not auto-updated.

Last update: 2024-09-29 05:42:04 UTC


README

Packagist

Bridge是一个具有现代开发工作流的WordPress起始主题。

功能

  • 样式表使用Sass
  • 现代JavaScript
  • [Gulp]
  • [Twig]作为模板引擎
  • Bridge MVC用于传递数据以处理自定义函数
  • CSS框架:Bootstrap 4

https://demo.wpextra.co/bridge查看工作示例。

要求

在继续之前,请确保已安装所有依赖项

主题安装

使用Composer从您的WordPress主题目录安装Sage(将下面的your-theme-name替换为您主题的名称)

# @ app/themes/ or wp-content/themes/
$ composer create-project wpextra/bridge your-theme-name

要安装Sage的最新开发版本,请在命令末尾添加dev-master

$ composer create-project wpextra/bridge your-theme-name dev-master

在主题安装过程中,您将有权更新style.css主题头部,选择CSS框架,并配置Browsersync。

主题结构

themes/your-theme-name/   # → Root of your Sage based theme
├── app/                  # → Theme PHP
│   ├── apis/      		  # → Controller files
│   ├── controllers/      # → Controller files
│   ├── models/      	  # → Controller files
│   ├── repository/       # → Controller files
│   ├── persistent/       # → Controller files
│   ├── elements/         # → Your element block
│   │   ├── blocks/       #
│   │   ├── header/       #
│   │   ├── footer/       #
│   │   └── popups/       #
│   ├── config.php        # → Theme customizer setup
│   ├── filters.php       # → Theme filters
│   ├── helpers.php       # → Helper functions
│   ├── kernel.php        # → Helper functions
│   └── setup.php         # → Theme setup
├── composer.json         # → Autoloading for `app/` files
├── composer.lock         # → Composer lock file (never edit)
├── dist/                 # → Built theme assets (never edit)
├── node_modules/         # → Node.js packages (never edit)
├── package.json          # → Node.js dependencies and scripts
├── resources/            # → Theme assets and templates
│   ├── assets/           # → Front-end assets
│   │   ├── config.json   # → Settings for compiled assets
│   │   ├── fonts/        # → Theme fonts
│   │   ├── images/       # → Theme images
│   │   ├── scripts/      # → Theme JS
│   │   └── scss/         # → Theme stylesheets
│   ├── functions.php     # → Composer autoloader, theme includes
│   ├── index.php         # → Never manually edit
│   ├── screenshot.png    # → Theme screenshot for WP admin
│   ├── style.css         # → Theme meta information
│   └── views/            # → Theme templates
│       ├── layouts/      # → Base templates
│       └── partials/     # → Partial templates
└── index.php             #
└── archive.php           #
└── page.php              #
└── single.php            #
└── 404.php               #
└── functions.php         #
└── style.scss            #
└── vendor/               # → Composer packages (never edit)

主题设置

编辑app/setup.php以启用或禁用主题功能,设置导航菜单,文章缩略图大小和侧边栏。

主题开发

  • 从主题目录运行yarn以安装依赖项
  • 更新resources/assets/config.json设置

构建命令

  • yarn start — 当文件更改时编译资源,启动Browsersync会话
  • yarn build — 编译并优化您的资源目录中的文件
  • yarn build:production — 编译用于生产的资源

文档

贡献

欢迎所有人贡献。

金牌赞助商

通过以下方式支持我们的开源开发工作

社区

跟踪开发和社区新闻。