tweaks for cosmic web & rss performance

This commit is contained in:
James Tomasino 2021-01-15 13:32:07 +00:00
parent ddb28ee6f8
commit af9da8b2ec
5 changed files with 10 additions and 12 deletions

View File

@ -10,15 +10,15 @@ if [ "$run_user" = "gemini" ]; then
cp -R /var/gopher/* /var/gemini > /dev/null 2>&1
# generate index pages
curl -s gopher://cosmic.voyage | /var/cosmic/awk/gophermap2gemini.awk > /var/gemini/index.gmi
curl -s gopher://cosmic.voyage/1/log | /var/cosmic/awk/gophermap2gemini.awk > /var/gemini/log/index.gmi
curl -s gopher://cosmic.voyage/1/ships | /var/cosmic/awk/gophermap2gemini.awk > /var/gemini/ships/index.gmi
curl -s gopher://localhost | /var/cosmic/awk/gophermap2gemini.awk > /var/gemini/index.gmi
curl -s gopher://localhost/1/log | /var/cosmic/awk/gophermap2gemini.awk > /var/gemini/log/index.gmi
curl -s gopher://localhost/1/ships | /var/cosmic/awk/gophermap2gemini.awk > /var/gemini/ships/index.gmi
sed 's?gopher://cosmic.voyage/0/?gemini://cosmic.voyage/?' /var/gopher/rss.xml | sed 's?<link>gopher://cosmic.voyage?<link>gemini://cosmic.voyage?' > /var/gemini/rss.xml
# create ship directories
find "/var/gopher/" -maxdepth 1 ! -path "/var/gopher/" ! -path "/var/gopher/ships" ! -path "/var/gopher/log" -type d | sed 's|/var/gopher/||' | sort | while read -r ship
do
curl -s "gopher://cosmic.voyage/1/ships/${ship}" | /var/cosmic/awk/gophermap2gemini.awk > "/var/gemini/ships/${ship}/index.gmi"
curl -s "gopher://localhost/1/ships/${ship}" | /var/cosmic/awk/gophermap2gemini.awk > "/var/gemini/ships/${ship}/index.gmi"
done
# Let user's know it's done
printf "Gemini and gemini RSS rebuilt successfully.\\n"

View File

@ -16,13 +16,14 @@ if [ "$run_user" -eq 0 ]; then
printf "\\n<title>Cosmic Voyage</title>\\n"
printf "<link>https://cosmic.voyage</link>\\n"
printf "<description>Messages from the human stellar diaspora</description>\\n"
printf "<ttl>1440</ttl>\\n"
} > "${file_rss}"
# Loop through listings gophermap
loop=0
while read -r line; do
loop=$((loop+1))
if [ "$loop" -lt 50 ]; then
if [ "$loop" -lt 20 ]; then
log=$(printf "%s" "$line" | awk -F'\t' '{print $2}')
title=$(printf "%s" "$line" | awk -F'\t' '{print $1}' | sed 's|^.||')
owner=$(stat -c %U "/var/gopher${log}")

View File

@ -310,7 +310,6 @@ if [ "$run_user" = "root" ] || [ "$run_user" = "publish" ]; then
# copy cosmic banner
cp "/var/cosmic/files/cosmicbanner.png" "${html_dir}"
cp "/var/cosmic/files/paper.png" "${html_dir}"
cp "/var/cosmic/files/inconsolata-regular-webfont.woff" "${html_dir}"
cp "/var/cosmic/files/inconsolata-regular-webfont.woff2" "${html_dir}"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

View File

@ -5,6 +5,7 @@
url('/inconsolata-regular-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
font-display: swap;
}
html {
@ -14,8 +15,7 @@
body {
color: #333;
background-color: white;
background-image: url('/paper.png');
background-color: #f2f4f4;
background-repeat: repeat;
}
@ -56,8 +56,7 @@
@media (prefers-color-scheme: light) {
body {
color: #333;
background-color: white;
background-image: url('/paper.png');
background-color: #f2f4f4;
background-repeat: repeat;
}
@ -93,8 +92,7 @@
/* Manually toggled light class on body */
body.light {
color: #333;
background-color: white;
background-image: url('/paper.png');
background-color: #f2f4f4;
background-repeat: repeat;
}