aboutsummaryrefslogtreecommitdiff
path: root/src/constants.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-03-09 18:55:39 -0800
committerFuwn <[email protected]>2022-03-09 18:55:39 -0800
commitd61504fd0f7cdc2eb9d315ea5450c773098e209a (patch)
treee750f545868d804c1b7ed11d81f0f814c549492d /src/constants.rs
parentformat(readme): case (diff)
downloadapi-worker-d61504fd0f7cdc2eb9d315ea5450c773098e209a.tar.xz
api-worker-d61504fd0f7cdc2eb9d315ea5450c773098e209a.zip
feat(index): git commit hash on index
Diffstat (limited to 'src/constants.rs')
-rw-r--r--src/constants.rs28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/constants.rs b/src/constants.rs
index 003fdf1..b5fb1e0 100644
--- a/src/constants.rs
+++ b/src/constants.rs
@@ -16,7 +16,27 @@
// Copyright (C) 2022-2022 Fuwn <[email protected]>
// SPDX-License-Identifier: GPL-3.0-only
-pub const GITHUB_USER_CONTENT: &str =
- "https://raw.githubusercontent.com/laynH/Anime-Girls-Holding-Programming-Books/master/";
-pub const GITHUB_API_ENDPOINT: &str = "https://api.github.com/repos/laynH/Anime-Girls-Holding-Progr\
-amming-Books/git/trees/master?recursive=1";
+use const_format::formatcp;
+
+lazy_static::lazy_static! {
+ pub static ref INDEX: String = {
+ format!(
+ include_str!("index.rst"),
+ format_args!(
+ "https://github.com/senpy-club/api-worker/tree/{}",
+ env!("GIT_COMMIT_HASH"),
+ )
+ )
+ };
+}
+
+const GITHUB_REPOSITORY: &str =
+ "cat-milk/Anime-Girls-Holding-Programming-Books";
+pub const GITHUB_USER_CONTENT: &str = formatcp!(
+ "https://raw.githubusercontent.com/{}/master/",
+ GITHUB_REPOSITORY
+);
+pub const GITHUB_API_ENDPOINT: &str = formatcp!(
+ "https://api.github.com/repos/{}/git/trees/master?recursive=1",
+ GITHUB_REPOSITORY,
+);