Add files via upload
这个提交包含在:
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 小小白哦
|
||||
Copyright (c) 2021 Pipecraft
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,2 +1,43 @@
|
||||
# id-slug
|
||||
Use id as the slug in the discussion URL.
|
||||
# ID Slug
|
||||
|
||||
[](https://github.com/Xiaoxiaobai5724/id-slug/blob/2.x/LICENSE.md) [](https://packagist.org/packages/Xiaoxiaobai5724/id-slug) [](https://packagist.org/packages/Xiaoxiaobai5724/id-slug)
|
||||
|
||||
---
|
||||
|
||||
A [Flarum](https://flarum.org) extension. Use `id` as the `slug` in the discussion URL.
|
||||
|
||||
- AS-IS:
|
||||
- http://exmaple.com/d/123-hello-world
|
||||
- http://exmaple.com/d/123-hello-world/3
|
||||
|
||||
- TO-BE:
|
||||
- http://exmaple.com/d/123
|
||||
- http://exmaple.com/d/123/3
|
||||
|
||||
### Installation
|
||||
```sh
|
||||
composer require xxb/id-slug
|
||||
```
|
||||
|
||||
> **Migrating from pipecraft/flarum-ext-id-slug**
|
||||
This extension was transferred to XXB and was previously published as `pipecraft/flarum-ext-id-slug`. The XXB line begins at **2.0.0**, continuing the version history (the previous package reached 1.1.0).
|
||||
For forum admins, migration is a one-line change — swap the package, keep your settings and stored SEO data:
|
||||
```sh
|
||||
composer remove pipecraft/flarum-ext-id-slug
|
||||
composer require xxb/id-slug
|
||||
php flarum cache:clear
|
||||
```
|
||||
|
||||
### Updating
|
||||
```sh
|
||||
composer update xxb/id-slug
|
||||
```
|
||||
|
||||
### How to Use
|
||||
1. Install extension
|
||||
2. Enable **ID Slug** extension
|
||||
3. Basics > Slug Driver(Discussion) > Select **id** slug driver
|
||||
|
||||
### Notice
|
||||
|
||||
- If you are using the sitemap(fof/sitemap) extension, you need to upgrade to v1.0.1 or above. ([Use Slug Driver system properly](https://github.com/FriendsOfFlarum/sitemap/issues/30))
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"name": "xxb/id-slug",
|
||||
"description": "A Flarum 2.0 extension. Use id as slug in discussion URL.",
|
||||
"keywords": [
|
||||
"id",
|
||||
"slug",
|
||||
"slug-driver"
|
||||
],
|
||||
"type": "flarum-extension",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Pipecraft",
|
||||
"email": "pipecraft.net@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Xiaoxiaobai5724",
|
||||
"email": "odoorbell@163.com",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/Xiaoxiaobai5724/id-slug/issues",
|
||||
"source": "https://github.com/Xiaoxiaobai5724/id-slug"
|
||||
},
|
||||
"homepage": "https://github.com/Xiaoxiaobai5724",
|
||||
"require": {
|
||||
"flarum/core": "^2.0.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"XXB\\IdSlug\\": "src/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"flarum-extension": {
|
||||
"title": "XXB ID Slug",
|
||||
"category": "feature",
|
||||
"icon": {
|
||||
"name": "fas fa-info",
|
||||
"backgroundColor": "#00bfff",
|
||||
"color": "#fff"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Xiaoxiaobai5724/id-slug.
|
||||
*
|
||||
* Copyright (c) XXB.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace XXB\IdSlug;
|
||||
|
||||
use Flarum\Discussion\Discussion;
|
||||
use Flarum\Extend;
|
||||
use XXB\IdSlug\Discussion\IdSlugDriver;
|
||||
|
||||
return [
|
||||
(new Extend\ModelUrl(Discussion::class))
|
||||
->addSlugDriver('id', IdSlugDriver::class)
|
||||
];
|
||||
在新工单中引用
屏蔽一个用户