Skip to content

Dewikification: Content app improvements.#468

Merged
kosayoda merged 13 commits into
dewikificationfrom
content-app-improvements
Apr 3, 2021
Merged

Dewikification: Content app improvements.#468
kosayoda merged 13 commits into
dewikificationfrom
content-app-improvements

Conversation

@kosayoda
Copy link
Copy Markdown
Contributor

Simplifications

  • Metadata for categories now use title as the key to match page metadata, previously it was name.
  • Rather than having two separate keys for the Font Awesome icon class and icon, it is now under icon.

Structure enhancements

This PR adds a way to have a path be both a category and a page. This is useful for places like /contributing, where https://pythondiscord.com/pages/contributing/ is a rendered page while still being a category for https://pythondiscord.com/pages/contributing/sir-lancebot/ and the like.

Markdown additions

Certain markdown-to-html additions were made to enable feature parity with the current wiki-ed site guides, but without the article writer needing to write HTML.

Specifically, these features are added:

  • Image captions
    image
  • Table of contents
    image

Make category `title` consistent with page `title`.
Simplify `icon` key, since there is no benefit to defining the icon
class and the icon separately.
Allow overriding the `icon` for category entries just like page entries.
This is useful for our /contributing pages, which have a main
contributing page at /contributing but project pages under the same
path, /contributing/bot etc.
Adds image caption capabilities and documents missing HTML extensions
available.
@kosayoda kosayoda added type: feature New feature or request priority: 1 - high High Priority labels Mar 29, 2021
@kosayoda kosayoda requested a review from a team as a code owner March 29, 2021 10:20
@kosayoda kosayoda requested review from dementati and eivl March 29, 2021 10:20
@kosayoda
Copy link
Copy Markdown
Contributor Author

tfw when you do everything except update tests

@kosayoda kosayoda requested a review from MarkKoz March 29, 2021 13:05
Comment thread pydis_site/apps/content/resources/guides/pydis-guides/how-to-contribute-a-page.md Outdated
Comment thread pydis_site/apps/content/resources/guides/pydis-guides/how-to-contribute-a-page.md Outdated

In the above example, `www.pythondiscord.com/guides/` will list `Contributing` as a category entry with information from `contributing/_info.yml`.

However, `www.pythondiscord.com/guides/contributing` will render `contributing.md` rather than show the category contents, so *it is the article's responsibility to link to any subpages under the article*.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you considered any way to show the direct children, or even all children? Perhaps a dropdown menu somewhere, like near the breadcrumbs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have. Since I'm just trying to get feature parity with the current site, I'll open a separate issue for this so the app can move along.

Copy link
Copy Markdown
Contributor Author

@kosayoda kosayoda Apr 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plot twist: I did it anyways since it's not a big change. The dropdown only shows up on category-page-hybrids and look and function similar to the one shown on the current site when you're logged in.

The differences are that it only shows direct children, since any sub-categories show their children on their page anyway, and that the dropdown is click-toggled and not hover-toggled to be mobile-friendly.

@kosayoda
Copy link
Copy Markdown
Contributor Author

kosayoda commented Apr 1, 2021

Just realized there's a logic error in the category page path, will fix.

@kosayoda kosayoda force-pushed the content-app-improvements branch from 22d6dbb to ffad966 Compare April 1, 2021 10:09
kosayoda added 4 commits April 1, 2021 19:11
This only shows when the page is also a category, since regular pages
have no children and regular categories already list their children.
This was causing mysterious 404s because while migrating a feature to
dewikification, the same variable would be placed in the settings file.
Comment thread pydis_site/templates/content/dropdown.html Outdated
Comment thread pydis_site/apps/content/views/page_category.py Outdated
This allows us to keep filenames (thus URLs) as concise as possible,
while having a more descriptive entry in the Sub-Articles dropdown for
category pages.
@kosayoda kosayoda merged commit f822d4f into dewikification Apr 3, 2021
@kosayoda kosayoda deleted the content-app-improvements branch April 3, 2021 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: 1 - high High Priority type: feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants