Skip to content

Commit

Permalink
Add trailing slash to files resources for proper operation on HTML fi…
Browse files Browse the repository at this point in the history
…les with subresources
  • Loading branch information
benoit74 committed Sep 23, 2024
1 parent 2d83b2b commit 3b77122
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions scraper/src/kolibri2zim/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ def add_video_node(self, node_id):
)
with self.creator_lock:
self.creator.add_item_for(
path=f"files/{node['slug']}",
path=f"files/{node['slug']}/",
title=node["title"],
content=html,
mimetype="text/html",
Expand Down Expand Up @@ -670,7 +670,7 @@ def add_audio_node(self, node_id):
)
with self.creator_lock:
self.creator.add_item_for(
path=f"files/{node['slug']}",
path=f"files/{node['slug']}/",
title=node["title"],
content=html,
mimetype="text/html",
Expand Down Expand Up @@ -749,7 +749,7 @@ def add_exercise_node(self, node_id):
)
with self.creator_lock:
self.creator.add_item_for(
path=f"files/{node['slug']}",
path=f"files/{node['slug']}/",
title=node["title"],
content=html,
mimetype="text/html",
Expand Down Expand Up @@ -829,7 +829,7 @@ def get_is_epub(file):
**node,
)
with self.creator_lock:
path = f"files/{node['slug']}"
path = f"files/{node['slug']}/"
if is_alt:
path += "_alt"
self.creator.add_item_for(
Expand Down Expand Up @@ -872,7 +872,7 @@ def add_html5_node(self, node_id):
path=(
f"files/{node['slug']}/{ark_member}"
if ark_member != "index.html"
else f"files/{node['slug']}"
else f"files/{node['slug']}/"
),
content=zip_ark.open(ark_member).read(),
is_front=(ark_member == "index.html"),
Expand All @@ -898,7 +898,7 @@ def add_html5_node(self, node_id):
path=(
f"files/{node['slug']}/{ark_member}"
if ark_member != "index.html"
else f"files/{node['slug']}"
else f"files/{node['slug']}/"
),
target_path=f"html5_files/{content_hash}",
is_front=ark_member == "index.html",
Expand Down
10 changes: 5 additions & 5 deletions zimui/src/components/TopicCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ defineProps({
</div>

<div v-else class="card">
<a class="text-decoration-none text-reset" :href="`./files/${data.slug}`">
<a class="text-decoration-none text-reset" :href="`./files/${data.slug}/`">
<img
v-if="data.thumbnail"
class="card-img-top"
Expand Down Expand Up @@ -107,13 +107,13 @@ defineProps({
transform: translateY(-50%);
}
.card-body{
.card-body {
padding: 15px 15px 30px 15px;
}
.card-img-top {
border-radius: 1rem 1rem 0 0;
width: 100%;
width: 100%;
}
.badge {
Expand All @@ -128,7 +128,7 @@ defineProps({
.badge-wrapper {
position: absolute;
bottom: 15px;
bottom: 15px;
left: 10px;
}
Expand Down Expand Up @@ -164,7 +164,7 @@ defineProps({
-webkit-box-orient: vertical;
}
.text-decoration-none{
.text-decoration-none {
display: flex;
flex-direction: column;
height: 100%;
Expand Down

0 comments on commit 3b77122

Please sign in to comment.