aboutsummaryrefslogtreecommitdiffstats
path: root/extra
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-03-25 13:50:40 +0000
committers-ol <s-ol@users.noreply.github.com>2020-03-25 13:50:40 +0000
commit42bea6ea126057e7b7db4256e34dd060d34b449c (patch)
treed3384c49cf3df452b0f67d24ea92b69d43110767 /extra
parentdocs/internals/extensions rename (diff)
downloadalive-42bea6ea126057e7b7db4256e34dd060d34b449c.tar.gz
alive-42bea6ea126057e7b7db4256e34dd060d34b449c.zip
docs: automatic release linking
Diffstat (limited to 'extra')
-rwxr-xr-xextra/git-version.sh14
-rw-r--r--extra/layout.moon8
2 files changed, 12 insertions, 10 deletions
diff --git a/extra/git-version.sh b/extra/git-version.sh
index 6530f43..7712b09 100755
--- a/extra/git-version.sh
+++ b/extra/git-version.sh
@@ -1,8 +1,8 @@
#!/bin/sh
TAG=`git describe --abbrev=0 HEAD`
-REV_SHORT=`git rev-parse --short HEAD`
-REV_LONG=`git rev-parse HEAD`
+# REV_SHORT=`git rev-parse --short HEAD`
+# REV_LONG=`git rev-parse HEAD`
cat <<EOF
----
@@ -13,15 +13,13 @@ cat <<EOF
--- exports
-- @table exports
-- @tfield string tag the last versions git tag
--- @tfield string rev_short the short git revision hash
--- @tfield string rev_long the full git revision hash
--- @tfield string repo the git repo URL
-- @tfield string web the repo web URL
+-- @tfield string repo the git repo URL
+-- @tfield string release the web URL of this release
{
tag: "${TAG}"
- rev_short: "${REV_SHORT}"
- rev_long: "${REV_LONG}"
+ web: "https://github.com/s-ol/alivecoding"
repo: "https://github.com/s-ol/alivecoding.git"
- web: "https://github.com/s-ol/alivecoding/releases/tag/${TAG}"
+ release: "https://github.com/s-ol/alivecoding/releases/tag/${TAG}"
}
EOF
diff --git a/extra/layout.moon b/extra/layout.moon
index 11ccc7f..e64b736 100644
--- a/extra/layout.moon
+++ b/extra/layout.moon
@@ -59,6 +59,10 @@ abs = (page) ->
-- entry is one of
-- builtin-name; mod.name/name; mod.name
link = (ref) ->
+ return version.web if ref == '*web*'
+ return version.repo if ref == '*repo*'
+ return version.release if ref == '*release*'
+
mod, sym = ref\match '^(.+)/(.*)$'
abs "reference/#{mod or 'index'}.html##{sym or ref}"
@@ -100,7 +104,7 @@ layout = (opts) ->
span {
b 'alive'
' '
- a (code version.tag), href: version.web
+ a (code version.tag), href: version.release
' documentation'
}
div class: 'grow'
@@ -116,7 +120,7 @@ layout = (opts) ->
"alive documentation"
foot = footer div {
'alive '
- a (code version.tag), href: version.web
+ a (code version.tag), href: version.release
', generated '
os.date '!%Y-%m-%d %T'
}