使用 Laravel 快速构建网站系列 -- 静态站点/博客生成器:Katana

WBOY
Release: 2016-06-20 12:29:35
Original
1211 people have browsed it

1、简介

Katana是一个基于Laravel开发的静态站点/博客生成器,支持Markdown,并且使用了Laravel的Blade模板引擎。

2、 GitHub

https://github.com/themsaid/katana

3、系统要求

  • PHP 5.5.9+
  • Apache或Nginx服务器
  • Composer

4、安装

我们使用Composer安装Katana:

composer create-project themsaid/katana my-new-site
Copy after login

安装完成后需要使用以下命令build站点:

php katana build
Copy after login

Katana自带了一些实例内容以便你快速上手,上述命名运行完成后站点会生成到 /public 目录下。

5、文档

完整的Katana文档参考这里: http://themsaid.github.io/katana/

6、博客生成器

Katana提供了静态博客生成器功能,你需要做的就是在 /content/_blog 目录下创建一个新的 .blade.php 文件,然后Katana会编译所有文章并将它们显示在你选择的视图中。

博客文章列表基于 config.php 中的配置进行分页,在所有Blade视图中还有一个 $blogPosts 变量包含文章数组。

7、Blade模板引擎

如果你对Blade模板引擎不熟悉, 可以参考其官方文档: http://laravelacademy.org/post/79.html

8、使用GitHubPages

你可以在Katana中通过GitHub Pages发布网站,其原理是部署 public 目录作为你的GitHub Pages仓库主分支或者你项目仓库的gh-pages分支。

更多详情请参考 Katana官方文档 。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!