diff --git a/src/Vervis/Web/Darcs.hs b/src/Vervis/Web/Darcs.hs index 6f0dea0..835294b 100644 --- a/src/Vervis/Web/Darcs.hs +++ b/src/Vervis/Web/Darcs.hs @@ -48,9 +48,11 @@ import qualified Data.Text.Lazy.Encoding as L (decodeUtf8With) import Data.MediaType import Development.PatchMediaType +import Network.FedURI import Yesod.ActivityPub import Yesod.FedURI import Yesod.Hashids +import Yesod.MonadSite import Yesod.RenderSource import qualified Web.ActivityPub as AP @@ -90,6 +92,7 @@ getDarcsRepoSource repository actor repo dir = do let parent = if null dir then [] else init dir dirs = zip parent (tail $ inits parent) defaultLayout $ do + host <- asksSite siteInstanceHost ms <- lookupGetParam "style" style <- case ms of diff --git a/src/Vervis/Web/Git.hs b/src/Vervis/Web/Git.hs index 1c1cbd1..88691a6 100644 --- a/src/Vervis/Web/Git.hs +++ b/src/Vervis/Web/Git.hs @@ -59,9 +59,11 @@ import qualified Data.Text as T import qualified Data.Text.Lazy.Encoding as L (decodeUtf8With) import Data.MediaType +import Network.FedURI import Yesod.ActivityPub import Yesod.FedURI import Yesod.Hashids +import Yesod.MonadSite import Yesod.RenderSource import qualified Web.ActivityPub as AP @@ -105,6 +107,7 @@ getGitRepoSource repository actor repo ref dir = do let parent = if null dir then [] else init dir dirs = zip parent (tail $ inits parent) defaultLayout $ do + host <- asksSite siteInstanceHost ms <- lookupGetParam "style" style <- case ms of diff --git a/templates/repo/source-darcs.hamlet b/templates/repo/source-darcs.hamlet index 3c561f0..150b4eb 100644 --- a/templates/repo/source-darcs.hamlet +++ b/templates/repo/source-darcs.hamlet @@ -57,7 +57,12 @@ $# ^{personNavW user}
darcs clone @{RepoR repo}
+
+ HTTPS:
+ darcs clone @{RepoR repo}
+
+ SSH:
+ darcs clone USERNAME@#{renderAuthority host}:#{keyHashidText repo}
Tags
diff --git a/templates/repo/source-git.hamlet b/templates/repo/source-git.hamlet
index 09676c9..3e5831b 100644
--- a/templates/repo/source-git.hamlet
+++ b/templates/repo/source-git.hamlet
@@ -57,7 +57,12 @@ $# ^{personNavW user}
Clone
-git clone @{RepoR repo}
+
+ HTTPS:
+ git clone @{RepoR repo}
+
+ SSH:
+ git clone USERNAME@#{renderAuthority host}:#{keyHashidText repo}
Branches