diff options
Diffstat (limited to 'pydis_site')
121 files changed, 1768 insertions, 671 deletions
diff --git a/pydis_site/apps/api/models/bot/metricity.py b/pydis_site/apps/api/models/bot/metricity.py index 901f191a..abd25ef0 100644 --- a/pydis_site/apps/api/models/bot/metricity.py +++ b/pydis_site/apps/api/models/bot/metricity.py @@ -10,7 +10,7 @@ EXCLUDE_CHANNELS = ( ) -class NotFoundError(Exception): +class NotFoundError(Exception): # noqa: N818 """Raised when an entity cannot be found.""" pass diff --git a/pydis_site/apps/content/urls.py b/pydis_site/apps/content/urls.py index fe7c2852..f8496095 100644 --- a/pydis_site/apps/content/urls.py +++ b/pydis_site/apps/content/urls.py @@ -30,7 +30,7 @@ def __get_all_files(root: Path, folder: typing.Optional[Path] = None) -> list[st def get_all_pages() -> typing.Iterator[dict[str, str]]: - """Yield a dict of all pag categories.""" + """Yield a dict of all page categories.""" for location in __get_all_files(Path("pydis_site", "apps", "content", "resources")): yield {"location": location} diff --git a/pydis_site/apps/redirect/redirects.yaml b/pydis_site/apps/redirect/redirects.yaml index 9bcf3afd..dc8b9359 100644 --- a/pydis_site/apps/redirect/redirects.yaml +++ b/pydis_site/apps/redirect/redirects.yaml @@ -87,9 +87,45 @@ resources_index_redirect: original_path: pages/resources/ redirect_route: "resources:index" -resources_resources_redirect: - original_path: pages/resources/<str:category>/ - redirect_route: "resources:resources" +resources_reading_redirect: + original_path: resources/reading/ + redirect_route: "resources:index" + redirect_arguments: ["book"] + +resources_books_redirect: + original_path: resources/books/ + redirect_route: "resources:index" + redirect_arguments: [ "book" ] + +resources_videos_redirect: + original_path: resources/videos/ + redirect_route: "resources:index" + redirect_arguments: ["video"] + +resources_courses_redirect: + original_path: resources/courses/ + redirect_route: "resources:index" + redirect_arguments: ["course"] + +resources_communities_redirect: + original_path: resources/communities/ + redirect_route: "resources:index" + redirect_arguments: ["community"] + +resources_podcasts_redirect: + original_path: resources/podcasts/ + redirect_route: "resources:index" + redirect_arguments: ["podcast"] + +resources_tutorials_redirect: + original_path: resources/tutorials/ + redirect_route: "resources:index" + redirect_arguments: ["tutorial"] + +resources_tools_redirect: + original_path: resources/tools/ + redirect_route: "resources:index" + redirect_arguments: ["tool"] # Events events_index_redirect: diff --git a/pydis_site/apps/resources/resources/communities/adafruit.yaml b/pydis_site/apps/resources/resources/adafruit.yaml index e5c81a6c..f9466bd8 100644 --- a/pydis_site/apps/resources/resources/communities/adafruit.yaml +++ b/pydis_site/apps/resources/resources/adafruit.yaml @@ -4,12 +4,18 @@ description: Adafruit is an open-source electronics manufacturer provide help with your projects, and the Adafruit devs do all the CircuitPython Development right out in the open. title_image: https://www.mouser.com/images/suppliers/logos/adafruit.png -title_url: https://discord.gg/adafruit -position: 4 +title_url: https://adafruit.com/ urls: -- icon: branding/discord - url: https://discord.gg/adafruit - color: blurple -- icon: regular/link - url: https://adafruit.com/ - color: teal + - icon: branding/discord + url: https://discord.gg/adafruit + color: blurple +tags: + topics: + - microcontrollers + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - community diff --git a/pydis_site/apps/resources/resources/tools/editors/atom.yaml b/pydis_site/apps/resources/resources/atom.yaml index c44f9b5b..26e125b1 100644 --- a/pydis_site/apps/resources/resources/tools/editors/atom.yaml +++ b/pydis_site/apps/resources/resources/atom.yaml @@ -2,4 +2,13 @@ description: A free Electron-based editor, a "hackable text editor for the 21st by the GitHub team. name: Atom title_url: https://atom.io/ -position: 0 +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - tool diff --git a/pydis_site/apps/resources/resources/reading/books/automate_the_boring_stuff.yaml b/pydis_site/apps/resources/resources/automate_the_boring_stuff_book.yaml index 3812029c..63f63193 100644 --- a/pydis_site/apps/resources/resources/reading/books/automate_the_boring_stuff.yaml +++ b/pydis_site/apps/resources/resources/automate_the_boring_stuff_book.yaml @@ -4,11 +4,18 @@ description: One of the best books out there for Python beginners. This book wil the web, manipulating files and automating keyboard and mouse input. Ideal for an office worker who wants to make himself more useful. name: Automate the Boring Stuff with Python -position: 2 +title_url: https://automatetheboringstuff.com/ urls: -- icon: regular/book - url: https://automatetheboringstuff.com/ +- icon: branding/goodreads + url: https://www.goodreads.com/book/show/22514127-automate-the-boring-stuff-with-python color: black -- icon: branding/amazon - url: https://www.amazon.com/Automate-Boring-Stuff-Python-Programming/dp/1593275994/ - color: amazon-orange +tags: + topics: + - general + payment_tiers: + - free + - paid + difficulty: + - beginner + type: + - book diff --git a/pydis_site/apps/resources/resources/courses/automate_the_boring_stuff_with_python.yaml b/pydis_site/apps/resources/resources/automate_the_boring_stuff_course.yaml index 66034ea2..133033f7 100644 --- a/pydis_site/apps/resources/resources/courses/automate_the_boring_stuff_with_python.yaml +++ b/pydis_site/apps/resources/resources/automate_the_boring_stuff_course.yaml @@ -2,4 +2,13 @@ description: The interactive course version of Al Sweigart's excellent book for This link has a discounted version of the course which will always cost 10 dollars. Thanks, Al! name: Automate the Boring Stuff with Python title_url: https://www.udemy.com/automate/?couponCode=FOR_LIKE_10_BUCKS -position: 3 +tags: + topics: + - general + payment_tiers: + - paid + difficulty: + - beginner + type: + - course + - interactive diff --git a/pydis_site/apps/resources/resources/communities/awesome_programming_discord.yaml b/pydis_site/apps/resources/resources/awesome_programming_discord.yaml index 335ac507..0ef7aefc 100644 --- a/pydis_site/apps/resources/resources/communities/awesome_programming_discord.yaml +++ b/pydis_site/apps/resources/resources/awesome_programming_discord.yaml @@ -6,4 +6,13 @@ title_icon: branding/github title_icon_color: black title_url: https://github.com/mhxion/awesome-programming-discord name: awesome-programming-discord -position: 10 +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - community diff --git a/pydis_site/apps/resources/resources/reading/books/byte_of_python.yaml b/pydis_site/apps/resources/resources/byte_of_python.yaml index 2530c1a4..c2f6ab84 100644 --- a/pydis_site/apps/resources/resources/reading/books/byte_of_python.yaml +++ b/pydis_site/apps/resources/resources/byte_of_python.yaml @@ -2,14 +2,21 @@ description: A free book on programming using the Python language. It serves as a tutorial or guide to the Python language for a beginner audience. If all you know about computers is how to save text files, then this is the book for you. name: A Byte of Python -position: 1 +title_url: https://python.swaroopch.com/ urls: -- icon: regular/link - url: https://python.swaroopch.com/ - color: teal - icon: regular/book url: https://www.lulu.com/shop/swaroop-c-h/a-byte-of-python/paperback/product-21142968.html color: black -- icon: branding/amazon - url: https://www.amazon.com/Byte-Python-Swaroop-C-H-ebook/dp/B00FJ7S2JU/ - color: amazon-orange +- icon: branding/goodreads + url: https://www.goodreads.com/book/show/6762544-a-byte-of-python + color: black +tags: + topics: + - general + payment_tiers: + - free + - paid + difficulty: + - beginner + type: + - book diff --git a/pydis_site/apps/resources/resources/interactive/code_combat.yaml b/pydis_site/apps/resources/resources/code_combat.yaml index 30f20c28..84597c4d 100644 --- a/pydis_site/apps/resources/resources/interactive/code_combat.yaml +++ b/pydis_site/apps/resources/resources/code_combat.yaml @@ -1,11 +1,20 @@ description: Learn Python while gaming - an open-source project with thousands of contributors, which teaches you Python through a deep, top-down RPG. name: Code Combat -position: 0 +title_url: https://codecombat.com/ urls: -- icon: regular/link - url: https://codecombat.com/ - color: teal - icon: branding/github url: https://github.com/codecombat/codecombat color: black +tags: + topics: + - general + - algorithms and data structures + payment_tiers: + - free + - subscription + difficulty: + - beginner + - intermediate + type: + - interactive diff --git a/pydis_site/apps/resources/resources/communities/_category_info.yaml b/pydis_site/apps/resources/resources/communities/_category_info.yaml deleted file mode 100644 index b9cb6533..00000000 --- a/pydis_site/apps/resources/resources/communities/_category_info.yaml +++ /dev/null @@ -1,2 +0,0 @@ -description: Partnered communities that share part of our mission. -name: Communities diff --git a/pydis_site/apps/resources/resources/communities/django.yaml b/pydis_site/apps/resources/resources/communities/django.yaml deleted file mode 100644 index 0ef729ba..00000000 --- a/pydis_site/apps/resources/resources/communities/django.yaml +++ /dev/null @@ -1,13 +0,0 @@ -description: Django is a high-level Python web framework that encourages rapid development and clean, - pragmatic design. Built by experienced developers, it takes care of much of the hassle of web development, - so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source. -title_image: https://static.djangoproject.com/img/logos/django-logo-positive.png -title_url: https://discord.gg/M9Mx3RvKM5 -position: 5 -urls: - - icon: branding/discord - url: https://discord.gg/M9Mx3RvKM5 - color: blurple - - icon: regular/link - url: https://www.djangoproject.com/ - color: teal diff --git a/pydis_site/apps/resources/resources/videos/corey_schafer.yaml b/pydis_site/apps/resources/resources/corey_schafer.yaml index a7cca18a..b73f4b5d 100644 --- a/pydis_site/apps/resources/resources/videos/corey_schafer.yaml +++ b/pydis_site/apps/resources/resources/corey_schafer.yaml @@ -9,11 +9,21 @@ description: 'Corey has a number of exceptionally high quality tutorial series Check out his channel for more video series! ' title_image: https://i.imgur.com/KIfWw3b.png -position: 0 +title_url: https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g urls: - - icon: branding/youtube - url: https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g - color: youtube-red - icon: regular/link url: https://coreyms.com/ color: teal +tags: + topics: + - general + - software design + - web development + - tooling + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - video diff --git a/pydis_site/apps/resources/resources/courses/_category_info.yaml b/pydis_site/apps/resources/resources/courses/_category_info.yaml deleted file mode 100644 index 948b48de..00000000 --- a/pydis_site/apps/resources/resources/courses/_category_info.yaml +++ /dev/null @@ -1,4 +0,0 @@ -description: Listing of best Python courses. -name: Courses -default_icon: regular/graduation-cap -default_icon_color: black diff --git a/pydis_site/apps/resources/resources/data_science_from_scratch.yaml b/pydis_site/apps/resources/resources/data_science_from_scratch.yaml new file mode 100644 index 00000000..86955fdb --- /dev/null +++ b/pydis_site/apps/resources/resources/data_science_from_scratch.yaml @@ -0,0 +1,22 @@ +description: Data Science from Scratch is a good introduction to data science for the complete beginner, and covers + some of the fundamentals of Python programming as well as the basic math, probability and statistics needed to get + started. While either edition of this book is useful for those with prior Python experience, complete beginners + should use the second edition, which contains more up-to-date code examples and better practices. +name: Data Science from Scratch +title_url: https://www.oreilly.com/library/view/data-science-from/9781492041122/ +urls: + - icon: branding/goodreads + url: https://www.goodreads.com/en/book/show/52059715-data-science-from-scratch + color: black + - icon: branding/github + url: https://github.com/joelgrus/data-science-from-scratch + color: black +tags: + topics: + - data science + payment_tiers: + - paid + difficulty: + - beginner + type: + - book diff --git a/pydis_site/apps/resources/resources/interactive/edublocks.yaml b/pydis_site/apps/resources/resources/edublocks.yaml index 7c6ca02b..3eaefc35 100644 --- a/pydis_site/apps/resources/resources/interactive/edublocks.yaml +++ b/pydis_site/apps/resources/resources/edublocks.yaml @@ -7,4 +7,12 @@ description: EduBlocks provides a simple drag and drop interface to help beginne and export the code to run on actual devices. name: EduBlocks title_url: https://edublocks.org/ -position: 5 +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + type: + - interactive diff --git a/pydis_site/apps/resources/resources/effective_python.yaml b/pydis_site/apps/resources/resources/effective_python.yaml new file mode 100644 index 00000000..b82fa0c3 --- /dev/null +++ b/pydis_site/apps/resources/resources/effective_python.yaml @@ -0,0 +1,21 @@ +description: A book that gives 90 best practices for writing excellent Python. Great + for intermediates. +name: Effective Python +title_url: https://effectivepython.com/ +urls: +- icon: branding/goodreads + url: https://www.goodreads.com/book/show/48566725-effective-python + color: black +- icon: branding/github + url: https://github.com/bslatkin/effectivepython + color: black +tags: + topics: + - general + - software design + payment_tiers: + - paid + difficulty: + - intermediate + type: + - book diff --git a/pydis_site/apps/resources/resources/interactive/exercism.yaml b/pydis_site/apps/resources/resources/exercism.yaml index 68b458d0..b8f53d72 100644 --- a/pydis_site/apps/resources/resources/interactive/exercism.yaml +++ b/pydis_site/apps/resources/resources/exercism.yaml @@ -3,11 +3,18 @@ description: Level up your programming skills with more than 2600 exercises acro where you can get your code reviewed for each solution you submit. The mentors will give you insightful advice to make you a better programmer. name: exercism.io -position: 1 +title_url: https://exercism.io/ urls: -- icon: regular/link - url: https://exercism.io/ - color: teal - icon: branding/github url: https://github.com/exercism/python color: black +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - interactive diff --git a/pydis_site/apps/resources/resources/flask_web_development.yaml b/pydis_site/apps/resources/resources/flask_web_development.yaml new file mode 100644 index 00000000..6905b2b4 --- /dev/null +++ b/pydis_site/apps/resources/resources/flask_web_development.yaml @@ -0,0 +1,21 @@ +description: A comprehensive Flask walkthrough that has you building a complete social + blogging application from scratch. +name: Flask Web Development +title_url: http://shop.oreilly.com/product/0636920031116.do +urls: +- icon: branding/goodreads + url: https://www.goodreads.com/book/show/18774655-flask-web-development + color: black +- icon: branding/github + url: https://github.com/miguelgrinberg/flasky + color: black +tags: + topics: + - web development + payment_tiers: + - paid + difficulty: + - beginner + - intermediate + type: + - book diff --git a/pydis_site/apps/resources/resources/fluent_python.yaml b/pydis_site/apps/resources/resources/fluent_python.yaml new file mode 100644 index 00000000..c22fd388 --- /dev/null +++ b/pydis_site/apps/resources/resources/fluent_python.yaml @@ -0,0 +1,21 @@ +description: A veritable tome of intermediate and advanced Python information. A must-read + for any Python professional. By far the most recommended book for intermediates. +name: Fluent Python +title_url: https://www.oreilly.com/library/view/fluent-python/9781491946237/ +urls: +- icon: branding/goodreads + url: https://www.goodreads.com/book/show/22800567-fluent-python + color: black +- icon: branding/github + url: https://github.com/fluentpython + color: black +tags: + topics: + - general + - software design + payment_tiers: + - paid + difficulty: + - intermediate + type: + - book diff --git a/pydis_site/apps/resources/resources/reading/tutorials/getting_started_with_kivy.yaml b/pydis_site/apps/resources/resources/getting_started_with_kivy.yaml index d1d9a7d2..06eb2c14 100644 --- a/pydis_site/apps/resources/resources/reading/tutorials/getting_started_with_kivy.yaml +++ b/pydis_site/apps/resources/resources/getting_started_with_kivy.yaml @@ -2,4 +2,13 @@ description: A big list of excellent resources for getting started making Kivy a name: Getting Started with Kivy title_url: https://blog.kivy.org/2019/12/getting-started-with-kivy/ icon_image: https://raw.githubusercontent.com/kivy/kivy-website/master/logos/kivy-logo-black-256.png -position: 3 +tags: + topics: + - user interface + - game development + payment_tiers: + - free + difficulty: + - beginner + type: + - tutorial diff --git a/pydis_site/apps/resources/resources/reading/tutorials/getting_started_with_python_for_non_programmers.yaml b/pydis_site/apps/resources/resources/getting_started_with_python_for_non_programmers.yaml index 3250a7c4..6fab0114 100644 --- a/pydis_site/apps/resources/resources/reading/tutorials/getting_started_with_python_for_non_programmers.yaml +++ b/pydis_site/apps/resources/resources/getting_started_with_python_for_non_programmers.yaml @@ -2,4 +2,12 @@ description: A list of beginner resources for programmers with no prior develope from Python's official guide. name: Getting Started with Python for Non-Programmers title_url: https://wiki.python.org/moin/BeginnersGuide/NonProgrammers -position: 1 +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + type: + - tutorial diff --git a/pydis_site/apps/resources/resources/reading/tutorials/getting_started_with_python_for_programmers.yaml b/pydis_site/apps/resources/resources/getting_started_with_python_for_programmers.yaml index b65e0e12..74b6efb9 100644 --- a/pydis_site/apps/resources/resources/reading/tutorials/getting_started_with_python_for_programmers.yaml +++ b/pydis_site/apps/resources/resources/getting_started_with_python_for_programmers.yaml @@ -3,3 +3,12 @@ description: A list of beginner resources for programmers coming from other lang name: Getting Started with Python for Programmers title_url: https://wiki.python.org/moin/BeginnersGuide/Programmers position: 0 +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - intermediate + type: + - tutorial diff --git a/pydis_site/apps/resources/resources/tools/editors/google_collab.yaml b/pydis_site/apps/resources/resources/google_collab.yaml index 302c3e2e..067a79c9 100644 --- a/pydis_site/apps/resources/resources/tools/editors/google_collab.yaml +++ b/pydis_site/apps/resources/resources/google_collab.yaml @@ -4,4 +4,14 @@ description: Google Collab is a high-powered custom version of Jupyter Notebook You can share your Collab Notebooks with other people and work collaboratively. name: Google Collab title_url: https://colab.research.google.com/notebooks/intro.ipynb -position: 4 +tags: + topics: + - general + - data science + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - tool diff --git a/pydis_site/apps/resources/resources/hitchhikers_guide_to_python.yaml b/pydis_site/apps/resources/resources/hitchhikers_guide_to_python.yaml new file mode 100644 index 00000000..e48e5717 --- /dev/null +++ b/pydis_site/apps/resources/resources/hitchhikers_guide_to_python.yaml @@ -0,0 +1,18 @@ +description: A best practice handbook for both novice and expert Python developers to the installation, + configuration, and usage of Python on a daily basis. +name: The Hitchhiker's Guide to Python +title_url: https://python-guide.org/ +urls: +- icon: branding/goodreads + url: https://www.goodreads.com/book/show/28321007-the-hitchhiker-s-guide-to-python + color: black +tags: + topics: + - general + payment_tiers: + - paid + difficulty: + - beginner + - intermediate + type: + - book diff --git a/pydis_site/apps/resources/resources/reading/books/inferential_thinking.yaml b/pydis_site/apps/resources/resources/inferential_thinking.yaml index 27fad4f7..a8cf2bc8 100644 --- a/pydis_site/apps/resources/resources/reading/books/inferential_thinking.yaml +++ b/pydis_site/apps/resources/resources/inferential_thinking.yaml @@ -2,8 +2,14 @@ description: Inferential Thinking is the textbook for the <a href="http://data8. It introduces you the fundamentals of both Data Science and Python at a level accessible to all. It is available both through your browser and in PDF form. name: Inferential Thinking -position: 13 -urls: - - icon: regular/link - url: https://www.inferentialthinking.com/chapters/intro - color: teal +title_url: https://inferentialthinking.com/chapters/intro +tags: + topics: + - data science + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - book diff --git a/pydis_site/apps/resources/resources/interactive/_category_info.yaml b/pydis_site/apps/resources/resources/interactive/_category_info.yaml deleted file mode 100644 index 7e8f34d9..00000000 --- a/pydis_site/apps/resources/resources/interactive/_category_info.yaml +++ /dev/null @@ -1,4 +0,0 @@ -description: Learn Python with interactive courses, games, and programming challenges. -name: Interactive -default_icon: branding/python -default_icon_color: black diff --git a/pydis_site/apps/resources/resources/interactive/jetbrains_academy.yaml b/pydis_site/apps/resources/resources/jetbrains_academy.yaml index 937831fa..c3cb7657 100644 --- a/pydis_site/apps/resources/resources/interactive/jetbrains_academy.yaml +++ b/pydis_site/apps/resources/resources/jetbrains_academy.yaml @@ -5,4 +5,14 @@ description: Learn Python with a wide range of high quality, project-based lesso It requires a paid subscription, but a free trial is available. name: JetBrains Academy title_url: https://www.jetbrains.com/academy/ -position: 6 +tags: + topics: + - general + - web development + - data science + payment_tiers: + - subscription + difficulty: + - beginner + type: + - interactive diff --git a/pydis_site/apps/resources/resources/videos/jetbrains.yaml b/pydis_site/apps/resources/resources/jetbrains_videos.yaml index 5d130db6..00d34e69 100644 --- a/pydis_site/apps/resources/resources/videos/jetbrains.yaml +++ b/pydis_site/apps/resources/resources/jetbrains_videos.yaml @@ -2,11 +2,20 @@ description: A collection of videos made by the PyCharm team at JetBrains on sub Django, pytest and much more!<br><br> Episodes of their "What does this package do?" series go over all sorts of libraries in Python both in the standard library and from the community and give a video explanation of the key concepts. +name: JetBrains YouTube Channel icon_image: https://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/JetBrains_Logo_2016.svg/1200px-JetBrains_Logo_2016.svg.png icon_size: 50 title_image: https://resources.jetbrains.com/storage/products/pycharm/img/meta/pycharm_logo_300x300.png -position: 3 -urls: - - icon: branding/youtube - url: https://www.youtube.com/channel/UCak6beUTLlVmf0E4AmnQkmw - color: youtube-red +title_url: https://www.youtube.com/channel/UCak6beUTLlVmf0E4AmnQkmw +tags: + topics: + - general + - testing + - web development + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - video diff --git a/pydis_site/apps/resources/resources/videos/jim_shaped_coding.yaml b/pydis_site/apps/resources/resources/jim_shaped_coding.yaml index 488cfa83..c9727888 100644 --- a/pydis_site/apps/resources/resources/videos/jim_shaped_coding.yaml +++ b/pydis_site/apps/resources/resources/jim_shaped_coding.yaml @@ -5,9 +5,18 @@ description: 'JimShapedCoding contains a set of YouTube tutorials covering thing <li><a href="https://www.youtube.com/watch?v=qMrAFscMBBc&list=PLOkVupluCIjvORWaF4kG-sXLgbVemYpEi">Django tutorials</a></li> </ul> Check out his channel for more videos!' +name: JimShapedCoding title_image: https://i.imgur.com/DlovZPf.png -position: 5 -urls: - - icon: branding/youtube - url: https://www.youtube.com/channel/UCU8d7rcShA7MGuDyYH1aWGg - color: youtube-red +title_url: https://www.youtube.com/channel/UCU8d7rcShA7MGuDyYH1aWGg +tags: + topics: + - general + - user interface + - web development + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - video diff --git a/pydis_site/apps/resources/resources/kaggle_pandas_tutorial.yaml b/pydis_site/apps/resources/resources/kaggle_pandas_tutorial.yaml new file mode 100644 index 00000000..c8e72c6e --- /dev/null +++ b/pydis_site/apps/resources/resources/kaggle_pandas_tutorial.yaml @@ -0,0 +1,13 @@ +description: An interactive tutorial for learning Pandas, the most popular library for manipulating tabular data + in Python's data science ecosystem. This tutorial assumes some familiarity with writing code in notebooks. +name: Kaggle Pandas Tutorial +title_url: https://www.kaggle.com/learn/pandas +tags: + topics: + - data science + payment_tiers: + - free + difficulty: + - intermediate + type: + - tutorial diff --git a/pydis_site/apps/resources/resources/communities/kivy.yaml b/pydis_site/apps/resources/resources/kivy.yaml index 69f117c7..dad29e9a 100644 --- a/pydis_site/apps/resources/resources/communities/kivy.yaml +++ b/pydis_site/apps/resources/resources/kivy.yaml @@ -5,14 +5,24 @@ icon_image: https://raw.githubusercontent.com/kivy/kivy-website/master/logos/kiv icon_size: 50 title_image: https://i.imgur.com/EVP3jZR.png title_url: https://discord.gg/djPtTRJ -position: 6 urls: - - icon: branding/discord - url: https://discord.gg/djPtTRJ - color: blurple - icon: regular/link url: https://kivy.org/ color: teal + - icon: branding/discord + url: https://discord.gg/djPtTRJ + color: blurple - icon: branding/github url: https://github.com/kivy color: black +tags: + topics: + - user interface + - game development + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - community diff --git a/pydis_site/apps/resources/resources/communities/microsoft.yaml b/pydis_site/apps/resources/resources/microsoft.yaml index b36c3a85..e1d62955 100644 --- a/pydis_site/apps/resources/resources/communities/microsoft.yaml +++ b/pydis_site/apps/resources/resources/microsoft.yaml @@ -1,12 +1,19 @@ description: Microsoft Python is a Discord server for discussing all things relating to using Python with Microsoft products, they have channels for Azure, VS Code, IoT, Data Science and much more! title_image: https://1000logos.net/wp-content/uploads/2017/04/Microsoft-Logo.png -title_url: https://discord.gg/b8YJQPx -position: 1 +title_url: https://www.microsoft.com/en-us/boards/pycon2020.aspx urls: - icon: branding/discord url: https://discord.gg/b8YJQPx color: blurple - - icon: regular/link - url: https://www.microsoft.com/en-us/boards/pycon2020.aspx - color: teal +tags: + topics: + - general + - tooling + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - community diff --git a/pydis_site/apps/resources/resources/videos/microsoft.yaml b/pydis_site/apps/resources/resources/microsoft_videos.yaml index 3ceaa1a2..f45aef63 100644 --- a/pydis_site/apps/resources/resources/videos/microsoft.yaml +++ b/pydis_site/apps/resources/resources/microsoft_videos.yaml @@ -7,12 +7,20 @@ description: A trove of tutorials & guides for developers from Microsoft's Devel </ul> Microsoft's Python Development Team also runs a Discord Server for discussions of Python in the Microsoft ecosystem, including Visual Studio Code and Azure. -title_image: https://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE2qVsJ?ver=3f74 -position: 4 +name: Microsoft Developer +title_image: https://upload.wikimedia.org/wikipedia/commons/4/44/Microsoft_logo.svg +title_url: https://www.youtube.com/channel/UCsMica-v34Irf9KVTh6xx-g urls: - - icon: branding/youtube - url: https://www.youtube.com/channel/UCsMica-v34Irf9KVTh6xx-g - color: youtube-red - icon: branding/discord url: https://aka.ms/python-discord color: blurple +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + type: + - video + - community diff --git a/pydis_site/apps/resources/resources/reading/books/mission_python.yaml b/pydis_site/apps/resources/resources/mission_python.yaml index c4a48b7e..391a2983 100644 --- a/pydis_site/apps/resources/resources/reading/books/mission_python.yaml +++ b/pydis_site/apps/resources/resources/mission_python.yaml @@ -3,11 +3,18 @@ description: Learn programming and Python while building a complete and awesome images, and walk-throughs make this a pleasure to both read and follow along. Excellent book for beginners. name: Mission Python -position: 5 +title_url: https://www.sean.co.uk/books/mission-python/index.shtm urls: -- icon: regular/link - url: https://www.sean.co.uk/books/mission-python/index.shtm - color: teal -- icon: branding/amazon - url: https://www.amazon.com/Mission-Python-Code-Space-Adventure/dp/1593278578 - color: amazon-orange +- icon: branding/goodreads + url: https://www.goodreads.com/book/show/35545850-mission-python + color: black +tags: + topics: + - general + - game development + payment_tiers: + - paid + difficulty: + - beginner + type: + - book diff --git a/pydis_site/apps/resources/resources/courses/mit_introduction_to_computer_science_and_programming.yaml b/pydis_site/apps/resources/resources/mit_introduction_to_computer_science_and_programming.yaml index 5560b2cb..4e74936d 100644 --- a/pydis_site/apps/resources/resources/courses/mit_introduction_to_computer_science_and_programming.yaml +++ b/pydis_site/apps/resources/resources/mit_introduction_to_computer_science_and_programming.yaml @@ -3,4 +3,14 @@ description: This MITx offering teaches computer science with Python. and the Python programming language itself. name: 'MIT: Introduction to Computer Science and Programming' title_url: https://www.edx.org/course/introduction-computer-science-mitx-6-00-1x-11 -position: 1 +tags: + topics: + - general + - algorithms and data structures + payment_tiers: + - free + - paid + difficulty: + - beginner + type: + - course diff --git a/pydis_site/apps/resources/resources/tools/editors/mu_editor.yaml b/pydis_site/apps/resources/resources/mu_editor.yaml index b92bac9d..b6318d0e 100644 --- a/pydis_site/apps/resources/resources/tools/editors/mu_editor.yaml +++ b/pydis_site/apps/resources/resources/mu_editor.yaml @@ -4,4 +4,12 @@ description: An editor aimed at beginners for the purpose of learning how to cod with built-in tools to interact with Adafruit and Arduino boards. name: Mu-Editor title_url: https://codewith.mu/ -position: 3 +tags: + topics: + - microcontrollers + payment_tiers: + - free + difficulty: + - beginner + type: + - tool diff --git a/pydis_site/apps/resources/resources/netbats_project_ideas.yaml b/pydis_site/apps/resources/resources/netbats_project_ideas.yaml new file mode 100644 index 00000000..80ba771c --- /dev/null +++ b/pydis_site/apps/resources/resources/netbats_project_ideas.yaml @@ -0,0 +1,14 @@ +description: A repository of project ideas to help one apply what they're learning, maintained by Python + community member Ned Batchelder, known on Python Discord as nedbat. +name: Ned Batchelder's Kindling Projects +title_url: https://nedbatchelder.com/text/kindling.html +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - project ideas diff --git a/pydis_site/apps/resources/resources/reading/books/neural_networks_from_scratch_in_python.yaml b/pydis_site/apps/resources/resources/neural_networks_from_scratch_in_python.yaml index 974b0e50..c4ad1e1b 100644 --- a/pydis_site/apps/resources/resources/reading/books/neural_networks_from_scratch_in_python.yaml +++ b/pydis_site/apps/resources/resources/neural_networks_from_scratch_in_python.yaml @@ -3,8 +3,17 @@ description: '"Neural Networks From Scratch" is a book intended to teach you how This is so you can go out and do new/novel things with deep learning as well as to become more successful with even more basic models. This book is to accompany the usual free tutorial videos and sample code from youtube.com/sentdex.' name: Neural Networks from Scratch in Python -position: 11 +title_url: https://nnfs.io/ urls: - - icon: regular/link - url: https://nnfs.io/ - color: teal + - icon: branding/goodreads + url: https://www.goodreads.com/book/show/55927899-neural-networks-from-scratch-in-python + color: black +tags: + topics: + - data science + payment_tiers: + - paid + difficulty: + - intermediate + type: + - book diff --git a/pydis_site/apps/resources/resources/communities/pallets.yaml b/pydis_site/apps/resources/resources/pallets.yaml index 64c97dab..0da2a625 100644 --- a/pydis_site/apps/resources/resources/communities/pallets.yaml +++ b/pydis_site/apps/resources/resources/pallets.yaml @@ -2,12 +2,18 @@ description: The Pallets Projects develop Python libraries such as the Flask web the Jinja templating library, and the Click command line toolkit. Join to discuss and get help from the Pallets community. title_image: https://i.imgur.com/sV9Ypdf.png -title_url: https://discord.gg/t6rrQZH -position: 7 +title_url: https://www.palletsprojects.com/ urls: - icon: branding/discord url: https://discord.gg/t6rrQZH color: blurple - - icon: regular/link - url: https://www.palletsprojects.com/ - color: teal +tags: + topics: + - web development + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - community diff --git a/pydis_site/apps/resources/resources/communities/panda3d.yaml b/pydis_site/apps/resources/resources/panda3d.yaml index 47797882..61ecba4b 100644 --- a/pydis_site/apps/resources/resources/communities/panda3d.yaml +++ b/pydis_site/apps/resources/resources/panda3d.yaml @@ -4,9 +4,20 @@ title_image: https://www.panda3d.org/wp-content/uploads/2019/01/panda3d_logo.png title_url: https://discord.gg/9XsucTT position: 9 urls: - - icon: branding/discord - url: https://discord.gg/9XsucTT - color: blurple - icon: regular/link url: https://www.panda3d.org/ color: teal + - icon: branding/discord + url: https://discord.gg/9XsucTT + color: blurple +tags: + topics: + - user interface + - game development + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - community diff --git a/pydis_site/apps/resources/resources/communities/people_postgres_data.yaml b/pydis_site/apps/resources/resources/people_postgres_data.yaml index 1c17d343..c2d63252 100644 --- a/pydis_site/apps/resources/resources/communities/people_postgres_data.yaml +++ b/pydis_site/apps/resources/resources/people_postgres_data.yaml @@ -5,14 +5,23 @@ description: People, Postgres, Data specializes in building users of Postgres and Life in general including movies, games, books and travel. title_image: https://media.discordapp.net/attachments/748954447857844318/750519488268730377/people_postgres_data.png title_url: https://discord.gg/Ujw8m8v -position: 2 urls: - - icon: branding/discord - url: https://discord.gg/Ujw8m8v - color: bluple - icon: regular/link url: https://postgresconf.org/ color: teal + - icon: branding/discord + url: https://discord.gg/Ujw8m8v + color: bluple - icon: branding/reddit url: https://reddit.com/r/postgresql color: orangered +tags: + topics: + - databases + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - community diff --git a/pydis_site/apps/resources/resources/podcasts/podcast_dunder_init.yaml b/pydis_site/apps/resources/resources/podcast_dunder_init.yaml index efe1601f..2751481a 100644 --- a/pydis_site/apps/resources/resources/podcasts/podcast_dunder_init.yaml +++ b/pydis_site/apps/resources/resources/podcast_dunder_init.yaml @@ -2,4 +2,13 @@ description: The podcast about Python and the people who make it great. Weekly l interviews with the creators of notable Python packages. name: Podcast.__init__ title_url: https://www.podcastinit.com/ -position: 2 +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - podcast diff --git a/pydis_site/apps/resources/resources/podcasts/_category_info.yaml b/pydis_site/apps/resources/resources/podcasts/_category_info.yaml deleted file mode 100644 index 1d2d3ba5..00000000 --- a/pydis_site/apps/resources/resources/podcasts/_category_info.yaml +++ /dev/null @@ -1,4 +0,0 @@ -description: Notable podcasts about the Python ecosystem. -name: Podcasts -default_icon: regular/microphone-alt -default_icon_color: black diff --git a/pydis_site/apps/resources/resources/courses/practical_python_programming.yaml b/pydis_site/apps/resources/resources/practical_python_programming.yaml index b801ca8c..12873b7c 100644 --- a/pydis_site/apps/resources/resources/courses/practical_python_programming.yaml +++ b/pydis_site/apps/resources/resources/practical_python_programming.yaml @@ -7,3 +7,12 @@ description: Created and taught by <a href="https://dabeaz.com/">David Beazley</ name: Practical Python Programming title_url: https://dabeaz-course.github.io/practical-python/ position: 4 +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + type: + - course diff --git a/pydis_site/apps/resources/resources/tools/ides/pycharm.yaml b/pydis_site/apps/resources/resources/pycharm.yaml index b959b0f8..574158bc 100644 --- a/pydis_site/apps/resources/resources/tools/ides/pycharm.yaml +++ b/pydis_site/apps/resources/resources/pycharm.yaml @@ -2,4 +2,13 @@ description: The very best Python IDE, with a wealth of advanced features and co functions. name: PyCharm title_url: https://www.jetbrains.com/pycharm/ -position: 0 +tags: + topics: + - general + payment_tiers: + - free + - paid + difficulty: + - intermediate + type: + - tool diff --git a/pydis_site/apps/resources/resources/communities/pyglet.yaml b/pydis_site/apps/resources/resources/pyglet.yaml index 784f514e..a47c7e62 100644 --- a/pydis_site/apps/resources/resources/communities/pyglet.yaml +++ b/pydis_site/apps/resources/resources/pyglet.yaml @@ -4,12 +4,19 @@ description: Pyglet is a powerful, loading images and videos, and playing sounds and music. All of this with a friendly Pythonic API, that's simple to learn and doesn't get in your way. title_image: https://i.imgur.com/LfQwXUe.png -title_url: https://discord.gg/QXyegWe -position: 8 +title_url: http://pyglet.org/ urls: - icon: branding/discord url: https://discord.gg/QXyegWe color: blurple - - icon: regular/link - url: http://pyglet.org/ - color: teal +tags: + topics: + - user interface + - game development + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - community diff --git a/pydis_site/apps/resources/resources/podcasts/python_bytes.yaml b/pydis_site/apps/resources/resources/python_bytes.yaml index 4f817f26..9beba4f4 100644 --- a/pydis_site/apps/resources/resources/podcasts/python_bytes.yaml +++ b/pydis_site/apps/resources/resources/python_bytes.yaml @@ -3,3 +3,13 @@ description: A byte-sized podcast where Michael Kennedy and Brian Okken work thr name: Python Bytes title_url: https://pythonbytes.fm/ position: 1 +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - podcast diff --git a/pydis_site/apps/resources/resources/reading/tutorials/python_cheat_sheet.yaml b/pydis_site/apps/resources/resources/python_cheat_sheet.yaml index 70ac49ef..56f61165 100644 --- a/pydis_site/apps/resources/resources/reading/tutorials/python_cheat_sheet.yaml +++ b/pydis_site/apps/resources/resources/python_cheat_sheet.yaml @@ -2,4 +2,12 @@ description: A Python 3 cheat sheet with useful information and tips, as well as pitfalls for beginners. This is a PDF. name: Python Cheat Sheet title_url: https://perso.limsi.fr/pointal/_media/python:cours:mementopython3-english.pdf -position: 6 +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + type: + - tutorial diff --git a/pydis_site/apps/resources/resources/python_cookbook.yaml b/pydis_site/apps/resources/resources/python_cookbook.yaml new file mode 100644 index 00000000..bc05d743 --- /dev/null +++ b/pydis_site/apps/resources/resources/python_cookbook.yaml @@ -0,0 +1,21 @@ +description: A book full of very smart problem-solving recipes for various Python topics, + including moving from Python 2 to Python 3. +name: Python Cookbook +title_url: http://shop.oreilly.com/product/0636920027072.do +urls: +- icon: branding/goodreads + url: https://www.goodreads.com/book/show/17152735-python-cookbook + color: black +- icon: branding/github + url: https://github.com/dabeaz/python-cookbook + color: black +tags: + topics: + - general + - software design + payment_tiers: + - paid + difficulty: + - intermediate + type: + - book diff --git a/pydis_site/apps/resources/resources/reading/books/python_crash_course.yaml b/pydis_site/apps/resources/resources/python_crash_course.yaml index 3cbf19c8..d916075e 100644 --- a/pydis_site/apps/resources/resources/reading/books/python_crash_course.yaml +++ b/pydis_site/apps/resources/resources/python_crash_course.yaml @@ -7,14 +7,21 @@ description: "This fast-paced, thorough introduction to programming with Python a Space Invaders–inspired arcade game, a set of data visualizations with Python’s handy libraries, and a simple web app you can deploy online." name: Python Crash Course -position: 12 +title_url: https://nostarch.com/pythoncrashcourse2e urls: - - icon: regular/link - url: https://nostarch.com/pythoncrashcourse2e - color: teal - - icon: branding/amazon - url: https://www.amazon.com/Python-Crash-Course-Project-Based-Introduction/dp/1593276036 - color: amazon-orange + - icon: branding/goodreads + url: https://www.goodreads.com/book/show/23241059-python-crash-course + color: black - icon: branding/github url: https://ehmatthes.github.io/pcc/ color: black +tags: + topics: + - general + - game development + payment_tiers: + - paid + difficulty: + - beginner + type: + - book diff --git a/pydis_site/apps/resources/resources/reading/tutorials/python_developer_guide.yaml b/pydis_site/apps/resources/resources/python_developer_guide.yaml index 625d57c8..2806d75d 100644 --- a/pydis_site/apps/resources/resources/reading/tutorials/python_developer_guide.yaml +++ b/pydis_site/apps/resources/resources/python_developer_guide.yaml @@ -2,4 +2,12 @@ description: This guide is a comprehensive resource for contributing to Python � It is maintained by the same community that maintains Python. name: Python Developer's Guide title_url: https://devguide.python.org/ -position: 2 +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - intermediate + type: + - tutorial diff --git a/pydis_site/apps/resources/resources/python_discord_videos.yaml b/pydis_site/apps/resources/resources/python_discord_videos.yaml new file mode 100644 index 00000000..15a04097 --- /dev/null +++ b/pydis_site/apps/resources/resources/python_discord_videos.yaml @@ -0,0 +1,15 @@ +description: It's our YouTube channel! We are slowly gathering content here directly related to Python, + our community and the events we host. Come check us out! +title_image: https://raw.githubusercontent.com/python-discord/branding/master/logos/logo_banner/logo_site_banner_dark_512.png +title_url: https://www.youtube.com/pythondiscord +tags: + topics: + - general + - software design + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - video diff --git a/pydis_site/apps/resources/resources/interactive/python_morsels.yaml b/pydis_site/apps/resources/resources/python_morsels.yaml index 879500eb..bbc8133b 100644 --- a/pydis_site/apps/resources/resources/interactive/python_morsels.yaml +++ b/pydis_site/apps/resources/resources/python_morsels.yaml @@ -7,4 +7,13 @@ description: 'Learn to write more idiomatic Python code with deliberate practice tests and some may include bonuses for a little more of a challenge!' name: Python Morsels title_url: https://www.pythonmorsels.com/ -position: 3 +tags: + topics: + - general + - software design + payment_tiers: + - subscription + difficulty: + - intermediate + type: + - interactive diff --git a/pydis_site/apps/resources/resources/communities/subreddit.yaml b/pydis_site/apps/resources/resources/python_subreddit.yaml index d3ddb15a..e94f84fc 100644 --- a/pydis_site/apps/resources/resources/communities/subreddit.yaml +++ b/pydis_site/apps/resources/resources/python_subreddit.yaml @@ -4,3 +4,13 @@ title_icon: branding/reddit title_icon_color: orangered title_url: https://www.reddit.com/r/Python/ position: 0 +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - community diff --git a/pydis_site/apps/resources/resources/python_tricks.yaml b/pydis_site/apps/resources/resources/python_tricks.yaml new file mode 100644 index 00000000..aa1b2fcd --- /dev/null +++ b/pydis_site/apps/resources/resources/python_tricks.yaml @@ -0,0 +1,19 @@ +description: Full of useful Python tips, tricks and features. Get this if you have + a good grasp of the basics and want to take your Python skills to the next level, + or are a experienced programmer looking to add to your toolbelt. +name: Python Tricks +title_url: https://realpython.com/products/python-tricks-book/ +urls: +- icon: branding/goodreads + url: https://www.goodreads.com/book/show/36990732-python-tricks + color: black +tags: + topics: + - general + - software design + payment_tiers: + - paid + difficulty: + - intermediate + type: + - book diff --git a/pydis_site/apps/resources/resources/interactive/python_tutor.yaml b/pydis_site/apps/resources/resources/python_tutor.yaml index 64b50d09..6bee0d69 100644 --- a/pydis_site/apps/resources/resources/interactive/python_tutor.yaml +++ b/pydis_site/apps/resources/resources/python_tutor.yaml @@ -1,4 +1,14 @@ description: Write Python code in your web browser, and see it visualized step by step. name: Python Tutor title_url: https://www.pythontutor.com/ -position: 2 +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - tool + - interactive diff --git a/pydis_site/apps/resources/resources/reading/_category_info.yaml b/pydis_site/apps/resources/resources/reading/_category_info.yaml deleted file mode 100644 index 64b87e47..00000000 --- a/pydis_site/apps/resources/resources/reading/_category_info.yaml +++ /dev/null @@ -1,2 +0,0 @@ -description: Books and tutorials related to Python and popular third-party libraries and frameworks. -name: Reading diff --git a/pydis_site/apps/resources/resources/reading/books/_category_info.yaml b/pydis_site/apps/resources/resources/reading/books/_category_info.yaml deleted file mode 100644 index ae092a20..00000000 --- a/pydis_site/apps/resources/resources/reading/books/_category_info.yaml +++ /dev/null @@ -1,5 +0,0 @@ -description: The best books for learning Python or Python Frameworks. -name: Books -default_icon: branding/python -default_icon_color: black -position: 0 diff --git a/pydis_site/apps/resources/resources/reading/books/effective_python.yaml b/pydis_site/apps/resources/resources/reading/books/effective_python.yaml deleted file mode 100644 index becd0578..00000000 --- a/pydis_site/apps/resources/resources/reading/books/effective_python.yaml +++ /dev/null @@ -1,15 +0,0 @@ -description: A book that gives 90 best practices for writing excellent Python. Great - for intermediates. -name: Effective Python -position: 3 -urls: -- icon: regular/link - url: https://effectivepython.com/ - color: teal -- icon: branding/amazon - url: https://www.amazon.com/Effective-Python-Specific-Software-Development/dp/0134853989 - color: amazon-orange - title: Amazon -- icon: branding/github - url: https://github.com/bslatkin/effectivepython - color: black diff --git a/pydis_site/apps/resources/resources/reading/books/flask_web_development.yaml b/pydis_site/apps/resources/resources/reading/books/flask_web_development.yaml deleted file mode 100644 index d191f02d..00000000 --- a/pydis_site/apps/resources/resources/reading/books/flask_web_development.yaml +++ /dev/null @@ -1,14 +0,0 @@ -description: A comprehensive Flask walkthrough that has you building a complete social - blogging application from scratch. -name: Flask Web Development -position: 6 -urls: -- icon: regular/link - url: https://shop.oreilly.com/product/0636920031116.do - color: teal -- icon: branding/amazon - url: https://www.amazon.com/Flask-Web-Development-Developing-Applications/dp/1449372627 - color: amazon-orange -- icon: branding/github - url: https://github.com/miguelgrinberg/flasky - color: black diff --git a/pydis_site/apps/resources/resources/reading/books/fluent_python.yaml b/pydis_site/apps/resources/resources/reading/books/fluent_python.yaml deleted file mode 100644 index 92f4bbab..00000000 --- a/pydis_site/apps/resources/resources/reading/books/fluent_python.yaml +++ /dev/null @@ -1,14 +0,0 @@ -description: A veritable tome of intermediate and advanced Python information. A must-read - for any Python professional. By far the most recommended book for intermediates. -name: Fluent Python -position: 7 -urls: -- icon: regular/link - url: https://www.oreilly.com/library/view/fluent-python/9781491946237/ - color: teal -- icon: branding/amazon - url: https://www.amazon.com/Fluent-Python-Concise-Effective-Programming/dp/1491946008 - color: amazon-orange -- icon: branding/github - url: https://github.com/fluentpython - color: black diff --git a/pydis_site/apps/resources/resources/reading/books/hitchhikers_guide_to_python.yaml b/pydis_site/apps/resources/resources/reading/books/hitchhikers_guide_to_python.yaml deleted file mode 100644 index 906860c7..00000000 --- a/pydis_site/apps/resources/resources/reading/books/hitchhikers_guide_to_python.yaml +++ /dev/null @@ -1,11 +0,0 @@ -description: A best practice handbook for both novice and expert Python developers to the installation, - configuration, and usage of Python on a daily basis. -name: The Hitchhiker's Guide to Python -position: 0 -urls: -- icon: regular/link - url: https://python-guide.org/ - color: teal -- icon: branding/amazon - url: https://www.amazon.com/Hitchhikers-Guide-Python-Practices-Development/dp/1491933178/ - color: amazon-orange diff --git a/pydis_site/apps/resources/resources/reading/books/python_cookbook.yaml b/pydis_site/apps/resources/resources/reading/books/python_cookbook.yaml deleted file mode 100644 index c939ab9e..00000000 --- a/pydis_site/apps/resources/resources/reading/books/python_cookbook.yaml +++ /dev/null @@ -1,14 +0,0 @@ -description: A book full of very smart problem-solving recipes for various Python topics, - including moving from Python 2 to Python 3. -name: Python Cookbook -position: 8 -urls: -- icon: regular/link - url: https://shop.oreilly.com/product/0636920027072.do - color: teal -- icon: branding/amazon - url: https://www.amazon.com/Python-Cookbook-Third-David-Beazley/dp/1449340377 - color: amazon-orange -- icon: branding/github - url: https://github.com/dabeaz/python-cookbook - color: black diff --git a/pydis_site/apps/resources/resources/reading/books/python_tricks.yaml b/pydis_site/apps/resources/resources/reading/books/python_tricks.yaml deleted file mode 100644 index c0941809..00000000 --- a/pydis_site/apps/resources/resources/reading/books/python_tricks.yaml +++ /dev/null @@ -1,12 +0,0 @@ -description: Full of useful Python tips, tricks and features. Get this if you have - a good grasp of the basics and want to take your Python skills to the next level, - or are a experienced programmer looking to add to your toolbelt. -name: Python Tricks -position: 4 -urls: -- icon: regular/link - url: https://realpython.com/products/python-tricks-book/ - color: teal -- icon: branding/amazon - url: https://www.amazon.com/Python-Tricks-Buffet-Awesome-Features/dp/1775093301 - color: amazon-orange diff --git a/pydis_site/apps/resources/resources/reading/books/two_scoops_of_django.yaml b/pydis_site/apps/resources/resources/reading/books/two_scoops_of_django.yaml deleted file mode 100644 index 7d83e7c4..00000000 --- a/pydis_site/apps/resources/resources/reading/books/two_scoops_of_django.yaml +++ /dev/null @@ -1,14 +0,0 @@ -description: Tips, tricks, and best practices for your Django project. - A highly recommended resource for Django web developers. -name: Two Scoops of Django -position: 9 -urls: -- icon: regular/link - url: https://twoscoopspress.com/products/two-scoops-of-django-1-11 - color: teal -- icon: branding/amazon - url: https://www.amazon.com/Two-Scoops-Django-Best-Practices/dp/0981467342 - color: amazon-orange -- icon: branding/github - url: https://github.com/twoscoops/two-scoops-of-django-2.0-code-examples - color: black diff --git a/pydis_site/apps/resources/resources/reading/tutorials/_category_info.yaml b/pydis_site/apps/resources/resources/reading/tutorials/_category_info.yaml deleted file mode 100644 index a18b837d..00000000 --- a/pydis_site/apps/resources/resources/reading/tutorials/_category_info.yaml +++ /dev/null @@ -1,5 +0,0 @@ -description: Tutorials and references for those that are just getting started with Python. -name: Tutorials -default_icon: branding/python -default_icon_color: black -position: 1 diff --git a/pydis_site/apps/resources/resources/communities/real_python.yaml b/pydis_site/apps/resources/resources/real_python.yaml index 1fc74d93..2ddada03 100644 --- a/pydis_site/apps/resources/resources/communities/real_python.yaml +++ b/pydis_site/apps/resources/resources/real_python.yaml @@ -4,9 +4,18 @@ title_image: https://i.imgur.com/WDqhZ36.png title_url: https://realpython.com/ position: 3 urls: - - icon: regular/link - url: https://realpython.com/ - color: teal - icon: branding/youtube url: https://www.youtube.com/channel/UCI0vQvr9aFn27yR6Ej6n5UA color: youtube-red +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - tutorial + - video + - community diff --git a/pydis_site/apps/resources/resources/regex101.yaml b/pydis_site/apps/resources/resources/regex101.yaml new file mode 100644 index 00000000..45d00f1b --- /dev/null +++ b/pydis_site/apps/resources/resources/regex101.yaml @@ -0,0 +1,15 @@ +description: An online tool for testing regular expressions that helps you understand what the regular expression can + match. Remember to set the "flavor" to Python. +name: regex101 +title_url: https://regex101.com/ +tags: + topics: + - general + - other + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - tool diff --git a/pydis_site/apps/resources/resources/repl_it.yaml b/pydis_site/apps/resources/resources/repl_it.yaml new file mode 100644 index 00000000..e0f6cbb3 --- /dev/null +++ b/pydis_site/apps/resources/resources/repl_it.yaml @@ -0,0 +1,14 @@ +description: A free, collaborative, in-browser IDE to code in 50+ languages — + without spending a second on setup. +name: repl.it +title_url: https://repl.it/ +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - tool diff --git a/pydis_site/apps/resources/resources/tools/accessibility_tools/screen_readers.yaml b/pydis_site/apps/resources/resources/screen_readers.yaml index 39372956..b086b301 100644 --- a/pydis_site/apps/resources/resources/tools/accessibility_tools/screen_readers.yaml +++ b/pydis_site/apps/resources/resources/screen_readers.yaml @@ -4,4 +4,14 @@ description: Screen readers are software programs that allow blind with this link describing many of them and their capabilities. name: Screen Readers - American Foundation for the Blind title_url: https://www.afb.org/blindness-and-low-vision/using-technology/assistive-technology-products/screen-readers -position: 1 +tags: + topics: + - other + payment_tiers: + - free + - paid + difficulty: + - beginner + - intermediate + type: + - tool diff --git a/pydis_site/apps/resources/resources/videos/sentdex.yaml b/pydis_site/apps/resources/resources/sentdex.yaml index 4e5f54c6..d9131039 100644 --- a/pydis_site/apps/resources/resources/videos/sentdex.yaml +++ b/pydis_site/apps/resources/resources/sentdex.yaml @@ -9,14 +9,24 @@ description: 'An enormous amount of Python content for all skill levels Check out his channel for more video series! ' title_image: https://i.imgur.com/kJgWZIu.png -position: 1 +title_url: https://www.youtube.com/user/sentdex urls: - - icon: branding/youtube - url: https://www.youtube.com/user/sentdex - color: youtube-red - - icon: branding/discord - url: https://discord.gg/sentdex - color: blurple - icon: regular/link url: https://pythonprogramming.net/ color: teal + - icon: branding/discord + url: https://discord.gg/sentdex + color: blurple +tags: + topics: + - general + - user interface + - data science + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - video + - community diff --git a/pydis_site/apps/resources/resources/reading/tutorials/simple_guide_to_git.yaml b/pydis_site/apps/resources/resources/simple_guide_to_git.yaml index 9d151bf9..3bb46e6d 100644 --- a/pydis_site/apps/resources/resources/reading/tutorials/simple_guide_to_git.yaml +++ b/pydis_site/apps/resources/resources/simple_guide_to_git.yaml @@ -3,4 +3,12 @@ name: A Simple Guide to Git title_url: https://rogerdudler.github.io/git-guide/ title_icon: branding/github title_icon_color: black -position: 4 +tags: + topics: + - tooling + payment_tiers: + - free + difficulty: + - beginner + type: + - tutorial diff --git a/pydis_site/apps/resources/resources/interactive/sololearn.yaml b/pydis_site/apps/resources/resources/sololearn.yaml index 51dceb2a..998f5368 100644 --- a/pydis_site/apps/resources/resources/interactive/sololearn.yaml +++ b/pydis_site/apps/resources/resources/sololearn.yaml @@ -4,4 +4,14 @@ description: SoloLearn's Python 3 course serves as a simple and convenient intro and mobile apps being available to use. name: SoloLearn title_url: https://www.sololearn.com/Course/Python/ -position: 4 +tags: + topics: + - general + payment_tiers: + - free + - subscription + difficulty: + - beginner + type: + - interactive + - course diff --git a/pydis_site/apps/resources/resources/tools/ides/spyder.yaml b/pydis_site/apps/resources/resources/spyder.yaml index c2f9c2dc..668e9306 100644 --- a/pydis_site/apps/resources/resources/tools/ides/spyder.yaml +++ b/pydis_site/apps/resources/resources/spyder.yaml @@ -2,4 +2,13 @@ description: The Scientific Python Development Environment. Simpler and lighter than PyCharm, but still packs a punch. name: Spyder title_url: https://www.spyder-ide.org/ -position: 1 +tags: + topics: + - data science + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - tool diff --git a/pydis_site/apps/resources/resources/tools/editors/sublime_text.yaml b/pydis_site/apps/resources/resources/sublime_text.yaml index 3c6e7e84..05596477 100644 --- a/pydis_site/apps/resources/resources/tools/editors/sublime_text.yaml +++ b/pydis_site/apps/resources/resources/sublime_text.yaml @@ -2,4 +2,13 @@ description: A powerful Python-backed editor with great community support and a of extensions. name: Sublime Text title_url: https://www.sublimetext.com/ -position: 2 +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - tool diff --git a/pydis_site/apps/resources/resources/podcasts/talk_python_to_me.yaml b/pydis_site/apps/resources/resources/talk_python_to_me.yaml index 5ce21fd7..509922c3 100644 --- a/pydis_site/apps/resources/resources/podcasts/talk_python_to_me.yaml +++ b/pydis_site/apps/resources/resources/talk_python_to_me.yaml @@ -2,4 +2,13 @@ description: The essential weekly Python podcast. Michael Kennedy and a prominen name within the Python community dive into a topic that relates to their experience. name: Talk Python To Me title_url: https://talkpython.fm/ -position: 0 +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - podcast diff --git a/pydis_site/apps/resources/resources/tools/accessibility_tools/talon_voice.yaml b/pydis_site/apps/resources/resources/talon_voice.yaml index 9df5f66f..3be5fe20 100644 --- a/pydis_site/apps/resources/resources/tools/accessibility_tools/talon_voice.yaml +++ b/pydis_site/apps/resources/resources/talon_voice.yaml @@ -3,4 +3,13 @@ description: Talon is a tool being built that aims to bring programming, who have limited or no use of their hands. name: Talon Voice title_url: https://talonvoice.com/ -position: 0 +tags: + topics: + - other + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - tool diff --git a/pydis_site/apps/resources/resources/podcasts/test_and_code.yaml b/pydis_site/apps/resources/resources/test_and_code.yaml index d5751577..f0d1c3b3 100644 --- a/pydis_site/apps/resources/resources/podcasts/test_and_code.yaml +++ b/pydis_site/apps/resources/resources/test_and_code.yaml @@ -2,4 +2,14 @@ description: Brian Okken's weekly podcast on testing. Usually deals with Python, but also covers many language-agnostic topics from the testing and DevOps world. name: Test & Code title_url: https://testandcode.com/ -position: 3 +tags: + topics: + - testing + - tooling + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - podcast diff --git a/pydis_site/apps/resources/resources/reading/tutorials/the_flask_mega_tutorial.yaml b/pydis_site/apps/resources/resources/the_flask_mega_tutorial.yaml index 8d61ea73..151768a5 100644 --- a/pydis_site/apps/resources/resources/reading/tutorials/the_flask_mega_tutorial.yaml +++ b/pydis_site/apps/resources/resources/the_flask_mega_tutorial.yaml @@ -1,4 +1,13 @@ description: Miguel Grinberg's fully featured mega-tutorial for learning how to create web applications with the Flask framework. name: The Flask Mega-Tutorial title_url: https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world -position: 5 +tags: + topics: + - web development + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - tutorial diff --git a/pydis_site/apps/resources/resources/podcasts/the_real_python_podcast.yaml b/pydis_site/apps/resources/resources/the_real_python_podcast.yaml index dea894ea..647779d5 100644 --- a/pydis_site/apps/resources/resources/podcasts/the_real_python_podcast.yaml +++ b/pydis_site/apps/resources/resources/the_real_python_podcast.yaml @@ -4,4 +4,13 @@ description: A weekly Python podcast hosted by Christopher Bailey with interview career tips, and related software development topics. name: The Real Python Podcast title_url: https://realpython.com/podcasts/rpp/ -position: 4 +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - podcast diff --git a/pydis_site/apps/resources/resources/reading/books/think_python.yaml b/pydis_site/apps/resources/resources/think_python.yaml index 6de87043..7099afd8 100644 --- a/pydis_site/apps/resources/resources/reading/books/think_python.yaml +++ b/pydis_site/apps/resources/resources/think_python.yaml @@ -4,14 +4,21 @@ description: Think Python is an introduction to Python programming for beginners Larger pieces, like recursion and object-oriented programming are divided into a sequence of smaller steps and introduced over the course of several chapters. name: Think Python -position: 10 +title_url: https://greenteapress.com/wp/think-python-2e/ urls: - - icon: regular/link - url: https://greenteapress.com/wp/think-python-2e/ - color: teal - - icon: branding/amazon - url: https://www.amazon.com/gp/product/1491939362 - color: amazon-orange + - icon: branding/goodreads + url: https://www.goodreads.com/book/show/14514306-think-python + color: black - icon: branding/github url: https://github.com/AllenDowney/ThinkPython2 color: black +tags: + topics: + - general + - software design + payment_tiers: + - paid + difficulty: + - beginner + type: + - book diff --git a/pydis_site/apps/resources/resources/tools/ides/thonny.yaml b/pydis_site/apps/resources/resources/thonny.yaml index d7f03a74..29ba9e07 100644 --- a/pydis_site/apps/resources/resources/tools/ides/thonny.yaml +++ b/pydis_site/apps/resources/resources/thonny.yaml @@ -3,3 +3,12 @@ description: A Python IDE specifically aimed at learning programming. Has a lot name: Thonny title_url: https://thonny.org/ position: 2 +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + type: + - tool diff --git a/pydis_site/apps/resources/resources/tools/_category_info.yaml b/pydis_site/apps/resources/resources/tools/_category_info.yaml deleted file mode 100644 index 6b16baa6..00000000 --- a/pydis_site/apps/resources/resources/tools/_category_info.yaml +++ /dev/null @@ -1,4 +0,0 @@ -description: This page is a curated list of tools that we regularly recommend in the community. - If you have a suggestion for something to add to this page, please create an issue in - <a href="https://github.com/python-discord/meta/issues">our meta repo</a>, and we'll consider adding it. -name: Tools diff --git a/pydis_site/apps/resources/resources/tools/accessibility_tools/_category_info.yaml b/pydis_site/apps/resources/resources/tools/accessibility_tools/_category_info.yaml deleted file mode 100644 index e770db07..00000000 --- a/pydis_site/apps/resources/resources/tools/accessibility_tools/_category_info.yaml +++ /dev/null @@ -1,5 +0,0 @@ -description: Accessibility tools that help people write Python code. -name: Accessibility Tools -default_icon: branding/python -default_icon_color: black -position: 2 diff --git a/pydis_site/apps/resources/resources/tools/editors/_category_info.yaml b/pydis_site/apps/resources/resources/tools/editors/_category_info.yaml deleted file mode 100644 index 3cdfff3a..00000000 --- a/pydis_site/apps/resources/resources/tools/editors/_category_info.yaml +++ /dev/null @@ -1,5 +0,0 @@ -description: Lightweight code editors supporting Python -name: Editors -default_icon: branding/python -default_icon_color: black -position: 1 diff --git a/pydis_site/apps/resources/resources/tools/ides/_category_info.yaml b/pydis_site/apps/resources/resources/tools/ides/_category_info.yaml deleted file mode 100644 index 614625a6..00000000 --- a/pydis_site/apps/resources/resources/tools/ides/_category_info.yaml +++ /dev/null @@ -1,5 +0,0 @@ -description: Fully-integrated development environments for serious Python work. -name: IDEs -default_icon: branding/python -default_icon_color: black -position: 0 diff --git a/pydis_site/apps/resources/resources/tools/ides/replit.yaml b/pydis_site/apps/resources/resources/tools/ides/replit.yaml deleted file mode 100644 index 844c5016..00000000 --- a/pydis_site/apps/resources/resources/tools/ides/replit.yaml +++ /dev/null @@ -1,5 +0,0 @@ -description: A free, collaborative, in-browser IDE to code in 50+ languages — - without spending a second on setup. -name: replit -title_url: https://replit.com/ -position: 3 diff --git a/pydis_site/apps/resources/resources/two_scoops_of_django.yaml b/pydis_site/apps/resources/resources/two_scoops_of_django.yaml new file mode 100644 index 00000000..96eafd28 --- /dev/null +++ b/pydis_site/apps/resources/resources/two_scoops_of_django.yaml @@ -0,0 +1,20 @@ +description: Tips, tricks, and best practices for your Django project. + A highly recommended resource for Django web developers. +name: Two Scoops of Django +title_url: https://www.feldroy.com/collections/everything/products/two-scoops-of-django-3-x +urls: +- icon: branding/goodreads + url: https://www.goodreads.com/book/show/55822151-two-scoops-of-django-3-x + color: black +- icon: branding/github + url: https://github.com/twoscoops/two-scoops-of-django-2.0-code-examples + color: black +tags: + topics: + - web development + payment_tiers: + - paid + difficulty: + - intermediate + type: + - book diff --git a/pydis_site/apps/resources/resources/courses/university_of_michigan.yaml b/pydis_site/apps/resources/resources/university_of_michigan.yaml index 3efe7640..7aaaf2ae 100644 --- a/pydis_site/apps/resources/resources/courses/university_of_michigan.yaml +++ b/pydis_site/apps/resources/resources/university_of_michigan.yaml @@ -2,4 +2,12 @@ description: A 5-part specialization course that teaches Python from scratch. The course has no pre-requisites and avoids all but the simplest mathematics. name: 'University of Michigan: Programming for Everybody' title_url: https://www.coursera.org/learn/python -position: 2 +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + type: + - course diff --git a/pydis_site/apps/resources/resources/courses/university_of_toronto.yaml b/pydis_site/apps/resources/resources/university_of_toronto.yaml index 0a7839de..94df96f2 100644 --- a/pydis_site/apps/resources/resources/courses/university_of_toronto.yaml +++ b/pydis_site/apps/resources/resources/university_of_toronto.yaml @@ -1,7 +1,6 @@ description: A 2-part course that teaches Python. Primarily intended for high school students and first-year university students who want to learn programming. name: 'University of Toronto: Learn to Program' -position: 0 urls: - icon: regular/graduation-cap url: https://www.coursera.org/learn/learn-to-program @@ -9,3 +8,13 @@ urls: - icon: regular/graduation-cap url: https://www.coursera.org/learn/program-code color: youtube-red +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - course diff --git a/pydis_site/apps/resources/resources/vcokltfre_discord_bot_tutorial.yaml b/pydis_site/apps/resources/resources/vcokltfre_discord_bot_tutorial.yaml new file mode 100644 index 00000000..1a3dd457 --- /dev/null +++ b/pydis_site/apps/resources/resources/vcokltfre_discord_bot_tutorial.yaml @@ -0,0 +1,14 @@ +description: This tutorial, written by Python Discord staff member vcokltfre, + will walk you through all the aspects of creating your own Discord bot, + starting from from creating the bot user itself. +name: vcokltfre's Discord Bot Tutorial +title_url: https://vcokltfre.dev/ +tags: + topics: + - discord bots + payment_tiers: + - free + difficulty: + - intermediate + type: + - tutorial diff --git a/pydis_site/apps/resources/resources/videos/_category_info.yaml b/pydis_site/apps/resources/resources/videos/_category_info.yaml deleted file mode 100644 index 8192e021..00000000 --- a/pydis_site/apps/resources/resources/videos/_category_info.yaml +++ /dev/null @@ -1,2 +0,0 @@ -description: Excellent Youtube channels with content related to Python. -name: Videos diff --git a/pydis_site/apps/resources/resources/videos/python_discord.yaml b/pydis_site/apps/resources/resources/videos/python_discord.yaml deleted file mode 100644 index 04235b08..00000000 --- a/pydis_site/apps/resources/resources/videos/python_discord.yaml +++ /dev/null @@ -1,8 +0,0 @@ -description: It's our channel! We are slowly gathering content here directly related to Python, - our community and the events we host. Come check us out! -title_image: https://raw.githubusercontent.com/python-discord/branding/master/logos/logo_banner/logo_site_banner_dark_512.png -position: 2 -urls: - - icon: branding/youtube - url: https://www.youtube.com/pythondiscord - color: youtube-red diff --git a/pydis_site/apps/resources/resources/tools/editors/visual_studio_code.yaml b/pydis_site/apps/resources/resources/visual_studio_code.yaml index e3737ca7..3cf858f8 100644 --- a/pydis_site/apps/resources/resources/tools/editors/visual_studio_code.yaml +++ b/pydis_site/apps/resources/resources/visual_studio_code.yaml @@ -1,4 +1,13 @@ description: A fully-featured editor based on Electron, extendable with plugins. name: Visual Studio Code title_url: https://code.visualstudio.com/ -position: 1 +tags: + topics: + - general + payment_tiers: + - free + difficulty: + - beginner + - intermediate + type: + - tool diff --git a/pydis_site/apps/resources/resources/reading/tutorials/wtf_python.yaml b/pydis_site/apps/resources/resources/wtf_python.yaml index a25a84fd..6d90ba39 100644 --- a/pydis_site/apps/resources/resources/reading/tutorials/wtf_python.yaml +++ b/pydis_site/apps/resources/resources/wtf_python.yaml @@ -6,3 +6,13 @@ description: Python, being a beautifully designed high-level and interpreter-bas name: WTF Python title_url: https://github.com/satwikkansal/wtfpython position: 7 +tags: + topics: + - software design + - other + payment_tiers: + - free + difficulty: + - intermediate + type: + - tutorial diff --git a/pydis_site/apps/resources/templatetags/as_css_class.py b/pydis_site/apps/resources/templatetags/as_css_class.py new file mode 100644 index 00000000..8b628dc9 --- /dev/null +++ b/pydis_site/apps/resources/templatetags/as_css_class.py @@ -0,0 +1,18 @@ +from django import template + +register = template.Library() + + +def as_css_class(class_name: str) -> str: + """ + Convert any string to a css-class name. + + For example, convert + "Favorite FROOT_is_LEMON" to + "favorite-froot-is-lemon" + """ + class_name = class_name.lower() + class_name = class_name.replace(" ", "-") + class_name = class_name.replace("_", "-") + return class_name diff --git a/pydis_site/apps/resources/templatetags/get_category_icon.py b/pydis_site/apps/resources/templatetags/get_category_icon.py new file mode 100644 index 00000000..5a5e9887 --- /dev/null +++ b/pydis_site/apps/resources/templatetags/get_category_icon.py @@ -0,0 +1,39 @@ +from django import template + +register = template.Library() + +_ICONS = { + "Algorithms And Data Structures": "fa-cogs", + "Beginner": "fa-play-circle", + "Book": "fa-book", + "Community": "fa-users", + "Course": "fa-chalkboard-teacher", + "Data Science": "fa-flask", + "Databases": "fa-server", + "Discord Bots": "fa-robot", + "Free": "fa-first-aid", + "Game Development": "fa-joystick", + "General": "fa-book", + "Interactive": "fa-mouse-pointer", + "Intermediate": "fa-align-center", + "Microcontrollers": "fa-microchip", + "Other": "fa-question-circle", + "Paid": "fa-dollar-sign", + "Podcast": "fa-microphone-alt", + "Project Ideas": "fa-lightbulb-o", + "Software Design": "fa-paint-brush", + "Subscription": "fa-credit-card", + "Testing": "fa-vial", + "Tool": "fa-tools", + "Tooling": "fa-toolbox", + "Tutorial": "fa-clipboard-list", + "User Interface": "fa-desktop", + "Video": "fa-video", + "Web Development": "fa-wifi", +} + + +def get_category_icon(name: str) -> str: + """Get icon of a specific resource category.""" + return f'fa {_ICONS[name]}' diff --git a/pydis_site/apps/resources/tests/test_resources.py b/pydis_site/apps/resources/tests/test_resources.py new file mode 100644 index 00000000..81638e2f --- /dev/null +++ b/pydis_site/apps/resources/tests/test_resources.py @@ -0,0 +1,9 @@ +from django.test import TestCase + + +class TestResources(TestCase): + """Test our resource filtering systems.""" + + def test_utils_to_retrieve_tags(self): + """Test that the utils that retrieve the tags work as intended.""" + pass diff --git a/pydis_site/apps/resources/tests/test_views.py b/pydis_site/apps/resources/tests/test_views.py index 3ad0b958..dab3599d 100644 --- a/pydis_site/apps/resources/tests/test_views.py +++ b/pydis_site/apps/resources/tests/test_views.py @@ -1,9 +1,8 @@ from pathlib import Path -from unittest.mock import patch from django.conf import settings from django.test import TestCase -from django.urls import reverse +from django_hosts import reverse TESTING_RESOURCES_PATH = Path( settings.BASE_DIR, "pydis_site", "apps", "resources", "tests", "testing_resources" @@ -16,19 +15,3 @@ class TestResourcesView(TestCase): url = reverse("resources:index") response = self.client.get(url) self.assertEqual(response.status_code, 200) - - -class TestResourcesListView(TestCase): - @patch("pydis_site.apps.resources.views.resources_list.RESOURCES_PATH", TESTING_RESOURCES_PATH) - def test_valid_resource_list_200(self): - """Check does site return code 200 when visiting valid resource list.""" - url = reverse("resources:resources", args=("testing",)) - response = self.client.get(url) - self.assertEqual(response.status_code, 200) - - @patch("pydis_site.apps.resources.views.resources_list.RESOURCES_PATH", TESTING_RESOURCES_PATH) - def test_invalid_resource_list_404(self): - """Check does site return code 404 when trying to visit invalid resource list.""" - url = reverse("resources:resources", args=("invalid",)) - response = self.client.get(url) - self.assertEqual(response.status_code, 404) diff --git a/pydis_site/apps/resources/tests/testing_resources/testing/_category_info.yaml b/pydis_site/apps/resources/tests/testing_resources/testing/_category_info.yaml deleted file mode 100644 index bae17ea3..00000000 --- a/pydis_site/apps/resources/tests/testing_resources/testing/_category_info.yaml +++ /dev/null @@ -1 +0,0 @@ -name: Testing diff --git a/pydis_site/apps/resources/tests/testing_resources/testing/foobar/_category_info.yaml b/pydis_site/apps/resources/tests/testing_resources/testing/foobar/_category_info.yaml deleted file mode 100644 index eaac32d9..00000000 --- a/pydis_site/apps/resources/tests/testing_resources/testing/foobar/_category_info.yaml +++ /dev/null @@ -1 +0,0 @@ -name: Foobar diff --git a/pydis_site/apps/resources/urls.py b/pydis_site/apps/resources/urls.py index 10eda132..ed24dc99 100644 --- a/pydis_site/apps/resources/urls.py +++ b/pydis_site/apps/resources/urls.py @@ -1,25 +1,9 @@ -import typing -from pathlib import Path - from django_distill import distill_path from pydis_site.apps.resources import views app_name = "resources" - - -def get_all_resources() -> typing.Iterator[dict[str, str]]: - """Yield a dict of all resource categories.""" - for category in Path("pydis_site", "apps", "resources", "resources").iterdir(): - yield {"category": category.name} - - urlpatterns = [ - distill_path("", views.ResourcesView.as_view(), name="index"), - distill_path( - "<str:category>/", - views.ResourcesListView.as_view(), - name="resources", - distill_func=get_all_resources - ), + distill_path("", views.resources.ResourceView.as_view(), name="index"), + distill_path("<resource_type>/", views.resources.ResourceView.as_view(), name="index"), ] diff --git a/pydis_site/apps/resources/utils.py b/pydis_site/apps/resources/utils.py deleted file mode 100644 index 1855fc80..00000000 --- a/pydis_site/apps/resources/utils.py +++ /dev/null @@ -1,42 +0,0 @@ -import typing as t -from pathlib import Path - -import yaml - - -def get_resources(path: Path) -> t.List[t.Dict]: - """Loads resource YAMLs from provided path.""" - resources = [] - - for item in path.iterdir(): - if item.is_file() and item.suffix == ".yaml" and item.name != "_category_info.yaml": - resources.append(yaml.safe_load(item.read_text())) - - return resources - - -def get_subcategories(path: Path) -> t.List[t.Dict]: - """Loads resources subcategories with their resources by provided path.""" - subcategories = [] - - for item in path.iterdir(): - if item.is_dir() and item.joinpath("_category_info.yaml").exists(): - subcategories.append({ - "category_info": { - **yaml.safe_load( - item.joinpath("_category_info.yaml").read_text() - ), - "raw_name": item.name - }, - "resources": [ - yaml.safe_load(subitem.read_text()) - for subitem in item.iterdir() - if ( - subitem.is_file() - and subitem.suffix == ".yaml" - and subitem.name != "_category_info.yaml" - ) - ] - }) - - return subcategories diff --git a/pydis_site/apps/resources/views/__init__.py b/pydis_site/apps/resources/views/__init__.py index 8eb383b5..986f3e10 100644 --- a/pydis_site/apps/resources/views/__init__.py +++ b/pydis_site/apps/resources/views/__init__.py @@ -1,4 +1,3 @@ -from .resources import ResourcesView -from .resources_list import ResourcesListView +from .resources import ResourceView -__all__ = ["ResourcesView", "ResourcesListView"] +__all__ = ["ResourceView"] diff --git a/pydis_site/apps/resources/views/resources.py b/pydis_site/apps/resources/views/resources.py index 25ce3e50..a5c2cf7c 100644 --- a/pydis_site/apps/resources/views/resources.py +++ b/pydis_site/apps/resources/views/resources.py @@ -1,7 +1,106 @@ -from django.views.generic import TemplateView +import typing as t +from pathlib import Path +import yaml +from django.core.handlers.wsgi import WSGIRequest +from django.http import HttpResponse, HttpResponseNotFound +from django.shortcuts import render +from django.views import View -class ResourcesView(TemplateView): - """View for resources index page.""" +from pydis_site import settings - template_name = "resources/resources.html" +RESOURCES_PATH = Path(settings.BASE_DIR, "pydis_site", "apps", "resources", "resources") + + +class ResourceView(View): + """Our curated list of good learning resources.""" + + def __init__(self, *args, **kwargs): + """Set up all the resources.""" + super().__init__(*args, **kwargs) + + # Load the resources from the yaml files in /resources/ + self.resources = { + path.stem: yaml.safe_load(path.read_text()) + for path in RESOURCES_PATH.rglob("*.yaml") + } + + # Sort the resources alphabetically + self.resources = dict(sorted(self.resources.items())) + + # Parse out all current tags + resource_tags = { + "topics": set(), + "payment_tiers": set(), + "difficulty": set(), + "type": set(), + } + for resource_name, resource in self.resources.items(): + css_classes = [] + for tag_type in resource_tags.keys(): + # Store the tags into `resource_tags` + tags = resource.get("tags", {}).get(tag_type, []) + for tag in tags: + tag = tag.title() + tag = tag.replace("And", "and") + resource_tags[tag_type].add(tag) + + # Make a CSS class friendly representation too, while we're already iterating. + for tag in tags: + css_tag = f"{tag_type}-{tag}" + css_tag = css_tag.replace("_", "-") + css_tag = css_tag.replace(" ", "-") + css_classes.append(css_tag) + + # Now add the css classes back to the resource, so we can use them in the template. + self.resources[resource_name]["css_classes"] = " ".join(css_classes) + + # Set up all the filter checkbox metadata + self.filters = { + "Difficulty": { + "filters": sorted(resource_tags.get("difficulty")), + "icon": "fas fa-brain", + "hidden": False, + }, + "Type": { + "filters": sorted(resource_tags.get("type")), + "icon": "fas fa-photo-video", + "hidden": False, + }, + "Payment tiers": { + "filters": sorted(resource_tags.get("payment_tiers")), + "icon": "fas fa-dollar-sign", + "hidden": True, + }, + "Topics": { + "filters": sorted(resource_tags.get("topics")), + "icon": "fas fa-lightbulb", + "hidden": True, + } + } + + # The bottom topic should always be "Other". + self.filters["Topics"]["filters"].remove("Other") + self.filters["Topics"]["filters"].append("Other") + + def get(self, request: WSGIRequest, resource_type: t.Optional[str] = None) -> HttpResponse: + """List out all the resources, and any filtering options from the URL.""" + # Add type filtering if the request is made to somewhere like /resources/video. + # We also convert all spaces to dashes, so they'll correspond with the filters. + if resource_type: + dashless_resource_type = resource_type.replace("-", " ") + + if dashless_resource_type.title() not in self.filters['Type']['filters']: + return HttpResponseNotFound() + + resource_type = resource_type.replace(" ", "-") + + return render( + request, + template_name="resources/resources.html", + context={ + "resources": self.resources, + "filters": self.filters, + "resource_type": resource_type, + } + ) diff --git a/pydis_site/apps/resources/views/resources_list.py b/pydis_site/apps/resources/views/resources_list.py deleted file mode 100644 index 55f22993..00000000 --- a/pydis_site/apps/resources/views/resources_list.py +++ /dev/null @@ -1,39 +0,0 @@ -from pathlib import Path -from typing import Any, Dict - -import yaml -from django.conf import settings -from django.http import Http404 -from django.views.generic import TemplateView - -from pydis_site.apps.resources.utils import get_resources, get_subcategories - -RESOURCES_PATH = Path(settings.BASE_DIR, "pydis_site", "apps", "resources", "resources") - - -class ResourcesListView(TemplateView): - """Shows specific resources list.""" - - template_name = "resources/resources_list.html" - - def get_context_data(self, **kwargs) -> Dict[str, Any]: - """Add resources and subcategories data into context.""" - context = super().get_context_data(**kwargs) - - resource_path = RESOURCES_PATH / self.kwargs["category"] - if ( - not resource_path.is_dir() - or not resource_path.joinpath("_category_info.yaml").exists() - ): - raise Http404 - - context["resources"] = get_resources(resource_path) - context["subcategories"] = get_subcategories(resource_path) - context["category_info"] = { - **yaml.safe_load( - resource_path.joinpath("_category_info.yaml").read_text() - ), - "raw_name": resource_path.name - } - - return context diff --git a/pydis_site/settings.py b/pydis_site/settings.py index d38c298b..3b146f2c 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -272,6 +272,7 @@ BULMA_SETTINGS = { "bulma-dropdown", "bulma-navbar-burger", ], + "fontawesome_token": "ff22cb6f41", } # Information about site repository diff --git a/pydis_site/static/css/collapsibles.css b/pydis_site/static/css/collapsibles.css new file mode 100644 index 00000000..7b76d8d5 --- /dev/null +++ b/pydis_site/static/css/collapsibles.css @@ -0,0 +1,12 @@ +.collapsible { + cursor: pointer; + width: 100%; + border: none; + outline: none; +} + +.collapsible-content { + overflow: hidden; + max-height: 0; + transition: max-height 0.2s ease-out; +}
\ No newline at end of file diff --git a/pydis_site/static/css/content/page.css b/pydis_site/static/css/content/page.css index 2d4bd325..d831f86d 100644 --- a/pydis_site/static/css/content/page.css +++ b/pydis_site/static/css/content/page.css @@ -77,16 +77,3 @@ ul.menu-list.toc { li img { margin-top: 0.5em; } - -.collapsible { - cursor: pointer; - width: 100%; - border: none; - outline: none; -} - -.collapsible-content { - overflow: hidden; - max-height: 0; - transition: max-height 0.2s ease-out; -} diff --git a/pydis_site/static/css/resources/resources.css b/pydis_site/static/css/resources/resources.css index cf4cb472..b24fcb5b 100644 --- a/pydis_site/static/css/resources/resources.css +++ b/pydis_site/static/css/resources/resources.css @@ -1,29 +1,209 @@ -.box, .tile.is-parent { - transition: 0.1s ease-out; +/* Colors for icons */ +i.resource-icon.is-orangered { + color: #FE640A; } -.box { - min-height: 15vh; +i.resource-icon.is-blurple { + color: #7289DA; } -.tile.is-parent:hover .box { - box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23); +i.resource-icon.is-teal { + color: #95DBE5; } -.tile.is-parent:hover { - padding: 0.65rem 0.85rem 0.85rem 0.65rem; - filter: saturate(1.1) brightness(1.1); +i.resource-icon.is-youtube-red { + color: #BB0000; +} +i.resource-icon.is-black { + color: #2c3334; +} + +/* Colors when icons are hovered */ +i.resource-icon.is-hoverable:hover { + filter: brightness(125%); +} +i.resource-icon.is-hoverable.is-black:hover { + filter: brightness(170%); +} +i.resource-icon.is-hoverable.is-teal:hover { + filter: brightness(80%); +} + +/* Icon padding */ +.breadcrumb-section { + padding: 1rem; +} +i.has-icon-padding { + padding: 0 10px 25px 0; +} +#tab-content p { + display: none; +} +#tab-content p.is-active { +display: block; +} + +/* Disable highlighting for all text in the filters. */ +.filter-checkbox, +.filter-panel label, +.card-header span { + user-select: none +} + +/* Remove pointless margin in panel header */ +#filter-panel-header { + margin-bottom: 0; +} + +/* Full width filter cards */ +#resource-filtering-panel .card .collapsible-content .card-content { + padding:0 +} + +/* Don't round the corners of the collapsibles */ +.filter-category-header { + border-radius: 0; +} + +/* Center the 404 div */ +.no-resources-found { + display: flex; + flex-direction: column; + align-items: center; +} + +/* Hide the no resources h2 by default */ +.no-resources-found { + display: none; + margin-top: 1em; +} + +/* Disable clicking on the checkbox itself. */ +/* Instead, we want to let the anchor tag handle clicks. */ +.filter-checkbox { + pointer-events: none; +} + +/* Blurple category icons */ +i.is-primary { + color: #7289da; } -#readingBlock { - background-image: linear-gradient(141deg, #911eb4 0%, #b631de 71%, #cf4bf7 100%); +/* A little space around the filter card, please! */ +.filter-tags { + padding-bottom: .5em; + padding-right: .5em; } -#interactiveBlock { - background-image: linear-gradient(141deg, #d05600 0%, #da722a 71%, #e68846 100%); +/* Set default display to inline-flex, for centering. */ +span.filter-box-tag { + display: none; + align-items: center; + cursor: pointer; + user-select: none; } -#communitiesBlock { - background-image: linear-gradient(141deg, #3b756f 0%, #3a847c 71%, #41948b 100%); +/* Make sure jQuery will use inline-flex when setting `show()` again. */ +span.filter-box-tag[style*='display: block'] { + display: inline-flex !important; } -#podcastsBlock { - background-image: linear-gradient(141deg, #232382 0%, #30309c 71%, #4343ad 100%); +/* Make resource tags clickable */ +.resource-tag { + cursor: pointer; + user-select: none; } + +/* When hovering tags, brighten them a bit. */ +.resource-tag:hover, +.filter-box-tag:hover { + filter: brightness(95%); +} + +/* Move the x down 1 pixel to align center */ +button.delete { + margin-top: 1px; +} + +/* Colors for delete button x's */ +button.delete.is-primary::before, +button.delete.is-primary::after { + background-color: #2a45a2; +} +button.delete.is-success::before, +button.delete.is-success::after { + background-color: #2c9659; +} +button.delete.is-danger::before, +button.delete.is-danger::after { + background-color: #c32841; +} +button.delete.is-info::before, +button.delete.is-info::after { + background-color: #237fbd; +} + +/* Give outlines to active tags */ +span.filter-box-tag, +span.resource-tag.active { + outline-width: 1px; + outline-style: solid; +} + +/* Make filter tags sparkle when selected! */ +@keyframes glow_success { + from { box-shadow: 0 0 2px 2px #aef4af; } + 33% { box-shadow: 0 0 2px 2px #87af7a; } + 66% { box-shadow: 0 0 2px 2px #9ceaac; } + to { box-shadow: 0 0 2px 2px #7cbf64; } +} + +@keyframes glow_primary { + from { box-shadow: 0 0 2px 2px #aeb8f3; } + 33% { box-shadow: 0 0 2px 2px #909ed9; } + 66% { box-shadow: 0 0 2px 2px #6d7ed4; } + to { box-shadow: 0 0 2px 2px #6383b3; } +} + +@keyframes glow_danger { + from { box-shadow: 0 0 2px 2px #c9495f; } + 33% { box-shadow: 0 0 2px 2px #92486f; } + 66% { box-shadow: 0 0 2px 2px #d455ba; } + to { box-shadow: 0 0 2px 2px #ff8192; } +} +@keyframes glow_info { + from { box-shadow: 0 0 2px 2px #4592c9; } + 33% { box-shadow: 0 0 2px 2px #6196bb; } + 66% { box-shadow: 0 0 2px 2px #5adade; } + to { box-shadow: 0 0 2px 2px #6bcfdc; } +} + +span.resource-tag.active.is-primary { + animation: glow_primary 4s infinite alternate; +} +span.resource-tag.active.has-background-danger-light { + animation: glow_danger 4s infinite alternate; +} +span.resource-tag.active.has-background-success-light { + animation: glow_success 4s infinite alternate; +} +span.resource-tag.active.has-background-info-light { + animation: glow_info 4s infinite alternate; +} + +/* Smaller filter category headers when on mobile */ +@media screen and (max-width: 480px) { + .filter-category-header .card-header .card-header-title { + font-size: 14px; + padding: 0; + } + .filter-panel { + padding-top: 4px; + padding-bottom: 4px; + } +} + +/* Disable transitions */ +.no-transition { + -webkit-transition: none !important; + -moz-transition: none !important; + -o-transition: none !important; + transition: none !important; +}
\ No newline at end of file diff --git a/pydis_site/static/css/resources/resources_list.css b/pydis_site/static/css/resources/resources_list.css deleted file mode 100644 index 33129c87..00000000 --- a/pydis_site/static/css/resources/resources_list.css +++ /dev/null @@ -1,55 +0,0 @@ -.breadcrumb-section { - padding: 1rem; -} - -i.resource-icon.is-orangered { - color: #FE640A; -} - -i.resource-icon.is-orangered:hover { - color: #fe9840; -} - -i.resource-icon.is-blurple { - color: #7289DA; -} - -i.resource-icon.is-blurple:hover { - color: #93a8da; -} - -i.resource-icon.is-teal { - color: #95DBE5; -} - -i.resource-icon.is-teal:hover { - color: #a9f5ff; -} - -i.resource-icon.is-youtube-red { - color: #BB0000; -} - -i.resource-icon.is-youtube-red:hover { - color: #f80000; -} - -i.resource-icon.is-amazon-orange { - color: #FF9900; -} - -i.resource-icon.is-amazon-orange:hover { - color: #ffb71a; -} - -i.resource-icon.is-black { - color: #000000; -} - -i.resource-icon.is-black { - color: #191919; -} - -i.has-icon-padding { - padding: 0 10px 25px 0; -} diff --git a/pydis_site/static/images/resources/duck_pond_404.png b/pydis_site/static/images/resources/duck_pond_404.png Binary files differnew file mode 100644 index 00000000..3aed4d62 --- /dev/null +++ b/pydis_site/static/images/resources/duck_pond_404.png diff --git a/pydis_site/static/js/content/page.js b/pydis_site/static/js/collapsibles.js index 366a033c..366a033c 100644 --- a/pydis_site/static/js/content/page.js +++ b/pydis_site/static/js/collapsibles.js diff --git a/pydis_site/static/js/resources/resources.js b/pydis_site/static/js/resources/resources.js new file mode 100644 index 00000000..44d4db5c --- /dev/null +++ b/pydis_site/static/js/resources/resources.js @@ -0,0 +1,247 @@ +"use strict"; + +// Filters that are currently selected +var activeFilters = { + topics: [], + type: [], + "payment-tiers": [], + difficulty: [] +}; + +function addFilter(filterName, filterItem) { + // Push the filter into the stack + var filterIndex = activeFilters[filterName].indexOf(filterItem); + if (filterIndex === -1) { + activeFilters[filterName].push(filterItem); + } + updateUI(); + + // Show a corresponding filter box tag + $(`.filter-box-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).show(); + + // Make corresponding resource tags active + $(`.resource-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).addClass("active"); + + // Hide the "No filters selected" tag. + $(".no-tags-selected.tag").hide(); +} + +function removeFilter(filterName, filterItem) { + // Remove the filter from the stack + var filterIndex = activeFilters[filterName].indexOf(filterItem); + if (filterIndex !== -1) { + activeFilters[filterName].splice(filterIndex, 1); + } + updateUI(); + + // Hide the corresponding filter box tag + $(`.filter-box-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).hide(); + + // Make corresponding resource tags inactive + $(`.resource-tag[data-filter-name=${filterName}][data-filter-item=${filterItem}]`).removeClass("active"); + + // Show "No filters selected" tag, if there are no filters active + if (noFilters()) { + $(".no-tags-selected.tag").show(); + } +} + +/* Check if there are no filters */ +function noFilters() { + return ( + activeFilters.topics.length === 0 && + activeFilters.type.length === 0 && + activeFilters["payment-tiers"].length === 0 && + activeFilters.difficulty.length === 0 + ); +} + +/* Get the params out of the URL and use them. This is run when the page loads. */ +function deserializeURLParams() { + let searchParams = new window.URLSearchParams(window.location.search); + + // Work through the parameters and add them to the filter object + $.each(Object.keys(activeFilters), function(_, filterType) { + let paramFilterContent = searchParams.get(filterType); + + if (paramFilterContent !== null) { + // We use split here because we always want an array, not a string. + let paramFilterArray = paramFilterContent.split(","); + activeFilters[filterType] = paramFilterArray; + + // Update the corresponding filter UI, so it reflects the internal state. + $(paramFilterArray).each(function(_, filter) { + let checkbox = $(`.filter-checkbox[data-filter-name='${filterType}'][data-filter-item='${filter}']`); + let filterTag = $(`.filter-box-tag[data-filter-name='${filterType}'][data-filter-item='${filter}']`); + let resourceTags = $(`.resource-tag[data-filter-name='${filterType}'][data-filter-item='${filter}']`); + checkbox.prop("checked", true); + filterTag.show(); + resourceTags.addClass("active"); + }); + } + }); +} + +/* Update the URL with new parameters */ +function updateURL() { + // If there's nothing in the filters, we don't want anything in the URL. + if (noFilters()) { + window.history.replaceState(null, document.title, './'); + return; + } + + // Iterate through and get rid of empty ones + let searchParams = new URLSearchParams(activeFilters); + $.each(activeFilters, function(filterType, filters) { + if (filters.length === 0) { + searchParams.delete(filterType); + } + }); + + // Now update the URL + window.history.replaceState(null, document.title, `?${searchParams.toString()}`); +} + +/* Update the resources to match 'active_filters' */ +function updateUI() { + let resources = $('.resource-box'); + let filterTags = $('.filter-box-tag'); + + // Update the URL to match the new filters. + updateURL(); + + // If there's nothing in the filters, show everything and return. + if (noFilters()) { + resources.show(); + filterTags.hide(); + return; + } + + // Otherwise, hide everything and then filter the resources to decide what to show. + let hasMatches = false; + resources.hide(); + resources.filter(function() { + let validation = { + topics: false, + type: false, + 'payment-tiers': false, + difficulty: false + }; + let resourceBox = $(this); + + // Validate the filters + $.each(activeFilters, function(filterType, filters) { + // If the filter list is empty, this passes validation. + if (filters.length === 0) { + validation[filterType] = true; + return; + } + + // Otherwise, we need to check if one of the classes exist. + $.each(filters, function(index, filter) { + if (resourceBox.hasClass(`${filterType}-${filter}`)) { + validation[filterType] = true; + } + }); + }); + + // If validation passes, show the resource. + if (Object.values(validation).every(Boolean)) { + hasMatches = true; + return true; + } else { + return false; + } + }).show(); + + // If there are no matches, show the no matches message + if (!hasMatches) { + $(".no-resources-found").show(); + } else { + $(".no-resources-found").hide(); + } +} + +// Executed when the page has finished loading. +document.addEventListener("DOMContentLoaded", function () { + /* Check if the user has navigated to one of the old resource pages, + like pydis.com/resources/communities. In this case, we'll rewrite + the URL before we do anything else. */ + let resourceTypeInput = $("#resource-type-input").val(); + if (resourceTypeInput !== "None") { + window.history.replaceState(null, document.title, `../?type=${resourceTypeInput}`); + } + + // Update the filters on page load to reflect URL parameters. + $('.filter-box-tag').hide(); + deserializeURLParams(); + updateUI(); + + // If you collapse or uncollapse a filter group, swap the icon. + $('button.collapsible').on("click", function() { + let icon = $(this).find(".card-header-icon i"); + + if ($(icon).hasClass("fa-window-minimize")) { + $(icon).removeClass(["far", "fa-window-minimize"]); + $(icon).addClass(["fas", "fa-angle-down"]); + } else { + $(icon).removeClass(["fas", "fa-angle-down"]); + $(icon).addClass(["far", "fa-window-minimize"]); + } + }); + + // If this is a mobile device, collapse the categories to win back some screen real estate. + if (screen.width < 480) { + let categoryHeaders = $(".filter-category-header .collapsible-content"); + let icons = $('.filter-category-header button .card-header-icon i'); + categoryHeaders.addClass("no-transition"); + categoryHeaders.css("max-height", 0); + icons.removeClass(["far", "fa-window-minimize"]); + icons.addClass(["fas", "fa-angle-down"]); + categoryHeaders.removeClass("no-transition"); + } + + // If you click on the div surrounding the filter checkbox, it clicks the corresponding checkbox. + $('.filter-panel').click(function() { + let checkbox = $(this).find(".filter-checkbox"); + checkbox.prop("checked", !checkbox.prop("checked")); + checkbox.change(); + }); + + // If you click on one of the tags in the filter box, it unchecks the corresponding checkbox. + $('.filter-box-tag').click(function() { + let filterItem = this.dataset.filterItem; + let filterName = this.dataset.filterName; + let checkbox = $(`.filter-checkbox[data-filter-name='${filterName}'][data-filter-item='${filterItem}']`); + + removeFilter(filterName, filterItem); + checkbox.prop("checked", false); + }); + + // If you click on one of the tags in the resource cards, it clicks the corresponding checkbox. + $('.resource-tag').click(function() { + let filterItem = this.dataset.filterItem; + let filterName = this.dataset.filterName; + let checkbox = $(`.filter-checkbox[data-filter-name='${filterName}'][data-filter-item='${filterItem}']`); + + if (!$(this).hasClass("active")) { + addFilter(filterName, filterItem); + checkbox.prop("checked", true); + } else { + removeFilter(filterName, filterItem); + checkbox.prop("checked", false); + } + }); + + // When checkboxes are toggled, trigger a filter update. + $('.filter-checkbox').change(function () { + let filterItem = this.dataset.filterItem; + let filterName = this.dataset.filterName; + + if (this.checked) { + addFilter(filterName, filterItem); + } else { + removeFilter(filterName, filterItem); + } + }); +}); diff --git a/pydis_site/templates/base/base.html b/pydis_site/templates/base/base.html index 906fc577..b7322f12 100644 --- a/pydis_site/templates/base/base.html +++ b/pydis_site/templates/base/base.html @@ -24,10 +24,7 @@ <title>Python Discord | {% block title %}Website{% endblock %}</title> {% bulma %} - - {# Font-awesome here is defined explicitly so that we can have Pro #} - <script src="https://kit.fontawesome.com/ae6a3152d8.js"></script> - + {% font_awesome %} <link rel="stylesheet" href="{% static "css/base/base.css" %}"> {% block head %}{% endblock %} diff --git a/pydis_site/templates/base/navbar.html b/pydis_site/templates/base/navbar.html index 4b68dd6c..d7fb4f4c 100644 --- a/pydis_site/templates/base/navbar.html +++ b/pydis_site/templates/base/navbar.html @@ -67,9 +67,6 @@ <a class="navbar-item" href="{% url "resources:index" %}"> Resources </a> - <a class="navbar-item" href="{% url "resources:resources" category="tools" %}"> - Tools - </a> <a class="navbar-item" href="{% url "events:index" %}"> Events </a> @@ -79,6 +76,9 @@ <a class="navbar-item" href="{% url "content:page_category" location="frequently-asked-questions" %}"> FAQ </a> + <a class="navbar-item" href="{% url "content:page_category" location="guides" %}"> + Guides + </a> <a class="navbar-item" href="{% url 'home:timeline' %}"> Timeline </a> diff --git a/pydis_site/templates/content/base.html b/pydis_site/templates/content/base.html index 00f4fce4..4a19a275 100644 --- a/pydis_site/templates/content/base.html +++ b/pydis_site/templates/content/base.html @@ -7,7 +7,8 @@ <meta property="og:type" content="website" /> <meta property="og:description" content="{{ page_description }}" /> <link rel="stylesheet" href="{% static "css/content/page.css" %}"> - <script src="{% static "js/content/page.js" %}"></script> + <link rel="stylesheet" href="{% static "css/collapsibles.css" %}"> + <script src="{% static "js/collapsibles.js" %}"></script> {% endblock %} {% block content %} diff --git a/pydis_site/templates/resources/resource_box.html b/pydis_site/templates/resources/resource_box.html index af7c8d65..8f634333 100644 --- a/pydis_site/templates/resources/resource_box.html +++ b/pydis_site/templates/resources/resource_box.html @@ -1,6 +1,8 @@ {% load as_icon %} +{% load as_css_class %} +{% load get_category_icon %} -<div class="box" style="max-width: 800px;"> +<div class="box resource-box {{ resource.css_classes }}"> {% if 'title_url' in resource %} <a href="{{ resource.title_url }}"> {% include "resources/resource_box_header.html" %} @@ -9,14 +11,69 @@ {% include "resources/resource_box_header.html" %} {% endif %} - <p class="is-italic">{{ resource.description|safe }}</p> + <p>{{ resource.description|safe }}</p> - {# Icons #} - {% for icon in resource.urls %} - <span class="icon is-size-4 is-medium" style="margin: 5px;"> - <a href="{{ icon.url }}"> - <i class="{{ icon.icon|as_icon }} is-size-3 resource-icon is-{{ icon.color }}"></i> - </a> - </span> - {% endfor %} + <div class="is-flex is-align-items-center"> + {# Add primary link #} + {% if 'title_url' in resource %} + <span class="icon is-size-4 is-medium" style="margin: 5px;"> + <a href="{{ resource.title_url }}"> + <i class="fas fa-external-link-alt fa-fw is-size-3 resource-icon is-hoverable is-primary"></i> + </a> + </span> + {% endif %} + + {# Add all additional icon #} + {% for icon in resource.urls %} + <span class="icon is-size-4 is-medium" style="margin: 5px;"> + <a href="{{ icon.url }}"> + <i class="{{ icon.icon|as_icon }} fa-fw is-size-3 resource-icon is-hoverable is-{{ icon.color }}"></i> + </a> + </span> + {% endfor %} + + {# Tags #} + <div class="is-flex ml-auto is-flex-wrap-wrap is-justify-content-end"> + {% for tag in resource.tags.topics %} + <span + class="tag resource-tag is-primary is-light ml-2 mt-2" + data-filter-name="topics" + data-filter-item="{{ tag|as_css_class }}" + > + <i class="{{ tag|title|get_category_icon }} mr-1"></i> + {{ tag|title }} + </span> + {% endfor %} + {% for tag in resource.tags.type %} + <span + class="tag resource-tag has-background-success-light has-text-success-dark ml-2 mt-2" + data-filter-name="type" + data-filter-item="{{ tag|as_css_class }}" + > + <i class="{{ tag|title|get_category_icon }} mr-1"></i> + {{ tag|title }} + </span> + {% endfor %} + {% for tag in resource.tags.payment_tiers %} + <span + class="tag resource-tag has-background-danger-light has-text-danger-dark ml-2 mt-2" + data-filter-name="payment-tiers" + data-filter-item="{{ tag|as_css_class }}" + > + <i class="{{ tag|title|get_category_icon }} mr-1"></i> + {{ tag|title }} + </span> + {% endfor %} + {% for tag in resource.tags.difficulty %} + <span + class="tag resource-tag has-background-info-light has-text-info-dark ml-2 mt-2" + data-filter-name="difficulty" + data-filter-item="{{ tag|as_css_class }}" + > + <i class="{{ tag|title|get_category_icon }} mr-1"></i> + {{ tag|title }} + </span> + {% endfor %} + </div> + </div> </div> diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html index f1f487cf..dcf520f6 100644 --- a/pydis_site/templates/resources/resources.html +++ b/pydis_site/templates/resources/resources.html @@ -1,90 +1,152 @@ {% extends 'base/base.html' %} +{% load as_icon %} +{% load as_css_class %} +{% load get_category_icon %} {% load static %} {% block title %}Resources{% endblock %} {% block head %} - <link rel="stylesheet" href="{% static "css/resources/resources.css" %}"> + <link rel="stylesheet" href="{% static "css/resources/resources.css" %}"> + <link rel="stylesheet" href="{% static "css/collapsibles.css" %}"> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> + <script defer src="{% static "js/resources/resources.js" %}"></script> + <script defer src="{% static "js/collapsibles.js" %}"></script> {% endblock %} {% block content %} - {% include "base/navbar.html" %} + {% include "base/navbar.html" %} + <input type="hidden" id="resource-type-input" value="{{ resource_type }}"> + <section class="section"> + <div class="columns is-centered"> + {# Filtering toolbox #} + <div class="column is-one-third"> + <div class="content is-justify-content-center"> + <nav id="resource-filtering-panel" class="panel is-primary"> + <p class="panel-heading has-text-centered" id="filter-panel-header">Filter Resources</p> - <section class="section"> - <div class="container"> - <div class="content"> - <h1>Resources</h1> + {# Filter box tags #} + <div class="card filter-tags"> + <div class="is-flex ml-auto is-flex-wrap-wrap"> + {# A filter tag for when there are no filters active #} + <span class="no-tags-selected tag has-background-disabled has-text-disabled ml-2 mt-2"> + <i class="fas fa-ban mr-1"></i> + No filters selected + </span> - <div class="tile is-ancestor"> - <a class="tile is-parent" href="{% url "content:page_category" location="guides" %}"> - <article class="tile is-child box hero is-primary is-bold"> - <p class="title is-size-1"><i class="fad fa-info-circle" aria-hidden="true"></i> Guides</p> - <p class="subtitle is-size-4">Made by us, for you</p> - </article> - </a> + {% for filter_name, filter_data in filters.items %} + {% for filter_item in filter_data.filters %} + {% if filter_name == "Difficulty" %} + <span + class="filter-box-tag tag has-background-info-light has-text-info-dark ml-2 mt-2" + data-filter-name="{{ filter_name|as_css_class }}" + data-filter-item="{{ filter_item|as_css_class }}" + > + <i class="{{ filter_item|title|get_category_icon }} mr-1"></i> + {{ filter_item|title }} + <button class="delete is-small is-info has-background-info-light"></button> + </span> + {% endif %} + {% if filter_name == "Type" %} + <span + class="filter-box-tag tag has-background-success-light has-text-success-dark ml-2 mt-2" + data-filter-name="{{ filter_name|as_css_class }}" + data-filter-item="{{ filter_item|as_css_class }}" + > + <i class="{{ filter_item|title|get_category_icon }} mr-1"></i> + {{ filter_item|title }} + <button class="delete is-small is-success has-background-success-light"></button> + </span> + {% endif %} + {% if filter_name == "Payment tiers" %} + <span + class="filter-box-tag tag has-background-danger-light has-text-danger-dark ml-2 mt-2" + data-filter-name="{{ filter_name|as_css_class }}" + data-filter-item="{{ filter_item|as_css_class }}" + > + <i class="{{ filter_item|title|get_category_icon }} mr-1"></i> + {{ filter_item|title }} + <button class="delete is-small is-danger has-background-danger-light"></button> + </span> + {% endif %} + {% if filter_name == "Topics" %} + <span + class="filter-box-tag tag is-primary is-light ml-2 mt-2" + data-filter-name="{{ filter_name|as_css_class }}" + data-filter-item="{{ filter_item|as_css_class }}" + > + <i class="{{ filter_item|title|get_category_icon }} mr-1"></i> + {{ filter_item|title }} + <button class="delete is-small is-primary has-background-primary-light"></button> + </span> + {% endif %} + {% endfor %} + {% endfor %} + </div> + </div> - <div class="tile is-vertical is-9"> - <div class="tile"> - <a class="tile is-8 is-parent" href="{% url "resources:resources" category="reading" %}"> - <article class="tile is-child box hero is-black" id="readingBlock"> - <p class="title is-size-1"><i class="fad fa-book-alt" aria-hidden="true"></i> Read</p> - <p class="subtitle is-size-4">Lovingly curated books to explore</p> - </article> - </a> + {# Filter checkboxes #} + {% for filter_name, filter_data in filters.items %} + <div class="card filter-category-header"> + <button type="button" class="card-header collapsible"> + <span class="card-header-title subtitle is-6 my-2 ml-2"> + <i class="fa-fw {{ filter_data.icon }} is-primary" aria-hidden="true"></i>  {{ filter_name }} + </span> + <span class="card-header-icon"> + {% if not filter_data.hidden %} + <i class="far fa-fw fa-window-minimize is-6 title" aria-hidden="true"></i> + {% else %} + <i class="fas fa-fw fa-angle-down is-6 title" aria-hidden="true"></i> + {% endif %} + </span> + </button> - <div class="tile"> - <a class="tile is-parent" href="{% url "resources:resources" category="videos" %}"> - <article class="tile is-child box hero is-danger is-bold"> - <p class="title is-size-1"><i class="fad fa-video" aria-hidden="true"></i> Watch</p> - <p class="subtitle is-size-4">Visually engaging</p> - </article> - </a> - </div> - </div> + {# Checkboxes #} + {% if filter_data.hidden %} + <div class="collapsible-content"> + {% else %} + <div class="collapsible-content" style="max-height: fit-content;"> + {% endif %} + <div class="card-content"> + {% for filter_item in filter_data.filters %} + <a class="panel-block filter-panel"> + <label class="checkbox"> + <input + class="filter-checkbox" + type="checkbox" + data-filter-name="{{ filter_name|as_css_class }}" + data-filter-item="{{ filter_item|as_css_class }}" + > + {{ filter_item }} + </label> + </a> + {% endfor %} + </div> + </div> + </div> + {% endfor %} + </nav> + </div> + </div> - <div class="tile"> - <a class="tile is-parent" href="{% url "resources:resources" category="interactive" %}"> - <article class="tile is-child box hero is-black" id="interactiveBlock"> - <p class="title is-size-1"><i class="fad fa-code" aria-hidden="true"></i> Try</p> - <p class="subtitle is-size-4">Interactively discover the possibilities</p> - </article> - </a> - <a class="tile is-8 is-parent" href="{% url "resources:resources" category="courses" %}"> - <article class="tile is-child box hero is-success is-bold"> - <p class="title is-size-1"><i class="fad fa-graduation-cap" aria-hidden="true"></i> Learn</p> - <p class="subtitle is-size-4">Structured courses with clear goals</p> - </article> - </a> - </div> - </div> - </div> + <div class="column is-two-thirds"> + {# Message to display when there are no hits #} + <div class="no-resources-found"> + <h2 class="title is-3 has-text-centered pt-0 pb-6">No matching resources found!</h2> + <img src="{% static "images/resources/duck_pond_404.png" %}" width="650px"> + </div> - <div class="tile is-ancestor"> - <div class="tile is-vertical is-9"> - <div class="tile"> - <a class="tile is-8 is-parent" href="{% url "resources:resources" category="communities" %}"> - <article class="tile is-child box hero is-black" id="communitiesBlock"> - <p class="title is-size-1"><i class="fad fa-users" aria-hidden="true"></i> Communities</p> - <p class="subtitle is-size-4">Some of our best friends</p> - </article> - </a> - <div class="tile"> - <a class="tile is-parent" href="{% url "resources:resources" category="podcasts" %}"> - <article class="tile is-child box hero is-black" id="podcastsBlock"> - <p class="title is-size-1"><i class="fad fa-podcast" aria-hidden="true"></i> Listen</p> - <p class="subtitle is-size-4">Regular podcasts to follow</p> - </article> - </a> - </div> - </div> - </div> - <a class="tile is-parent" href="{% url "resources:resources" category="tools" %}"> - <article class="tile is-child box hero is-dark"> - <p class="title is-size-1"><i class="fad fa-tools" aria-hidden="true"></i> Tools</p> - <p class="subtitle is-size-4">Things we love to use</p> - </article> - </a> - </div> - </div> - </div> - </section> + + {# Resource cards #} + <div class="content is-flex is-justify-content-center"> + <div> + {% for resource in resources.values %} + {% include "resources/resource_box.html" %} + {% endfor %} + </div> + </div> + </div> + </div> + </section> {% endblock %} + + diff --git a/pydis_site/templates/resources/resources_list.html b/pydis_site/templates/resources/resources_list.html deleted file mode 100644 index e2be3cb7..00000000 --- a/pydis_site/templates/resources/resources_list.html +++ /dev/null @@ -1,52 +0,0 @@ -{% extends "base/base.html" %} -{% load as_icon %} -{% load static %} - -{% block title %}{{ category_info.name }}{% endblock %} -{% block head %} - <link rel="stylesheet" href="{% static "css/resources/resources_list.css" %}"> -{% endblock %} - -{% block content %} - {% include "base/navbar.html" %} - - <section class="section breadcrumb-section"> - <div class="container"> - <nav class="breadcrumb is-pulled-left" aria-label="breadcrumbs"> - <ul> - <li><a href="{% url "resources:index" %}">Resources</a></li> - <li class="is-active"><a href="#">{{ category_info.name }}</a></li> - </ul> - </nav> - </div> - </section> - - <section class="section"> - <div class="container"> - <div class="content"> - <h1>{{ category_info.name }}</h1> - <p>{{ category_info.description|safe }}</p> - <div> - {% for resource in resources|dictsort:"position" %} - {% include "resources/resource_box.html" %} - {% endfor %} - - {% for subcategory in subcategories|dictsort:"category_info.position" %} - <h2 id="{{ subcategory.category_info.raw_name }}"> - <a href="{% url "resources:resources" category=category_info.raw_name %}#{{ subcategory.category_info.raw_name }}"> - {{ subcategory.category_info.name }} - </a> - </h2> - <p>{{ subcategory.category_info.description|safe }}</p> - - {% for resource in subcategory.resources|dictsort:"position" %} - {% with category_info=subcategory.category_info %} - {% include "resources/resource_box.html" %} - {% endwith %} - {% endfor %} - {% endfor %} - </div> - </div> - </div> - </section> -{% endblock %} |