mirror of
https://github.com/YGGverse/btracker.git
synced 2026-03-31 17:15:31 +00:00
remove print_version option, apply crate version to css
This commit is contained in:
parent
70c0174fbc
commit
5ba9a95f6e
3 changed files with 4 additions and 12 deletions
|
|
@ -42,10 +42,6 @@ pub struct Config {
|
||||||
#[arg(long, default_value_t = 20)]
|
#[arg(long, default_value_t = 20)]
|
||||||
pub list_limit: usize,
|
pub list_limit: usize,
|
||||||
|
|
||||||
/// Show crate version in the catalog (tooltip to the GitHub link)
|
|
||||||
#[arg(long, default_value_t = true)]
|
|
||||||
pub print_version: bool,
|
|
||||||
|
|
||||||
/// Default capacity (estimated torrents in the `preload` directory)
|
/// Default capacity (estimated torrents in the `preload` directory)
|
||||||
#[arg(long, default_value_t = 1000)]
|
#[arg(long, default_value_t = 1000)]
|
||||||
pub capacity: usize,
|
pub capacity: usize,
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ pub struct Meta {
|
||||||
pub title: String,
|
pub title: String,
|
||||||
/// * use vector to keep the order from the arguments list
|
/// * use vector to keep the order from the arguments list
|
||||||
pub trackers: Option<Vec<Url>>,
|
pub trackers: Option<Vec<Url>>,
|
||||||
pub version: Option<String>,
|
pub version: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("/?<page>")]
|
#[get("/?<page>")]
|
||||||
|
|
@ -140,11 +140,7 @@ fn rocket() -> _ {
|
||||||
format_time: config.format_time,
|
format_time: config.format_time,
|
||||||
title: config.title,
|
title: config.title,
|
||||||
trackers: config.tracker,
|
trackers: config.tracker,
|
||||||
version: if config.print_version {
|
version: env!("CARGO_PKG_VERSION").into(),
|
||||||
Some(env!("CARGO_PKG_VERSION").into())
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
.mount("/", FileServer::from(config.statics))
|
.mount("/", FileServer::from(config.statics))
|
||||||
.mount("/", routes![index, rss])
|
.mount("/", routes![index, rss])
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
{% if meta.description %}
|
{% if meta.description %}
|
||||||
<meta name="description" content="{{ meta.description }}" />
|
<meta name="description" content="{{ meta.description }}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<link rel="stylesheet" type="text/css" href="/theme/default.css?v=1" />
|
<link rel="stylesheet" type="text/css" href="/theme/default.css?v={{ meta.version }}" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
</main>
|
</main>
|
||||||
<footer>
|
<footer>
|
||||||
<a href="/rss">RSS</a> |
|
<a href="/rss">RSS</a> |
|
||||||
<a href="https://github.com/yggverse/btracker" title="{% if meta.version %}v{{ meta.version }}{% endif %}">GitHub</a>
|
<a href="https://github.com/yggverse/btracker" title="v{{ meta.version }}">GitHub</a>
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue