Starting Foundation automation
This commit is contained in:
57
roles/Foundation/files/custom/bin/gen-aninix-custom
Normal file
57
roles/Foundation/files/custom/bin/gen-aninix-custom
Normal file
@@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
|
||||
URI=https://foundation.aninix.net/assets/css/theme-arc-green.css
|
||||
|
||||
# Gitea arc-green palette
|
||||
BOLDTEXT='#87ab63'
|
||||
TEXT='#9e9e9e'
|
||||
BGCOLOR='#383c4a'
|
||||
ACCENTBG='#353945'
|
||||
HEADERBG='#404552'
|
||||
ROW='#2a2e3a'
|
||||
HOVER='#a0cc75'
|
||||
NAV='#2e323e'
|
||||
|
||||
# AniNIX palette
|
||||
ANINIXBOLD='#df0000'
|
||||
ANINIXTEXT='#ffffff'
|
||||
ANINIXBG='#000000'
|
||||
ANINIXACCENTBG='#303030'
|
||||
ANINIXHEADERBG='#151515'
|
||||
ANINIXROW='#2a2a2a'
|
||||
ANINIXHOVER='#af0000'
|
||||
ANINIXNAV='#000000'
|
||||
|
||||
(curl -ks "$URI"; echo; echo ".home a {
|
||||
color: $ANINIXBOLD;
|
||||
}
|
||||
.bounding {
|
||||
border: 1px solid #FFF;
|
||||
border-radius: 15px;
|
||||
margin: 0;
|
||||
margin-top: 20px;
|
||||
padding: 10px;
|
||||
background-color: #000;
|
||||
margin-bottom: 30px;
|
||||
display: block;
|
||||
}
|
||||
") \
|
||||
| sed "s/$BOLDTEXT/$ANINIXBOLD/gI" \
|
||||
| sed "s/$TEXT/$ANINIXTEXT/gI" \
|
||||
| sed "s/$ACCENTBG/$ANINIXACCENTBG/gI" \
|
||||
| sed "s/$HEADERBG/$ANINIXHEADERBG/gI" \
|
||||
| sed "s/$ROW/$ANINIXROW/gI" \
|
||||
| sed "s/$NAV/$ANINIXNAV/gI" \
|
||||
| sed "s/$HOVER/$ANINIXHOVER/gI" \
|
||||
| sed "s/$BGCOLOR/$ANINIXBG/gI" > /var/lib/gitea/custom/public/css/theme-aninix.css
|
||||
|
||||
cd /var/lib/gitea/web-snippets
|
||||
head="$(curl -ks https://aninix.net/ | egrep -B 99999 '^<div class="home"')"
|
||||
foot="$(curl -ks https://aninix.net/ | egrep -A 99999 '<footer>')"
|
||||
for i in `find . -type f`; do
|
||||
(echo "$head"
|
||||
cat "$i"
|
||||
echo "$foot") > /var/lib/gitea/custom/public/"$i".html
|
||||
done
|
32
roles/Foundation/files/custom/bin/sitemap.php
Normal file
32
roles/Foundation/files/custom/bin/sitemap.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Build a sitemap dynamically.
|
||||
* Update Gitea's sitemap with: `php ./sitemap.php > /var/lib/gitea/custom/sitemap.xml`
|
||||
*
|
||||
* Builds according to https://www.sitemaps.org/protocol.html
|
||||
*/
|
||||
|
||||
/* Globals */
|
||||
$path="/srv/http/aninix.net/";
|
||||
|
||||
echo '<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
';
|
||||
|
||||
exec("(echo /srv/http/aninix.net/index.php; find /srv/http/aninix.net/pages -type f; find /srv/http/aninix.net/martialarts/ -type f) | egrep \.php\$ | egrep -v ^./unlisted\|^./errors/\|head.php\|foot.php\|test\|Template\|darknet", $output);
|
||||
foreach ($output as &$file) {
|
||||
echo ' <url>
|
||||
';
|
||||
echo ' <loc>https://aninix.net/'.substr($file,strlen($path)).'</loc>
|
||||
';
|
||||
echo ' <lastmod>'.date('Y-m-d',filemtime($file)).'</lastmod>
|
||||
';
|
||||
echo ' </url>
|
||||
';
|
||||
}
|
||||
|
||||
/* Print footer */
|
||||
echo '</urlset>
|
||||
';
|
||||
?>
|
Reference in New Issue
Block a user