basteyy/static-markdown-pages 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

basteyy/static-markdown-pages

Composer 安装命令:

composer require basteyy/static-markdown-pages

包简介

README 文档

README

A tool for using static markdown pages inside your project.

Setup

composer require basteyy/static-markdown-pages

Usage

First you need to have your markdown pages. In the following example I expect, that you have stored a couple of files inside /var/www/storage/my_pages/.

$ ls /var/www/storage/my_pages/
my_file_1.md
my_file_2.md
fancy-third-file.md

Every page needs to contain a few meta-data at the beginning of the document.

For example content of fancy-third-file.md:

$ cat /var/www/storage/my_pages/fancy-third-file.md
title: I'm the fancy third file!
url: /fancy-third/
author: John Doe
===

# Example Markdown Page

As you can see .. this is markdown
/** @var \basteyy\StaticMarkdownPage\Archive $staticPages */
$staticPages = new \basteyy\StaticMarkdownPage\Archive('/var/www/storage/my_pages/');

To get the fancy-third-file, you need to pass the url to getByUrl-Method:

/** @var \basteyy\StaticMarkdownPage\Archive $staticPages */
/** @var \basteyy\StaticMarkdownPage\Page $page */
$page = $staticPages->getByUrl('/fancy-third/');

Now you can print the file:

/** @var \basteyy\StaticMarkdownPage\Archive $staticPages */
/** @var \basteyy\StaticMarkdownPage\Page $page */
echo $page->getHtml();

That's it.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: CC0-1.0
  • 更新时间: 2021-12-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固