mirror of
https://github.com/freedit-org/freedit.git
synced 2026-04-25 03:05:37 -04:00
feature: prepare to deploy to github page
This commit is contained in:
@@ -66,11 +66,18 @@ pub(super) async fn router(db: Db) -> Router {
|
||||
.route("/solo/:sid/like", get(solo_like))
|
||||
.route("/solo/:sid/delete", get(solo_delete))
|
||||
.layer(Extension(db))
|
||||
.route("/css/style.css", get(style))
|
||||
.route("/health_check", get(health_check))
|
||||
.nest("/avatars", serve_dir(&CONFIG.avatars_path).await)
|
||||
.nest("/inn_icons", serve_dir(&CONFIG.inn_icons_path).await)
|
||||
.nest("/static/", serve_dir(&CONFIG.html_path).await);
|
||||
.route("/static/style.css", get(style))
|
||||
.nest("/static/avatars", serve_dir(&CONFIG.avatars_path).await)
|
||||
.nest("/static/inn_icons", serve_dir(&CONFIG.inn_icons_path).await)
|
||||
.nest(
|
||||
"/static/inn",
|
||||
serve_dir(&format!("{}/inn", &CONFIG.html_path)).await,
|
||||
)
|
||||
.nest(
|
||||
"/static/post",
|
||||
serve_dir(&format!("{}/post", &CONFIG.html_path)).await,
|
||||
);
|
||||
|
||||
for (path, dir, _) in &CONFIG.serve_dir {
|
||||
let path = format!("/{}", path);
|
||||
|
||||
@@ -283,17 +283,8 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) async fn home(
|
||||
Extension(db): Extension<Db>,
|
||||
cookie: Option<TypedHeader<Cookie>>,
|
||||
) -> Result<impl IntoResponse, AppError> {
|
||||
let site_config = get_site_config(&db)?;
|
||||
let claim = cookie.and_then(|cookie| Claim::get(&db, &cookie, &site_config));
|
||||
if claim.is_some() {
|
||||
Ok(Redirect::to("/inn/0"))
|
||||
} else {
|
||||
Ok(Redirect::to("/static/inn/0/1.html"))
|
||||
}
|
||||
pub(crate) async fn home() -> impl IntoResponse {
|
||||
Redirect::to("/inn/0")
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<div class="list-item">
|
||||
<div class="list-item-image">
|
||||
<figure class="image is-48x48">
|
||||
<p><a href="/user/{{post.uid}}" title="{{post.username}}"><img src="/avatars/{{post.uid}}.png"></a></p>
|
||||
<p><a href="/user/{{post.uid}}" title="{{post.username}}"><img src="/static/avatars/{{post.uid}}.png"></a></p>
|
||||
</figure>
|
||||
</div>
|
||||
<div class="list-item-content">
|
||||
@@ -138,7 +138,7 @@
|
||||
<div class="box">
|
||||
<div class="level-item has-text-centered">
|
||||
<figure class="image is-64x64">
|
||||
<a href="/inn/{{iid}}"><img class="is-rounded" src="/inn_icons/{{iid}}.png"></a>
|
||||
<a href="/inn/{{iid}}"><img class="is-rounded" src="/static/inn_icons/{{iid}}.png"></a>
|
||||
</figure>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="field-label is-normal">
|
||||
<label class="label">
|
||||
<figure class="image is-128x128 ml-0">
|
||||
<img class="is-rounded" src="/inn_icons/{{inn.iid}}.png">
|
||||
<img class="is-rounded" src="/static/inn_icons/{{inn.iid}}.png">
|
||||
</figure>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
{% if page_data.claim.is_some() %}
|
||||
<div class="list-item-image">
|
||||
<figure class="image is-64x64">
|
||||
<a href="/inn/{{inn.iid}}"><img class="is-rounded" src="/inn_icons/{{inn.iid}}.png"></a>
|
||||
<a href="/inn/{{inn.iid}}"><img class="is-rounded" src="/static/inn_icons/{{inn.iid}}.png"></a>
|
||||
</figure>
|
||||
</div>
|
||||
<div class="list-item-content">
|
||||
@@ -67,7 +67,7 @@
|
||||
{% else %}
|
||||
<div class="list-item-image">
|
||||
<figure class="image is-64x64">
|
||||
<a href="/static/inn/{{inn.iid}}/1.html"><img class="is-rounded" src="/inn_icons/{{inn.iid}}.png"></a>
|
||||
<a href="/static/inn/{{inn.iid}}/1.html"><img class="is-rounded" src="/static/inn_icons/{{inn.iid}}.png"></a>
|
||||
</figure>
|
||||
</div>
|
||||
<div class="list-item-content">
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<div class="list-item">
|
||||
<div class="list-item-image">
|
||||
<figure class="image is-48x48">
|
||||
<p><a href="/user/{{post.uid}}" title="{{post.username}}"><img src="/avatars/{{post.uid}}.png"></a></p>
|
||||
<p><a href="/user/{{post.uid}}" title="{{post.username}}"><img src="/static/avatars/{{post.uid}}.png"></a></p>
|
||||
</figure>
|
||||
</div>
|
||||
<div class="list-item-content">
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="referrer" content="no-referrer">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" type="text/css" href="/css/style.css">
|
||||
<link rel="stylesheet" type="text/css" href="/static/style.css">
|
||||
<title> {{ page_data.title }} </title>
|
||||
</head>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
</a>
|
||||
<a href="/user/{{val.uid}}">
|
||||
<span class="icon is-large">
|
||||
<span class="image is-squre"><img src="/avatars/{{val.uid}}.png" alt="{{val.username}}"></span>
|
||||
<span class="image is-squre"><img src="/static/avatars/{{val.uid}}.png" alt="{{val.username}}"></span>
|
||||
</span>
|
||||
</a>
|
||||
{% else %}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<div class="list-item">
|
||||
<div class="list-item-image is-hidden-touch">
|
||||
<figure class="image is-48x48">
|
||||
<p><a href="/user/{{nt.uid}}" title="{{nt.username}}"><img src="/avatars/{{nt.uid}}.png"></a></p>
|
||||
<p><a href="/user/{{nt.uid}}" title="{{nt.username}}"><img src="/static/avatars/{{nt.uid}}.png"></a></p>
|
||||
</figure>
|
||||
</div>
|
||||
<div class="list-item-content">
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<div class="media-right">
|
||||
<figure>
|
||||
<p class="image is-48x48">
|
||||
<a href="/user/{{post.uid}}"><img src="/avatars/{{post.uid}}.png" alt="{{post.username}}"></a>
|
||||
<a href="/user/{{post.uid}}"><img src="/static/avatars/{{post.uid}}.png" alt="{{post.username}}"></a>
|
||||
</p>
|
||||
</figure>
|
||||
</div>
|
||||
@@ -86,7 +86,7 @@
|
||||
<div class="list-item" id="{{comment.cid}}">
|
||||
<div class="list-item-image">
|
||||
<figure class="image is-48x48">
|
||||
<a href="/user/{{comment.uid}}"><img src="/avatars/{{comment.uid}}.png"></a>
|
||||
<a href="/user/{{comment.uid}}"><img src="/static/avatars/{{comment.uid}}.png"></a>
|
||||
</figure>
|
||||
</div>
|
||||
<div class="list-item-content">
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<article class="media box">
|
||||
<figure class="media-left is-hidden-mobile">
|
||||
<p class="image is-64x64">
|
||||
<img src="/avatars/{{claim.uid}}.png">
|
||||
<img src="/static/avatars/{{claim.uid}}.png">
|
||||
</p>
|
||||
</figure>
|
||||
<div class="media-content">
|
||||
@@ -126,7 +126,7 @@
|
||||
<article class="media box">
|
||||
<figure class="media-left">
|
||||
<p class="image is-48x48">
|
||||
<a href="/user/{{solo.uid}}"><img src="/avatars/{{solo.uid}}.png"></a>
|
||||
<a href="/user/{{solo.uid}}"><img src="/static/avatars/{{solo.uid}}.png"></a>
|
||||
</p>
|
||||
</figure>
|
||||
<div class="media-content">
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<div class="list-item">
|
||||
<div class="list-item-image">
|
||||
<figure class="image is-48x48">
|
||||
<p><a href="/user/{{post.uid}}" title="{{post.username}}"><img src="/avatars/{{post.uid}}.png"></a></p>
|
||||
<p><a href="/user/{{post.uid}}" title="{{post.username}}"><img src="/static/avatars/{{post.uid}}.png"></a></p>
|
||||
</figure>
|
||||
</div>
|
||||
<div class="list-item-content">
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<article class="media box">
|
||||
<figure class="media-left">
|
||||
<p class="image is-64x64">
|
||||
<a href="/user/{{user.uid}}"><img class="image is-64x64" src="/avatars/{{user.uid}}.png"></a>
|
||||
<a href="/user/{{user.uid}}"><img class="image is-64x64" src="/static/avatars/{{user.uid}}.png"></a>
|
||||
</p>
|
||||
<p><small>role: {{user.role}}</small></p>
|
||||
<p><small>uid: {{user.uid}}</small></p>
|
||||
|
||||
@@ -24,19 +24,19 @@
|
||||
{% match filter.as_deref() %} {% when Some with ("followers") %}
|
||||
<figure>
|
||||
<p class="image is-48x48">
|
||||
<a href="/user/{{info.0}}"><img src="/avatars/{{info.0}}.png" alt="{{info.1}}"></a>
|
||||
<a href="/user/{{info.0}}"><img src="/static/avatars/{{info.0}}.png" alt="{{info.1}}"></a>
|
||||
</p>
|
||||
</figure>
|
||||
{% when Some with ("following") %}
|
||||
<figure>
|
||||
<p class="image is-48x48">
|
||||
<a href="/user/{{info.0}}"><img src="/avatars/{{info.0}}.png" alt="{{info.1}}"></a>
|
||||
<a href="/user/{{info.0}}"><img src="/static/avatars/{{info.0}}.png" alt="{{info.1}}"></a>
|
||||
</p>
|
||||
</figure>
|
||||
{% when Some with ("inn") %}
|
||||
<figure>
|
||||
<p class="image is-48x48">
|
||||
<a href="/inn/{{info.0}}"><img class="is-rounded" src="/inn_icons/{{info.0}}.png" alt="{{info.1}}"></a>
|
||||
<a href="/inn/{{info.0}}"><img class="is-rounded" src="/static/inn_icons/{{info.0}}.png" alt="{{info.1}}"></a>
|
||||
</p>
|
||||
</figure>
|
||||
{% else %}{% endmatch %}
|
||||
@@ -48,7 +48,7 @@
|
||||
<div class="list-item">
|
||||
<div class="list-item-image">
|
||||
<figure class="image is-64x64">
|
||||
<a href="/user/{{user.uid}}"><img src="/avatars/{{user.uid}}.png"></a>
|
||||
<a href="/user/{{user.uid}}"><img src="/static/avatars/{{user.uid}}.png"></a>
|
||||
</figure>
|
||||
</div>
|
||||
<div class="list-item-content">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="field-label is-normal">
|
||||
<label class="label">
|
||||
<figure class="image is-128x128 ml-0">
|
||||
<img src="/avatars/{{uid}}.png">
|
||||
<img src="/static/avatars/{{uid}}.png">
|
||||
</figure>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user