checlou/flat-file-cms-bundle 问题修复 & 功能扩展

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

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

checlou/flat-file-cms-bundle

Composer 安装命令:

composer require checlou/flat-file-cms-bundle

包简介

Bundle to add a CMS based on markdown files to an symfony web app

README 文档

README

Symfony Bundle to create a CMS with flat files into a symfony app.

Purpose

Provide a solution to a CMS feature in an existing symfony app.

  • Content in markdown files

Fast installation

Requirements : install a basic symfony app with composer.

symfony new my_project_directory --version="6.3.*"
composer require checlou/flat-file-cms-bundle

Set the configuration in config/packages/checlou_flat_file_cms.yaml :

checlou_flat_file_cms:
  content_path: '%kernel.project_dir%/var/cms'

Copy files from Tests/Functional/app/Website/cms to var/cms to a basic page dataset.

Theming

The default theming is a basic bootstrap 4 theme. You can override it by overriding the twig templates.

  • Write documentation to explain how to override twig templates

Content example

File

Name of the file : a-page.md

---
title: Page title
type: page
slug: a-page.html
---

Summary

===

Main content

Two differents types of content :

  • page : a page with a title, a summary and a main content
  • post : a post with a title, a summary and a main content

Default values :

  • type : page
  • slug : filename with .html extension and path as prefix
  • title : filename without extension

Organized by folders

content/
├── a-page.md
├── index.md
├── blog/
│   ├── a-post.md
│   └── another-post.md
│   └── a-category/
│       └── a-post.md

The index.md file is the content used to display the home page of the CMS. You can use this kind of file to create a page with a slug like

  • /home with an index.md file in the folder home/

Others solutions to manage flat files

Pico CMS or Grav CMS

Full app to manage a website with flat files. But you can not use it to add a CMS feature to an existing app. Use Symfony components.

Symfony Bundles

Twig markdown to html

Extension to convert markdown to html in twig templates. We do not use it. Should we use it ?

https://twig.symfony.com/doc/3.x/filters/markdown_to_html.html

Ideas

Todo

  • More tests of Page and Pages class and Twig extension
  • Shortcode system
  • Inject global vars to use in markdown : by configuration and by event
  • Content cache to rebuild without parsing files
  • Configure the CMS to say that pages are isolated (no parent) even if it's in a subfolder
    • Usecase : a specific folder with isolated pages
  • Transform link to markdown file to the url of the page
    • Usecase : use autocompletion in markdown editor to link to another page
  • Command to generate all the website as an artefact
    • Usecase : use Github Pages to host the website
  • Use https://twig.symfony.com/doc/3.x/filters/markdown_to_html.html ?

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-11-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固