From 1bb2b87679fb862ae20c5e73db6d2d4ed036e728 Mon Sep 17 00:00:00 2001 From: "Kevin C. Moore" Date: Sun, 16 Feb 2025 01:30:19 +0000 Subject: [PATCH] Test main.py --- .github/workflows/ci.yml | 6 +++++- docs/pinning-libraries.md | 2 +- docs/requesting-content.md | 6 +++--- main.py | 17 +++++++++++++++++ mkdocs.yml | 13 ++++--------- 5 files changed, 30 insertions(+), 14 deletions(-) create mode 100644 main.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f72d529..568b277 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,4 +45,8 @@ jobs: pip install -r requirements.txt pip install git+https://github.com/SivagiriVisakan/mkdocs-replace-plugin.git - - run: mkdocs gh-deploy --force + - name: Build and Deploy + env: + GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }} + GITHUB_REPOSITORY: ${{ github.repository }} + run: mkdocs gh-deploy --force diff --git a/docs/pinning-libraries.md b/docs/pinning-libraries.md index 5772942..ce476d2 100644 --- a/docs/pinning-libraries.md +++ b/docs/pinning-libraries.md @@ -2,7 +2,7 @@ After accepting your invitation to my Plex server, you'll need to pin my shared libraries to your sidebar. This is a required step - without it, you might only see Plex's default content instead of my media collection. Here's what you need to know: -1. Look for "{{ meta.username }}'s Plex" in your media sources +1. Look for "{{ username }}'s Plex" in your media sources 2. You'll see two libraries: Movies and TV Shows 3. Pin both of these libraries to your sidebar diff --git a/docs/requesting-content.md b/docs/requesting-content.md index 09ecf5a..232cb28 100644 --- a/docs/requesting-content.md +++ b/docs/requesting-content.md @@ -2,17 +2,17 @@ You can request new Movies or TV Shows in two ways: -1. Visit [{{ config.extra.site.request_url }}](https://{{ config.extra.site.request_url }}) to make direct requests. These are typically approved within 10-15 minutes, and if the content has been released digitally, it will be ready to stream on Plex within 10 minutes. +1. Visit [{{ request_url }}](https://{{ request_url }}) to make direct requests. These are typically approved within 10-15 minutes, and if the content has been released digitally, it will be ready to stream on Plex within 10 minutes. 2. Add content to your Plex Universal Watchlist, and it will be automatically requested for you. !!! important - For the auto-request feature to work with your Watchlist, you must log into {{ config.extra.site.request_url }} at least once every 90 days. If you don't log in regularly, the system won't be able to see your Watchlist, and I won't know what content you're waiting for. + For the auto-request feature to work with your Watchlist, you must log into {{ request_url }} at least once every 90 days. If you don't log in regularly, the system won't be able to see your Watchlist, and I won't know what content you're waiting for. ## Additional Information For more details about requesting content, check out these FAQ pages: - [Responsible Content Requesting](faq/responsible-content-requests.md) - Understanding how the server works and best practices when requesting content -- [I requested something an hour ago but it hasn't shown up yet. Why?](faq/missing-requests.md) - Release dates and availability within {{ config.extra.site.request_url }} +- [I requested something an hour ago but it hasn't shown up yet. Why?](faq/missing-requests.md) - Release dates and availability within {{ request_url }} - [I'm having a problem with a Movie or TV Show](faq/content-issues.md) - Reporting issues with Movies or TV Shows - [Content Quality and Language Options](faq/special-requests.md) - Media quality defaults, language tracks, and special content requests - [I don't want to use this request thingy, can't I just text you what I want?](faq/i-dont-want-to-use-overseerr.md) - Why we use a request system diff --git a/main.py b/main.py new file mode 100644 index 0000000..8c2dade --- /dev/null +++ b/main.py @@ -0,0 +1,17 @@ +import os + +def define_env(env): + """ + This hook is called when the config is loading. + """ + # Get environment variables with fallbacks + username = os.getenv('GITHUB_REPOSITORY_OWNER', 'Ghost') + repo_name = os.getenv('GITHUB_REPOSITORY', 'mkdocs-plex-guide-template').split('/')[-1] + + # Add them to the macros environment + env.variables.update({ + "username": username, + "repo_name": repo_name, + "request_url": "request.example.com", + "domain": "example.com" + }) diff --git a/mkdocs.yml b/mkdocs.yml index 0b67c17..89a33a3 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,5 +1,5 @@ -site_name: "{{ config.extra.site.username }}.github.io" -site_url: "https://{{ config.extra.site.username }}.github.io" +site_name: "{{ username }}.github.io" +site_url: "https://{{ username }}.github.io" theme: name: material logo: assets/images/plex-logo.webp @@ -69,7 +69,7 @@ plugins: - mkdocs-video - git-revision-date-localized - git-committers: - repository: !ENV [GITHUB_REPOSITORY, "your-username/your-repo"] + repository: "{{ username }}/{{ repo_name }}" branch: main - macros @@ -93,7 +93,7 @@ markdown_extensions: emoji_index: !!python/name:material.extensions.emoji.twemoji emoji_generator: !!python/name:material.extensions.emoji.to_svg -copyright: "Copyright © {{ page.meta.git_creation_date_localized.year }} {{ config.extra.site.username }}" +copyright: "Copyright © {{ git.date.year }} {{ username }}" extra_css: - stylesheets/extra.css @@ -109,8 +109,3 @@ extra: - icon: fontawesome/solid/globe link: "https://{{ config.extra.site.username }}.github.io" name: Personal Website - site: - username: !ENV [GITHUB_REPOSITORY_OWNER, "Ghost"] - repo_name: !ENV [GITHUB_REPOSITORY_NAME, "mkdocs-plex-guide-template"] - domain: "example.com" - request_url: "request.example.com"