diff --git a/src/wikimore/app.py b/src/wikimore/app.py index 463171c..cc47899 100644 --- a/src/wikimore/app.py +++ b/src/wikimore/app.py @@ -315,6 +315,11 @@ def wiki_article( for video in soup.find_all("video"): 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"): if any(cls in li.get("class", []) for cls in ["nv-view", "nv-talk", "nv-edit"]): li.decompose() diff --git a/src/wikimore/static/css/style.css b/src/wikimore/static/css/style.css index 49ff30c..e609922 100644 --- a/src/wikimore/static/css/style.css +++ b/src/wikimore/static/css/style.css @@ -206,6 +206,12 @@ h1 { text-align: center; } +.category-link { + display: inline; + margin-right: 5px; + font-size: 0.8em; +} + /* General table styling */ .table { margin: 1em auto;