xml-feed-generator/feed_generator.php

55 lines
2.3 KiB
PHP
Raw Permalink Normal View History

2023-10-17 14:13:20 +00:00
<?php
// GENERAL SETTINGS ---------------------------------------- //
2023-10-18 04:28:45 +00:00
# the timezone referenced by the system for automatic timestamping.
# suported timezones: https://www.php.net/manual/en/timezones.php
2023-10-18 04:28:45 +00:00
$timezone = 'Asia/Jakarta';
2023-10-18 11:13:54 +00:00
$max_entries = 10;
// NAME OF FEED FILE
$file = 'articles.xml';
2023-10-18 04:28:45 +00:00
// FEED METADATA
# &, <, >, ', and " must be escaped as &amp;, &lt;, &gt;, &apos;, and &quot; (reference: https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references)
2023-10-18 04:28:45 +00:00
$feed_title = 'jasmine&apos;s b(rain)log | jasm1nii.xyz';
$feed_subtitle = 'blog articles by jasmine';
## location of the blog index page (or if unavailable, your main page).
2023-10-18 04:28:45 +00:00
$blog_url = 'https://jasm1nii.xyz/blog/articles';
## permalink to the XML feed on your site.
2023-10-18 04:28:45 +00:00
$feed_url = 'https://jasm1nii.xyz/blog/articles/articles.xml';
## information about the feed author.
2023-10-18 04:28:45 +00:00
$author_name = 'jasmine';
$author_email = 'contact@jasm1nii.xyz';
$author_homepage = 'https://jasm1nii.xyz/';
2023-10-18 04:28:45 +00:00
$feed_icon = 'https://jasm1nii.xyz/assets/media/itchio-textless-white.svg';
$feed_logo = 'https://jasm1nii.xyz/assets/media/main/07042023-me_compressed.webp';
$rights = '© 2023 - jasmine amalia';
2023-10-18 04:28:45 +00:00
/* -------------------- */
2023-10-17 14:13:20 +00:00
// PATH TO FETCH PAGES FROM
## __DIR__ is the directory where *this script* is located.
$site_root = dirname(__DIR__, 2).'/public_html';
2023-10-17 14:13:20 +00:00
## once i'm there, i specify the parent directory where i keep all of my blog pages.
## because the values of $blog_root and $blog_entries will be used for generating entry links, forward slashes are a *must*.
$blog_root = $site_root.'/blog/articles';
2023-10-17 14:13:20 +00:00
## then, specify a pattern that matches the path of each individual page. for example, this will match /YYYY/MM/DD/entry (any file extension).
$blog_entries = $blog_root.'/*/*/*/[entry]*';
2023-10-17 14:13:20 +00:00
/* -------------------- */
2023-10-18 04:28:45 +00:00
// ENTRY METADATA
## depending on your site setup, this might not be the same as $blog_url.
## the generator will appended $blog_root to the URL specified below.
$blog_directory_url = 'https://jasm1nii.xyz/blog/articles';
2023-10-17 14:13:20 +00:00
// END OF CONFIG ---------------------------------------- //
2023-10-18 11:13:54 +00:00
require __DIR__.'/feed_generator_functions.php';
2023-10-17 14:13:20 +00:00
?>