forked from PrivateCoffee/wikimore
feat: enhance category links display and functionality
Transformed specific 'link' elements into anchor tags with improved styling for better readability and usability. Added CSS styling for category links to ensure they are displayed inline with appropriate spacing, improving the user experience.
This commit is contained in:
parent
f1b5b81050
commit
f91ccba437
2 changed files with 11 additions and 0 deletions
|
@ -315,6 +315,11 @@ def wiki_article(
|
||||||
for video in soup.find_all("video"):
|
for video in soup.find_all("video"):
|
||||||
video["poster"] = get_proxy_url(video["poster"])
|
video["poster"] = get_proxy_url(video["poster"])
|
||||||
|
|
||||||
|
for link in soup.find_all("link", rel="mw:PageProp/Category"):
|
||||||
|
link.name = "a"
|
||||||
|
link.string = link["href"][2:].replace("_", " ")
|
||||||
|
link["class"] = "category-link"
|
||||||
|
|
||||||
for li in soup.find_all("li"):
|
for li in soup.find_all("li"):
|
||||||
if any(cls in li.get("class", []) for cls in ["nv-view", "nv-talk", "nv-edit"]):
|
if any(cls in li.get("class", []) for cls in ["nv-view", "nv-talk", "nv-edit"]):
|
||||||
li.decompose()
|
li.decompose()
|
||||||
|
|
|
@ -206,6 +206,12 @@ h1 {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.category-link {
|
||||||
|
display: inline;
|
||||||
|
margin-right: 5px;
|
||||||
|
font-size: 0.8em;
|
||||||
|
}
|
||||||
|
|
||||||
/* General table styling */
|
/* General table styling */
|
||||||
.table {
|
.table {
|
||||||
margin: 1em auto;
|
margin: 1em auto;
|
||||||
|
|
Loading…
Reference in a new issue