aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/content/utils.py (follow)
Commit message (Collapse)AuthorAgeLines
* Update tarfile.extractall usage to be saferGravatar Joe Banks2025-07-27-1/+1
| | | | | Removes the DeprecationWarning we were receiving for using this method without specifying a suitable filter argument.
* Upsert tags in two queriesGravatar Johannes Christ2024-04-01-17/+14
| | | | | | | | | | | Before, we had an N+1 query, where each tag would be separately fetched and updated. Instead, first delete any tags we no longer care about, then perform an upsert of all fields except for `last_commit`, which we want to keep from the existing tag. This comes with one caveat: on the first update of the tags, the `tags` list is no longer modified in-place, because mutation is bad, however, the database state is updated accordingly.
* Appeased the linterGravatar Xithrius2024-02-01-1/+1
|
* Prevent loading related object when updating tagsGravatar Johannes Christ2023-12-15-2/+2
| | | | | We can simply save by the ID here, we do not need any other data from the related object.
* Soft fail for upstream error on fetching tag commitsGravatar Johannes Christ2023-07-27-3/+23
| | | | Closes #1053
* Use the new datetime.UTC alias over datetime.timezone.utcGravatar Chris Lovering2023-05-13-2/+2
|
* Switch to ruff for lintingGravatar Johannes Christ2023-05-10-7/+9
|
* Clarify Code IntentionsGravatar Hassan Abouelela2022-10-28-6/+6
| | | | Signed-off-by: Hassan Abouelela <[email protected]>
* Implicitly Close Client Using `with`Gravatar Hassan Abouelela2022-10-28-22/+19
| | | | Signed-off-by: Hassan Abouelela <[email protected]>
* Use `casefold` Instead Of `lower`Gravatar Hassan Abouelela2022-10-28-1/+1
| | | | Signed-off-by: Hassan Abouelela <[email protected]>
* Clean Up TypingGravatar Hassan Abouelela2022-10-28-6/+3
| | | | Signed-off-by: Hassan Abouelela <[email protected]>
* Update pydis_site/apps/content/utils.pyGravatar Hassan Abouelela2022-10-28-1/+1
| | | Co-authored-by: Johannes Christ <[email protected]>
* Rename Tag Model Author FieldGravatar Hassan Abouelela2022-08-23-4/+4
| | | | | | | Renames the tag model `author` field to `authors` to better indicate what's contained in the field, and updates the documentation. Signed-off-by: Hassan Abouelela <[email protected]>
* Support Hyperlinked Tag Group ReplacementGravatar Hassan Abouelela2022-08-23-2/+2
| | | | Signed-off-by: Hassan Abouelela <[email protected]>
* Fix Tests For Tag MetadataGravatar Hassan Abouelela2022-08-16-1/+1
| | | | Signed-off-by: Hassan Abouelela <[email protected]>
* Fix Tag Metadata For Static BuildsGravatar Hassan Abouelela2022-08-16-3/+12
| | | | Signed-off-by: Hassan Abouelela <[email protected]>
* Add Tag MetadataGravatar Hassan Abouelela2022-08-16-15/+109
| | | | | | | Uses the commit API to obtain tag metadata such as when it was last edited, and by whom. Signed-off-by: Hassan Abouelela <[email protected]>
* Update Tests For Tag GroupsGravatar Hassan Abouelela2022-08-14-1/+2
| | | | Signed-off-by: Hassan Abouelela <[email protected]>
* Add Tag Group SupportGravatar Hassan Abouelela2022-08-14-19/+82
| | | | | | | Adds support for tag groups in content. This involves some modification to the routing, and templating. Signed-off-by: Hassan Abouelela <[email protected]>
* Improve Tag CroppingGravatar Hassan Abouelela2022-08-13-5/+1
| | | | | | | 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]>
* Add Tag View TestsGravatar Hassan Abouelela2022-08-13-3/+3
| | | | Signed-off-by: Hassan Abouelela <[email protected]>
* Export Tag Model As Top Level Model ObjectGravatar Hassan Abouelela2022-08-13-1/+1
| | | | Signed-off-by: Hassan Abouelela <[email protected]>
* Add Tags To Content ListingsGravatar Hassan Abouelela2022-08-13-5/+120
| | | | | | | Adds bot tags to the content page, as well as a model to go along with it. Signed-off-by: Hassan Abouelela <[email protected]>
* Place category pages in the same directory as categories.Gravatar kosayoda2021-04-01-1/+2
|
* Allow adding a table of contents to a page.Gravatar kosayoda2021-03-29-3/+9
|
* Refactor content app tests.Gravatar kosayoda2021-03-25-1/+1
| | | | | | The tests uses pyfakefs to simulate a fake filesystem that is reused over the content app tests. Test coverage for the app is brought to 100%.
* Replace `markdown2` with `markdown` and `python-frontmatter`.Gravatar kosayoda2021-03-24-17/+15
| | | | | | This allows us to properly escape codeblocks within markdown, permalink to headers on a page, and decouples getting metadata from a file and getting generated HTML from the Markdown content.
* Simplify pathlib code and specify file encoding.Gravatar kosayoda2021-03-24-9/+9
|
* Improve variable and key names for page utils.Gravatar kosayoda2021-03-24-3/+3
|
* Improve phrasing and wording of documentation.Gravatar kosayoda2021-03-24-2/+2
|
* Propogate markdown language data to highlight.jsGravatar kosayoda2021-03-24-0/+1
|
* Simplify content app.Gravatar kosayoda2021-03-23-29/+13
| | | | | | | | | Rather than having two views for the base page and all other pages, all pages now use the same view. The view context handler is simplified to take advantage of pathlib features. The markdown folder is now /content/resources/* rather than /content/resources/content/*, as the latter is unnecessary nesting.
* Rename `articles` to `pages`.Gravatar kosayoda2021-03-23-18/+18
| | | | | | Articles was a good name, but we want an `articles` category in the future. `/pages/guides/` and `/pages/articles/` are clearer in name than `/articles/guides/` and `/articles/articles/`.
* Remove Github metadata feature.Gravatar kosayoda2021-03-23-38/+0
| | | | | This feature is still under implementation debate, so it will be further discussed in another issue and implemeneted in a future PR.
* Update utils to match with new unlimited categories systemGravatar ks1292020-11-28-29/+24
|
* Cover fetching article GitHub information with testsGravatar ks1292020-10-06-1/+1
|
* Implement fetching contributors and last modification date from GitHubGravatar ks1292020-10-06-1/+37
|
* Fix content app lintingGravatar ks1292020-10-05-2/+10
|
* Migrate content system from Python-Markdown to markdown2Gravatar ks1292020-10-05-8/+8
|
* Move from standard OS path actions to PathlibGravatar ks1292020-10-04-23/+19
|
* Change guides system to content systemGravatar ks1292020-10-04-0/+77
As this system will be used for more than just guides, I had to do some refactoring to match this system with plans. Basically now there isn't guides, but articles instead.