diff options
author | 2022-08-13 22:53:50 +0200 | |
---|---|---|
committer | 2022-08-13 22:53:50 +0200 | |
commit | f2ad3eed8ef8872713666f69ec783f59006d3d81 (patch) | |
tree | 77ce127c183b566a915a9e176ee2a748aa2f0a5d /pydis_site/apps/content/utils.py | |
parent | Enable Code Highlighting On All Content Pages (diff) |
Improve Tag Cropping
Move the tag cropping logic to the frontend, which makes it easier to
crop without crossing boundaries such as link or code block boundaries.
Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'pydis_site/apps/content/utils.py')
-rw-r--r-- | pydis_site/apps/content/utils.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/pydis_site/apps/content/utils.py b/pydis_site/apps/content/utils.py index 76437593..cc08f81f 100644 --- a/pydis_site/apps/content/utils.py +++ b/pydis_site/apps/content/utils.py @@ -131,14 +131,10 @@ def get_category_pages(path: Path) -> dict[str, dict]: tags = {} for tag in get_tags(): content = frontmatter.parse(tag.body)[1] - if len(content) > 100: - # Trim the preview to a maximum of 100 visible characters - # This causes some markdown to break, but we ignore that - content = content[:100] + "..." tags[tag.name] = { "title": tag.name, - "description": markdown.markdown(content), + "description": markdown.markdown(content, extensions=["pymdownx.superfences"]), "icon": "fas fa-tag" } |