v0.0.4 2021-08-18 00:56 UTC

README

Blog UI wrapper for the Laravel Wink package.

安装

您可以通过composer安装此包

composer require gustavomartinez/gmblog

用法

此包需要两个不同的布局来渲染帖子列表和帖子内容,在您的项目中创建这些blade布局,并在其中定义一些将要显示内容的区域。

帖子列表

<!-- resources/layouts/blog.blade.php -->
@yield('blog')

帖子内容

<!-- resources/layouts/post.blade.php -->
@yield('post')

将此stack添加到您的基布局中,以渲染单个帖子页面的元字段。

@stack('meta')

博客样式

此包使用Tailwindcss实用工具进行样式设置,因此您需要安装和设置tailwindcss以样式化博客。您需要在tailwind.config.js文件中添加@tailwindcss/typography插件。

您还应在tailwindcss的purge数组中包含此路径。

purge: [
    "../packages/gmblog/**/*.php",
    // ...
];

颜色

这不是强制性的,但您可以在tailwind.config.js文件中添加和自定义这些颜色。

{
    theme: {
        extend: {
            colors: {
                // Share buttons colors
                facebook: "#3B5998",
                twitter: "#38A1F3",

                // Main accent color
                primary: colors.blue,
                // ...
            }
        }
    }
}

翻译

所有文本都可以使用翻译字符串作为键进行翻译。

/* lang/en.json */
{
    "Read more": "Read more",
}

配置

您可以通过配置文件自定义此包的一些行为。

php artisan vendor:publish --tag=config --provider='Gmblog\GmblogServiceProvider'