PHP code example of pickles2 / px2-blog-kit

1. Go to this page and download the library: Download pickles2/px2-blog-kit library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pickles2 / px2-blog-kit example snippets




/* 中略 */

/**
 * funcs: Before content
 */
$conf->funcs->before_content = array(

    // BlogKit
    \pickles2\px2BlogKit\register::blog( array(
        "blogs" => array(
            "articles" => array( // ブログID
                "orderby" => "update_date", // 並べ替えに使用するカラム名
                "scending" => "desc", // 並び順 (昇順 asc or 降順 desc)
                "logical_path" => "/articles/{*}", // パンくず (サイトマップCSV上での記法と同じ)
            ),
        ),
    ) ),

);



/* 中略 */

/**
 * funcs: Before output
 */
$conf->funcs->before_output = array(

    // BlogKit: RSS出力
    \pickles2\px2BlogKit\register::feeds( array(
        "path_trigger" => "/",
        "blog_id" => "articles",
        "orderby" => "update_date",
        "scending" => "desc",
        'dpp' => 10,
        'lang' => 'ja',
        'scheme' => 'https',
        'domain' => 'yourdomain.com',
        'title' => 'test list 1',
        'description' => 'TEST LIST',
        'url_home' => 'https://yourdomain.com/',
        'url_index' => 'https://yourdomain.com/listsample/',
        'author' => 'Tomoya Koyanagi',
        'dist' => array(
            'atom-1.0' => '/rss/atom0100.xml',
            'rss-1.0' => '/rss/rss0100.rdf',
            'rss-2.0' => '/rss/rss0200.xml',
        ),
    ) ),

);
csv
"* title","* path","* release_date","* update_date","* article_summary","* article_keywords"
"サンプルブログページ3のタイトル","/articles/2023/03/18/samplepage_3/","2023-03-18","2023-03-18",,
"サンプルブログページ2のタイトル","/articles/2023/03/17/samplepage_2/","2023-03-17","2023-03-17",,
"サンプルブログページ1のタイトル","/articles/2023/03/16/samplepage_1/index.html","2023-03-16","2023-03-16",,