Dueper Thor 主题

安装: 1

依赖: 0

建议者: 0

安全: 0

星星: 0

分支: 0

类型:wordpress-theme

dev-master 2020-02-13 14:41 UTC

This package is not auto-updated.

Last update: 2024-09-27 11:15:50 UTC


README

Packagist devDependency Status Build Status

Sage 是一个具有现代化开发工作流程的 WordPress 入门主题。

特点

roots-example-project.com 查看工作示例。

要求

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

主题安装

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

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

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

$ composer create-project roots/sage your-theme-name dev-master

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

主题结构

themes/your-theme-name/   # → Root of your Sage based theme
├── app/                  # → Theme PHP
│   ├── Controllers/      # → Controller files
│   ├── admin.php         # → Theme customizer setup
│   ├── filters.php       # → Theme filters
│   ├── helpers.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
│   │   ├── build/        # → Webpack and ESLint config
│   │   ├── fonts/        # → Theme fonts
│   │   ├── images/       # → Theme images
│   │   ├── scripts/      # → Theme JS
│   │   └── styles/       # → 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
└── vendor/               # → Composer packages (never edit)

主题设置

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

主题开发

  • 从主题目录运行 yarn 以安装依赖项
  • 更新 resources/assets/config.json 设置
    • devUrl 应反映您的本地开发主机名
    • publicPath 应反映您的 WordPress 文件夹结构(对于非 Bedrock 安装为 /wp-content/themes/sage

构建命令

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

文档

贡献

欢迎所有人贡献。我们有一些 贡献指南 来帮助您开始。

Sage 赞助商

通过 成为赞助商 来支持我们的开源开发工作。

Kinsta KM Digital itineris Helsingborg Design LAB

社区

跟踪开发和社区新闻。