Personal build of stagit static git page generator.
log | files | refs | readme | license

0001-initial.patch (3026B)

      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
    100
    101
    102
    103
    104
    105
    106
    107
    108
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..61ad020
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+*.o
+stagit
+stagit-index
diff --git a/example_create.sh b/example_create.sh
index 24bcec5..cbf4cfc 100755
--- a/example_create.sh
+++ b/example_create.sh
@@ -16,22 +16,20 @@
 # - sh example_create.sh
 
 # path must be absolute.
-reposdir="/var/www/domains/git.codemadness.nl/home/src"
+reposdir="/home/git"
 curdir="$(pwd)"
 
 # make index.
-stagit-index "${reposdir}/"*/ > "${curdir}/index.html"
+stagit-index "${reposdir}/pub/"*/ > "${curdir}/index.html"
 
 # make files per repo.
-for dir in "${reposdir}/"*/; do
-	# strip .git suffix.
-	r=$(basename "${dir}")
+for dir in "${reposdir}/pub/"*/; do
 	d=$(basename "${dir}" ".git")
 	printf "%s... " "${d}"
 
 	mkdir -p "${curdir}/${d}"
 	cd "${curdir}/${d}" || continue
-	stagit -c ".cache" -u "https://git.codemadness.nl/$d/" "${reposdir}/${r}"
+	stagit -c ".cache" -u "https://git.skec.site/$d/" "${reposdir}/pub/${d}"
 
 	# symlinks
 	ln -sf log.html index.html
diff --git a/example_post-receive.sh b/example_post-receive.sh
index 5e8d32b..696344d 100755
--- a/example_post-receive.sh
+++ b/example_post-receive.sh
@@ -19,9 +19,9 @@ fi
 
 # config
 # paths must be absolute.
-reposdir="/home/src/src"
-dir="${reposdir}/${name}"
-htmldir="/home/www/domains/git.codemadness.org/htdocs"
+reposdir="/home/git"
+dir="${reposdir}/pub/${name}"
+htmldir="/var/www/htdocs/git.skec.site"
 stagitdir="/"
 destdir="${htmldir}${stagitdir}"
 cachefile=".htmlcache"
@@ -35,24 +35,24 @@ cd "${dir}" || exit 1
 
 # detect git push -f
 force=0
-while read -r old new ref; do
-	test "${old}" = "0000000000000000000000000000000000000000" && continue
-	test "${new}" = "0000000000000000000000000000000000000000" && continue
-
-	hasrevs=$(git rev-list "${old}" "^${new}" | sed 1q)
-	if test -n "${hasrevs}"; then
-		force=1
-		break
-	fi
-done
+# TODO: fix
+#while read -r old new ref; do
+#	test "${old}" = "0000000000000000000000000000000000000000" && continue
+#	test "${new}" = "0000000000000000000000000000000000000000" && continue
+#
+#	hasrevs=$(git rev-list "${old}" "^${new}" | sed 1q)
+#	if test -n "${hasrevs}"; then
+#		force=1
+#		break
+#	fi
+#done
 
 # strip .git suffix.
-r=$(basename "${name}")
 d=$(basename "${name}" ".git")
 printf "[%s] stagit HTML pages... " "${d}"
 
-mkdir -p "${destdir}/${d}"
-cd "${destdir}/${d}" || exit 1
+mkdir -p "${destdir}/pub/${d}"
+cd "${destdir}/pub/${d}" || exit 1
 
 # remove commits and ${cachefile} on git push -f, this recreated later on.
 if test "${force}" = "1"; then
@@ -61,10 +61,10 @@ if test "${force}" = "1"; then
 fi
 
 # make index.
-stagit-index "${reposdir}/"*/ > "${destdir}/index.html"
+stagit-index "${reposdir}/pub/"*/ > "${destdir}/index.html"
 
 # make pages.
-stagit -c "${cachefile}" -u "https://git.codemadness.nl/$d/" "${reposdir}/${r}"
+stagit -c "${cachefile}" -u "https://git.skec.site/pub/${d}/" "${reposdir}/pub/${d}"
 
 ln -sf log.html index.html
 ln -sf ../style.css style.css