avvertix/pronto-framework

此包已被弃用且不再维护。未建议替代包。

Pronto CMS 基础框架。

v0.1.2 2016-03-15 18:31 UTC

This package is auto-updated.

Last update: 2020-02-08 12:51:53 UTC


README

Build Status

Pronto CMS 框架

这是一个正在进行中的项目

这是基于扁平文件系统的 Pronto CMS 的基础框架(或者更准确地说是一系列服务)。这个小框架以 Laravel Lumen 服务提供者的形式提供了 Markdown 解析和内容提取功能。

要求

  • php 5.5.9+
  • php fileinfo 扩展
  • Composer(用于管理 PHP 依赖项)

提供的 API 和服务

待描述

pageview 辅助函数

在视图中渲染 markdown 文件并返回组合视图

pageroute 辅助函数

获取指定 markdown 文件的链接

content_path 辅助函数

image_path 辅助函数

assets_path 辅助函数

理解的内容

这个小框架中提供的解析器能够理解带或不带 front-matter 的 markdown 文件。

Markdown 文件必须具有 .md 扩展名和 UTF-8 字符编码。

如果设置了 front-matter,它必须以 --- 开头并在各自的行上结束,如下所示:

---
Order: 0
PageTitle: Welcome to Pronto
TOCTitle: Welcome
MetaDescription: This is Pronto, the CMS almost "ready".
MetaTags: pronto, cms
---

This is the page **static text**

元数据

实际上,一些包含在 Markdown 文件 front-matter 部分中的元数据在框架内部使用

  • Order - 这是左侧导航 TOC 中使用的顺序,如果为空则页面不在 TOC 中
  • PageTitle - 页面在 HTML 标题和搜索结果中使用的标题
  • TOCTitle(可选)- 左侧导航 TOC 中此页使用的标题。如果标题需要与 PageTitle 不同,请使用此功能
  • MetaDescription - 此页面的元描述,有助于搜索
  • MetaTags - 此页面的更多标签,再次用于搜索