定制 clarkwinkelmann/flarum-pages-generator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

clarkwinkelmann/flarum-pages-generator

最新稳定版本:0.1

Composer 安装命令:

composer require clarkwinkelmann/flarum-pages-generator

包简介

Generate pseudo-static pages from markdown and HTML files for Flarum

README 文档

README

This is not a Flarum extension. This package provides a Flarum extender that you can use in the local extend.php to define custom pages.

Install at the root of your Flarum, or as a dependency to one of your custom extensions.

I don't recommend bundling this as a dependency of public extensions.

This package is in beta! Breaking releases will be released regularly. Make sure to use ^ or ~ semver constraints!

composer require clarkwinkelmann/flarum-pages-generator

Usage

In extend.php:

return [
    (new \ClarkWinkelmann\PagesGenerator\Pages())
        ->source(__DIR__ . '/pages')
        ->mithrilComponent('ContactForm', "flarum.extensions['acme-basic-form'].ContactForm"),
];

->source(string $path) defines a source folder to enumerate for pages.

->mithrilComponent(string $tag, string $import) optionally defines a mapping of an HTML tag to a Mithril component. The expression will be called with eval().

You can call source and mithrilComponent multiple times on a single extender instance.

At the moment, a single extender instance must exist in the Flarum application! If multiple extensions try to use it, it will break.

Pages

Pages can be Markdown (.md) or HTML (.html) and must include a Yaml front matter.

Markdown is parsed using the Flarum formatter. Any markdown or bbcode made available by extensions will be available.

The filename without file extension will be the page URL. Subfolders under the source directory are preserved as part of the URL.

Example: basic markdown

---
title: About us
---

This is a markdown text with **formatting**.

Example: basic HTML

---
title: Find Us
---

<p>It's very simple to find us</p>

<iframe src=""></iframe>

Example: Markdown page with custom component

---
title: Contact
---

Use the form to contact us:

<ContactForm title="A title attr"></ContactForm>

统计信息

  • 总下载量: 789
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-08-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固