复刻 WordPress 的核心功能与后台交互体验,同时保留 Rails 的开发优雅性。主题、插件、小工具、SEO、REST API —— 一个完整的 CMS 生态。
# 克隆并启动,只需几行命令
$ git clone https://github.com/your-org/wordpress_on_rails
$ cd wordpress_on_rails
$ bin/rails db:setup
$ bin/dev
=> Puma starting on http://localhost:3000
=> WordPress on Rails is ready! 🚀
完整的内容管理解决方案,从内容创作到技术架构一应俱全
基于 TipTap 的富文本编辑器,支持 Markdown 模式切换、图片拖拽上传、表格、代码块、任务列表等
内置 3 套主题,视图路径覆盖机制,支持 ZIP 包上传安装/卸载,主题自定义设置面板
基于 PluginBase 的插件系统,完整的 Hooks & Filters 机制,视图钩子与管理菜单注册
嵌套回复、评论审核流程(待审/通过/垃圾/回收),支持评论通知
文章/页面级别的 SEO 字段,自动生成 Sitemap XML 和 robots.txt,支持 Google/Bing 站点验证
WordPress 兼容的 RESTful API,JWT Token 认证,覆盖完整 CRUD 操作
WordPress 风格后台界面,仪表盘统计、媒体管理、菜单拖拽排序、小工具管理
基于 rufus-scheduler 的进程内调度,6 个内置任务,支持 10 种执行频率,可自定义扩展
成熟的 Rails 技术栈,优雅而强大
最新稳定版 Ruby 和 Rails,享受类型化参数、专属语法等现代语言特性
Turbo Drive + Turbo Frames + Stimulus Controllers,无需重写即可获得 SPA 体验
强大的关系型数据库,支持全文搜索、JSON 字段、多态关联
极速前端打包,原生 ESM 模块支持,开箱即用
成熟的用户认证方案,支持 5 种角色(Admin / Editor / Author / Contributor / Subscriber)
多阶段构建 Dockerfile,一键部署到任何容器平台
灵活的扩展体系,打造属于你的 CMS
多主题支持,视图路径覆盖机制
基于 PluginBase 的完整插件架构
class MyPlugin < PluginBase
def self.setup
register_hook(:after_post_publish,
method: :on_publish)
register_filter(:post_content,
method: modify_content)
register_admin_menu_item(
label: "My Plugin",
path: "/admin/my-plugin"
)
end
def self.on_publish(post)
logger.info "文章已发布: #{post.title}"
end
end
# themes/my-theme/theme_settings.yml
settings:
- key: hero_title
label: "首页大标题"
type: text
default: "Welcome"
group: "首页"
- key: primary_color
label: "主色调"
type: text
default: "#CC0000"
group: "外观"
- key: show_sidebar
label: "显示侧边栏"
type: boolean
default: "1"
group: "布局"
只需几步,即可在本地运行 WordPress on Rails
git clone https://github.com/your-org/wordpress_on_rails
cd wordpress_on_rails
bundle install
yarn install
cp config/database.yml.example config/database.yml
# 编辑 database.yml 填写连接信息
bin/rails db:create db:migrate
bin/rails db:seed
bin/dev
访问 http://localhost:3000 查看前台,/wp-admin 进入后台
docker build -t wordpress-on-rails .
docker run -d -p 3000:3000 \
-e DATABASE_URL=postgresql://user:pass@host:5432/dbname \
-e RAILS_ENV=production \
wordpress-on-rails
熟悉的 WordPress 后台体验,Rails 的优雅实现