PHPackages                             tomk79/px2-seo-utils - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tomk79/px2-seo-utils

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tomk79/px2-seo-utils
====================

Pickles 2 に、SEOに関するユーティリティを追加します。

0.1.0(4y ago)04MITPHPPHP &gt;=5.4.0

Since Aug 15Pushed 4y ago1 watchersCompare

[ Source](https://github.com/tomk79/px2-seo-utils)[ Packagist](https://packagist.org/packages/tomk79/px2-seo-utils)[ RSS](/packages/tomk79-px2-seo-utils/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (8)Versions (4)Used By (0)

px2-seo-utils
=============

[](#px2-seo-utils)

[Pickles 2](https://pickles2.pxt.jp/) に、SEOに関するユーティリティを追加します。

セットアップ - Setup
--------------

[](#セットアップ---setup)

### 1. インストール - Installation

[](#1-インストール---installation)

Pickles 2 をセットアップしたあとに、次のコマンドを実行します。

```
$ composer require tomk79/px2-seo-utils;

```

### 2. `$conf->funcs->before_sitemap` に設定する

[](#2-conf-funcs-before_sitemap-に設定する)

設定ファイル `config.php` (通常は `./px-files/config.php`) を編集し、次のように追記します。 テーマの後に実行されるように設定してください。

```
$conf->funcs->before_sitemap = array(

    // 〜中略〜

    // SEO Utils
    tomk79\pickles2\px2_seo_utils\config::init(array(
        /* プラグインの設定 (後述) */
    )),

    // 〜中略〜

);
```

使い方 - Usage
-----------

[](#使い方---usage)

### robots タグの出力

[](#robots-タグの出力)

#### プラグイン設定

[](#プラグイン設定)

`robots->enable` を `true` に設定します。

```
    // SEO Utils
    tomk79\pickles2\px2_seo_utils\config::init(array(

        'robots' => array(
            // metaタグ robots の自動挿入を有効にします。
            'enable' => true,
        ),

    )),
```

#### サイトマップを拡張する

[](#サイトマップを拡張する)

サイトマップに次の列を追加します。

- `robots:follow`
- `robots:index`
- `robots:archive`

サイトマップに追加した拡張列に、各ページの設定を入力します。

- `on`、 `yes`、 `true`、 `1` のように入力した場合は、肯定の命令(例: `follow`) が出力されます。
- `off`、 `no`、 `false`、 `0` のように入力した場合は、否定の命令(例: `nofollow`) が出力されます。
- 空白か、列が未定義か、または `null` のように入力した場合は、出力されません。

3つの項目のうちの何れか1つ以上が設定されている場合、 `head` 要素の閉じタグの直前に、 `` のようなコードが出力されます。

#### metaタグを直接取得する

[](#metaタグを直接取得する)

直接タグを取得したい場合は、次の例のように `$seoUtils->robots()->tag()` メソッドから取得できます。 このとき、 同時に `X-Robots-Tag` ヘッダーが発行されます。

```

```

### sitemap.xml の生成

[](#sitemapxml-の生成)

#### プラグイン設定

[](#プラグイン設定-1)

`sitemapXml->enable` を `true` に設定します。

```
    // SEO Utils
    tomk79\pickles2\px2_seo_utils\config::init(array(

        'sitemapXml' => array(
            // sitemap.xml の自動生成機能を有効にします。
            'enable' => true,

            // ここに設定したパスへのリクエストをトリガーに、sitemap.xml が生成されます。
            'trigger' => '/index.html',

            // 生成した sitemap.xml の保存先のパスです。
            // `.px_execute.php` が置かれているディレクトリをルートとして設定します。
            'dist' => '/sitemap.xml',
        ),

    )),
```

更新履歴 - Change log
-----------------

[](#更新履歴---change-log)

### tomk79/px2-seo-utils v0.1.0 (2021年8月15日)

[](#tomk79px2-seo-utils-v010-2021年8月15日)

- Initial Release.

ライセンス - License
---------------

[](#ライセンス---license)

MIT License

作者 - Author
-----------

[](#作者---author)

- Tomoya Koyanagi
- website:
- Twitter: @tomk79

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1728d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/00ca3b0b7c69b5a8c25bbfb82b305ab94c4fc7458b38df445cbb97acc073875f?d=identicon)[tomk79](/maintainers/tomk79)

---

Top Contributors

[![tomk79](https://avatars.githubusercontent.com/u/584845?v=4)](https://github.com/tomk79 "tomk79 (8 commits)")

---

Tags

pickles2

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tomk79-px2-seo-utils/health.svg)

```
[![Health](https://phpackages.com/badges/tomk79-px2-seo-utils/health.svg)](https://phpackages.com/packages/tomk79-px2-seo-utils)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
