badaso/sitemap-module 问题修复 & 功能扩展

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

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

badaso/sitemap-module

Composer 安装命令:

composer require badaso/sitemap-module

包简介

Zero development for blog system on badaso

README 文档

README

Installation

  1. Install Badaso from laravel project
  2. Install badaso sitemap module composer require badaso/sitemap-module
  3. Set env
MIX_DEFAULT_MENU=admin
MIX_BADASO_MENU=${MIX_DEFAULT_MENU},sitemap-module
MIX_BADASO_PLUGINS=sitemap-module
  1. Call command php artisan badaso-sitemap:setup
  2. Run the laravel project and call url http://your-laravel-host/sitemap.xml

Configuration

file config.php configuration

return [
    'max_content_paginate' => 500,
    'prefix' => '/',
    'sitemap' => [
        'badaso-blog' => [
            'table' => 'posts',
            'web-access' => [
                'url' => env('MIX_BLOG_POST_URL_PREFIX').'/:slug',
                // :slug is a field in table posts
                // this url auto generate according to the number of table rows
            ],
        ],
        ...
    ],
    'custom_sitemap' => [
        'root' => [
            '/' => [
              'lastmod' => '2021-05-24T09:32:52.785Z',
            ],
            'sub-path' => [
              'lastmod' => '2021-05-24T09:32:52.785Z',
            ],
            'sub-path/sub-path-other' => [
              'lastmod' => '2021-05-24T09:32:52.785Z',
            ],
            ...
        ],
        ...
    ],
];

Your can get foreign table attribute

...
'sitemap' => [
    'badaso-blog' => [
        'table' => 'posts',
        'web-access' => [
            'url' => env('MIX_BLOG_POST_URL_PREFIX').'/:posts.category_id,category.id,category.title',
            // posts.category_id  => foreign key posts table field category_id
            // category.id        => posts table category_id field reference to table category field id 
            // category.title     => output value to path url from category table title field
            // output : http://{HOST}/{MIX_BLOG_POST_URL_PREFIX}/business
        ],
    ],
    ...
],
...

You can create custom sitemap url

...
'custom_sitemap' => [
     // group by http://{HOST}/roo/sitemap.xml
    'root' => [
         // http://{HOST}/root
        '/' => [
          'lastmod' => '2021-05-24T09:32:52.785Z',
        ],
         // http://{HOST}/sub-path
        'sub-path' => [
          'lastmod' => '2021-05-24T09:32:52.785Z',
        ],
         // http://{HOST}/sub-path/sub-path-othe
        'sub-path/sub-path-other' => [
          'lastmod' => '2021-05-24T09:32:52.785Z',
        ],
        ...
    ],
    ...
],
...

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2021-07-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固