h: use a variable for where I am hosting go modules

This commit is contained in:
Aaron Bieber 2023-01-09 09:50:39 -07:00
parent da7ba4a734
commit c40c86b10e
No known key found for this signature in database

View File

@ -19,6 +19,7 @@ let
inherit pkgs;
inherit icbirc;
});
goModuleHost = "https://git.sr.ht/~qbit";
in {
_module.args.isUnstable = false;
@ -495,8 +496,8 @@ in {
add_header X-Content-Type-Options nosniff;
add_header Content-Type text/html;
return 200 '<html><head>
<meta name="go-import" content="$host/$1 git https://git.sr.ht/~qbit/$1">
<meta name="go-source" content="$host/$1 _ https://git.sr.ht/~qbit/$1/tree/master{/dir} https://git.sr.ht/~qbit/$1/tree/master{/dir}/{file}#L{line}">
<meta name="go-import" content="$host/$1 git ${goModuleHost}/$1">
<meta name="go-source" content="$host/$1 _ ${goModuleHost}/$1/tree/master{/dir} ${goModuleHost}/$1/tree/master{/dir}/{file}#L{line}">
<meta http-equiv="refresh" content="0; url=https://pkg.go.dev/mod/suah.dev/$1">
</head>
<body>
@ -511,8 +512,8 @@ in {
add_header X-Content-Type-Options nosniff;
add_header Content-Type text/html;
return 200 '<html><head>
<meta name="go-import" content="$host/$1 git https://git.sr.ht/~qbit/$1">
<meta name="go-source" content="$host/$1 _ https://git.sr.ht/~qbit/$1/tree/master{/dir} https://git.sr.ht/~qbit/$1/tree/master{/dir}/{file}#L{line}">
<meta name="go-import" content="$host/$1 git ${goModuleHost}/$1">
<meta name="go-source" content="$host/$1 _ ${goModuleHost}/$1/tree/master{/dir} ${goModuleHost}/$1/tree/master{/dir}/{file}#L{line}">
<meta http-equiv="refresh" content="0; url=https://pkg.go.dev/mod/suah.dev/$1">
</head>
<body>