Made links into directories containing index.html

Christopher Vollick [2010-03-21 01:15]
Made links into directories containing index.html

Ok, so, this is kind of a huge hack...
Filename
gitsite
diff --git a/gitsite b/gitsite
index fe594e6..cabeaba 100755
--- a/gitsite
+++ b/gitsite
@@ -95,11 +95,17 @@ for index in $(seq 1 $numArticles); do
 	# Now, run the article template on the content.
 	templates/article Content "|$tmpArticleDir/$title" Title "$title" NextTitle "$next" NextLink "$nextLink" PreviousTitle "$prev" PreviousLink "$prevLink" CreationDate "$published" ModificationDate "$modified" ID "$id" Self "$self" > "$tmpArticleTemplateDir/$title"

+	# Make the destination dir
+	mkdir -p "$articleDestDir/${encTitle}"
+
 	# Finish off with the site template
-	templates/site Content "|$tmpArticleTemplateDir/$title" Title "$title" NextTitle "$next" NextLink "$nextLink" PreviousTitle "$prev" PreviousLink "$prevLink" CreationDate "$published" ModificationDate "$modified" ID "$id" Self "$self" > "$articleDestDir/${encTitle}"
+	templates/site Content "|$tmpArticleTemplateDir/$title" Title "$title" NextTitle "$next" NextLink "$nextLink" PreviousTitle "$prev" PreviousLink "$prevLink" CreationDate "$published" ModificationDate "$modified" ID "$id" Self "$self" > "$articleDestDir/${encTitle}/index.html"
+
+	# Make the permalink dir
+	mkdir -p "$idDestDir/$id"

 	# And make a permalink
-	ln -f "$articleDestDir/$encTitle" "$idDestDir/$id"
+	ln -f "$articleDestDir/$encTitle/index.html" "$idDestDir/$id/index.html"

 	# If this article is within the first feedNum, run it through there.
 	if [ "$index" -le "$feedNum" ]; then
@@ -116,7 +122,7 @@ done
 templates/atom-feed Content "|$tmpAtom" > "$absDestDir/feed.atom"

 # And the index page
-templates/site Title "Home Page" Content "$(templates/index Content "|$tmpIndex")"  > "$absDestDir/index"
+templates/site Title "Home Page" Content "$(templates/index Content "|$tmpIndex")"  > "$absDestDir/index.html"

 rm -rf "$tmpDir"
ViewGit