shithub: shithub

Download patch

ref: 8051ddedc2b0571549b25d851aeb949b8d4bb88a
parent: 4f55ee44dd0b402ff44b6ac47a088b334d6c0301
author: phil9 <telephil9@gmail.com>
date: Thu Feb 4 05:30:44 EST 2021

fix rss link url in <head> tag

--- a/common.rc
+++ b/common.rc
@@ -91,6 +91,9 @@
 }
 
 fn prelude {
+	puser=$1
+	prepo=$2
+
 	echo '
 	<!DOCTYPE html>
 	<html>
@@ -159,11 +162,12 @@
 			#diff #ctx{
 				margin: 0em;
 			}
-		</style>
-	 	<link rel="alternate" type="application/rss+xml" href="feed.rss" title="rss">
-		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+		</style>'
+	if(! ~ $puser '')
+	 	echo '<link rel="alternate" type="application/rss+xml" href="/git/'$puser/$prepo'/HEAD/feed.rss" title="rss">'
+	echo '	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 		<meta name="viewport" content="width=device-width,initial-scale=1">
-		<title>Shithub: '$"1'</title>
+		<title>Shithub: '$"prepo'</title>
 	</head>
 	<body>
 	'
@@ -174,7 +178,7 @@
 	prepo=$2
 	phash=$3
 
-	prelude $prepo
+	prelude $puser $prepo
 	echo '	<h1><a href="/git/repos.html">Git</a>: 
 		<a href="/git/'$puser/$prepo/$phash'/info.html">'$prepo'</a></h1>
 		<div id="linkbar">
--- a/list
+++ b/list
@@ -9,7 +9,7 @@
 nl='
 '
 
-prelude Repolist
+prelude '' Repolist
 echo '	<h1>Repos</h1>'
 udir=()
 for(repo in `$nl{ls */}){