Skip to content

Commit

Permalink
Merge pull request #1226 from python-discord/docs/suggest-resources
Browse files Browse the repository at this point in the history
Document how to add new resources
  • Loading branch information
ChrisLovering authored Mar 10, 2024
2 parents 721aabe + 4099c02 commit e39cbf3
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
35 changes: 30 additions & 5 deletions pydis_site/apps/resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,38 @@
This Django application powering the resources list [on our
website](https://www.pythondiscord.com/resources/).

## Directory structure

The main point of interest here lies in the `resources` directory: every
`.yaml` file in here represents a resource that is listed on our website. If
you are looking for the place to suggest new resources, said directory is the
place to create a new YAML file. In regards to the required keys and our
values, it's best to check the other files we have for a reference.
you are looking for the place to add new resources, said directory is the
place to create a new YAML file.

In regards to the required keys and our values, it's best to check the other
files we have for a reference.

Here are some general guidelines:

- The `description` text can include HTML elements, such as a simple bullet-list
to further describe the resource item. Markdown is not yet supported.

- If branding icons (like Goodreads or GitHub through the `icon` field under
`urls`) are included, set `color: dark` rather than `color: black` to ensure it
displays correctly in dark mode.

- For books, please include a link to the Goodreads URL under `urls`.

- If a logo is included, use `icon_image` rather than `title_image` to have the
logo display together next to the title (rather than replacing it). Unless
the logo includes the name of the resources that is clearly visible.

- All images used must be readable in both light and dark modes. If an image does
not suit both themes simultaneously, please include image URLs for each mode
separately using the optional `*_dark` keys:
- `icon_image`, `icon_image_dark`
- `title_image`, `title_image_dark`
- `title_icon`, `title_icon_dark`


## Directory structure

The app has a single view in `views.py` that takes care of reading the `.yaml`
file. This is a standard Django view, mounted in `urls.py` as usual.
Expand Down
6 changes: 6 additions & 0 deletions pydis_site/templates/resources/resources.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@
{% endfor %}
</nav>
</div>
<div class="content has-text-grey is-hidden-mobile">
<p>Want to suggest more resources? <a href="https://github.com/python-discord/meta/issues/new?assignees=&labels=area%3A+resources&projects=&template=resource-request.yaml">Open an issue on GitHub</a>.</p>
</div>
</div>

<div class="column is-two-thirds">
Expand All @@ -174,6 +177,9 @@ <h2 class="title is-3 has-text-centered pt-0 pb-6">No matching resources found!<
{% endfor %}
</div>
</div>
<div class="content has-text-grey is-hidden-tablet">
<p>Want to suggest more resources? <a href="https://github.com/python-discord/meta/issues/new?assignees=&labels=area%3A+resources&projects=&template=resource-request.yaml">Open an issue on GitHub</a>.</p>
</div>
</div>
</div>
</section>
Expand Down

0 comments on commit e39cbf3

Please sign in to comment.