- Move some of the rss code to where it belongs
- Generate </body></html> automatically
This commit is contained in:
		
							parent
							
								
									9168b449f4
								
							
						
					
					
						commit
						2f98e908c0
					
				
					 1 changed files with 27 additions and 24 deletions
				
			
		|  | @ -175,7 +175,34 @@ if(! ~ $#blogDirs 0) { | |||
| ' | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| fn template { | ||||
|     template.awk | rc $rcargs | | ||||
|     awk '{ | ||||
|         buf = buf $0"\n" | ||||
|         if(length(buf) > 8192) { | ||||
|             printf "%s", buf | ||||
|             buf = "" | ||||
|         } | ||||
|     } | ||||
|     END{ printf "%s", buf }' | ||||
| } | ||||
| 
 | ||||
| if(! ~ $REQUEST_URI */index.rss) { | ||||
| 	cat $headers $template | template | ||||
| 	echo '</body></html>' | ||||
| 	exit | ||||
| } | ||||
| 
 | ||||
| # RSS | ||||
| if ( ~ $body */[bB]log/indexrss */[bB]log//indexrss && ~ $#blogDirs 0 ) | ||||
|     blogDirs = `{basename -d $body} | ||||
| 
 | ||||
| 
 | ||||
| uri = `{echo $uri | sed 's/indexrss$//'} | ||||
| uri=$baseuri$"uri | ||||
| 
 | ||||
| fn statpost { | ||||
| 	f = $1 | ||||
| 	uri = `{echo $f | sed 's,^'$sitedir',,'} | ||||
|  | @ -196,30 +223,6 @@ fn statpost { | |||
| 	} | ||||
| } | ||||
| 
 | ||||
| fn template { | ||||
|     template.awk | rc $rcargs | | ||||
|     awk '{ | ||||
|         buf = buf $0"\n" | ||||
|         if(length(buf) > 8192) { | ||||
|             printf "%s", buf | ||||
|             buf = "" | ||||
|         } | ||||
|     } | ||||
|     END{ printf "%s", buf }' | ||||
| } | ||||
| 
 | ||||
| if(! ~ $REQUEST_URI */index.rss) { | ||||
| 	cat $headers $template | template | ||||
| 	exit | ||||
| } | ||||
| 
 | ||||
| if ( ~ $body */[bB]log/indexrss */[bB]log//indexrss && ~ $#blogDirs 0 ) | ||||
|     blogDirs = `{basename -d $body} | ||||
| 
 | ||||
| 
 | ||||
| uri = `{echo $uri | sed 's/indexrss$//'} | ||||
| uri=$baseuri$"uri | ||||
| 
 | ||||
| # Should be in a separate file. | ||||
| cat <<'!' | template | ||||
| Content-Type: text/xml; charset=utf-8 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Uriel
						Uriel