Add website publisher script

Signed-off-by: Muntashir Al-Islam <muntashirakon@riseup.net>
This commit is contained in:
Muntashir Al-Islam 2025-03-25 02:02:04 -07:00
parent dd31b9fcae
commit 1ac05ca509
2 changed files with 32 additions and 6 deletions

View File

@ -6,7 +6,7 @@ const BROWSER_DIR = REPO_DIR . "/browser";
const SRC_DIR = BROWSER_DIR . "/src"; const SRC_DIR = BROWSER_DIR . "/src";
const BLOATWARE_DIR = SRC_DIR . "/bloatware"; const BLOATWARE_DIR = SRC_DIR . "/bloatware";
const SUMMARY_FILE = SRC_DIR . "/SUMMARY.md"; const SUMMARY_FILE = SRC_DIR . "/SUMMARY.md";
const SITEMAP_FILE = SRC_DIR . "/sitemap.xml"; const SITEMAP_FILE = SRC_DIR . "/sitemap";
# Create bloatware list # Create bloatware list
$bloatware_list = []; $bloatware_list = [];
@ -51,16 +51,27 @@ file_put_contents(SUMMARY_FILE, $summary);
# Create sitemap # Create sitemap
$SITE_NAME = "https://muntashirakon.github.io/android-debloat-list"; $SITE_NAME = "https://muntashirakon.github.io/android-debloat-list";
$urls = '<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">'; $urls = <<<EOF
$urls .= <<<EOF <?xml version="1.0" encoding="UTF-8"?>
<url><loc>{$SITE_NAME}</loc></url> <urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>{$SITE_NAME}</loc>
</url>
EOF; EOF;
foreach ($bloatware_list as $id => $name) { foreach ($bloatware_list as $id => $name) {
$urls .= <<<EOF $urls .= <<<EOF
<url><loc>$SITE_NAME/bloatware/{$id}.html</loc></url>
<url>
<loc>$SITE_NAME/bloatware/{$id}.html</loc>
<changefreq>weekly</changefreq>
</url>
EOF; EOF;
} }
$urls .= '</urlset>'; $urls .= <<<EOF
</urlset>
EOF;
file_put_contents(SITEMAP_FILE . ".xml", $urls);
file_put_contents(SITEMAP_FILE, $urls); file_put_contents(SITEMAP_FILE, $urls);
exit(0); exit(0);

View File

@ -0,0 +1,15 @@
#!/usr/bin/env sh
# Generate MD files
php scripts/browser_generator.php
# Build website
cd browser
mdbook build
# Publish
cd book
git init
git add .
git commit
git push -f git@github.com:MuntashirAkon/android-debloat-list.git master:site