diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..5c9cf1569 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +node_modules +.git +.gitignore +dist +cache diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 191ec88f4..9f826fd1c 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,132 +1,123 @@ -# How to Edit FMHY +# Contribute Guide -There are multiple ways you can contribute to this repository: -- [Link submissions](#submitting-a-link) -- [Reporting a site](#reporting-a-site) -- [Changes to the website itself](#making-changes) -- [Finding new sites](https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/find-new-sites/) +> [!INFO] NOTE +> Some of these steps are easier if you're in our [Discord](https://rentry.co/fmhy-invite). It opens every Friday. -## Submitting a Link +Here you'll find some general guidelines for those who would like to start contributing. There are multiple ways to do this: -> [!NOTE] -> If you haven't tested the link you'd like to submit, especially if it's a DDL site, please open an **[Issue](https://github.com/fmhy/edit/issues)** or reach out to us on **[Discord](https://rentry.co/fmhy-invite)** rather than making a Pull Request. +- [Link Submissions](#additions) +- [Reporting an Existing Site](#reporting-a-site) +- [How to Edit and Preview Changes](#making-changes) +- [Finding New Sites](https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/find-new-sites/) -1. Before submitting a link, please **[search](https://redd.it/105xraz)** to make sure it's not already in the wiki. +## Submissions -2. The order of priority is: **Site > Git Repository > Store Link** -Please only use the store link if there's neither a site nor a Git repository available for the app/extension you'd like to submit. +> [!INFO] NOTE +> For bigger changes to the wiki, such as debloating efforts or the restructuring of a page/section, you must first discuss these with us via [Discord](https://rentry.co/fmhy-invite) before opening a [Pull Request](https://github.com/fmhy/edit/pulls). -3. Always check to see if the site you'd like to submit has a Discord / Telegram server you can link with it. +**Don't submit any of the following:** -4. Find a suitable category for the link and then submit it by making a **[Pull Request](https://github.com/fmhy/edit/pulls)**. +- **đŸ’°ī¸ Paid / Trial Sites** - We don't accept any paid or free trial only entries, with the exception of select paid [VPNs](/adblockvpnguide#vpn) and [Debrid](/downloadpiracyguide#leeches-debrid). +- **đŸ•šī¸ Emulators** - Already listed on [Index Sites](/gamingpiracyguide#emulators). +- **🌐 Web Browsers** - Already listed on [Comparison / Index Sites](/internet-tools#browser-tools). However, we accept privacy-based ones as well as normal mobile browsers. +- **đŸ”ģ Leeches** - Unless it's not already listed on existing [Leech Lists](/downloadpiracyguide#leeches-debrid), don't submit these. +- **🐧 Linux Distros** - Already listed on [Index Sites](/linuxguide#linux-distros). +- **🌍 Non-english Software** - We don't add non-english software sites (APKs, games, torrents, etc.) unless they have a very good reputation. +- **đŸ—‚ī¸ Coding Libraries** - There's too many of them and there are better places to find them. +- **🎲 Mining / Betting Sites** - Don't submit anything related to betting, mining, BINs, CCs, etc. +- **🎮 Multiplayer Hacks** - Don't submit any hacks or exploits that give an unfair advantage in multiplayer games. +- **đŸ–Ĩī¸ Custom OSs** - We don't recommend people use these. -#### Don't Submit: +### Adding a Site -**đŸ•šī¸ Emulators**: -They're already on the **[Game Tech Wiki](https://emulation.gametechwiki.com/index.php/Main_Page)**. +For submitting new links, follow these steps: -**đŸ”ģ Leeches**: -They're already on the **[File Hosting Wiki](https://filehostlist.miraheze.org/wiki/Free_Premium_Leeches)**. +- Make sure it's not already in the wiki. The easiest way to do this is to check our [Single Page](https://api.fmhy.net/single-page) using `ctrl+f`. +- Reach out via the feedback system, by opening an [Issue](https://github.com/fmhy/edit/issues), or join our [Discord](https://rentry.co/fmhy-invite). +- You can optionally include socials, tools, or any other additional info alongside the entry. +- Avoid opening pull requests. See [Link Testing](#link-testing) for more info. -**🐧 Distros**: -They're already on **[DistroWatch](https://distrowatch.com/)**. +### Reporting a Site -**🎲 Mining / Betting Sites**: -Don't post anything related to betting, mining, BINs, CCs, etc. +> [!INFO] NOTE +> If it's urgent, you're allowed to request an invite via our feedback system. -**🎮 Multiplayer Game Hacks**: -Don't post any hacks/exploits that give unfair advantages in multiplayer games. +For changes to existing entries, follow these steps: -**đŸ–Ĩī¸ Custom Operating Systems** -We don't recommend people use these. +- Reach out via any of the available methods, including opening a [Pull Request](https://github.com/fmhy/edit/pulls). +- Feel free to leave contact info when using the feedback system, if needed. Only trusted staff can view this. +- If you'd like to report a site removal or star change, you must include details as to why your changes should be accepted. -## Reporting a Site +### Link Testing -> [!TIP] -> If you want to make bigger changes to the wiki, such as debloating or restructuring a page/section, please discuss those changes with us via **[Discord](https://rentry.co/fmhy-invite)** before making a **[Pull Request](https://github.com/fmhy/edit/pulls)**. +All additions have to first go through our testing process on [Discord](https://rentry.co/fmhy-invite). -You can do one of the following: +You can help us test new sites to figure out their use-case, safety, and whether they'd be a good fit for the wiki. -- Open an **[Issue](https://github.com/fmhy/edit/issues)** or a **[Pull Request](https://github.com/fmhy/edit/pulls)** and don't forget to explain why you think the site(s) in question should be removed, unstarred, and/or changed. +Keep in mind certain sites (such as piracy sites) require more testing/vetting before they can be added. -- Alternatively, you can reach out to us on **[Discord](https://rentry.co/fmhy-invite)** if you're unsure whether the site should be reported or if you'd like to discuss your report with more people. +### Formatting Rules -## Making changes +The wiki will always have some variation either due to exceptions being made, the layout/structure, or the flexible nature of markdown itself. -If you want to make changes with instant site feedback, or are simply going to work with the site, you can do so with these 3 ways: +For these reasons, there are too many conditions and nuances to satisfy to make an easy-to-follow guide. However, you can generally get an idea by looking at how existing links are structured. -- [Using gitpod.io or GitHub Codespaces (recommended)](#using-gitpod-or-github-codespaces) -- [Using the GitHub editor](#using-the-github-editor) -- [Manually setting up a development environment](#manually-setting-up-a-development-environment) +If you're unsure, ask in the wiki channels on [Discord](https://rentry.co/fmhy-invite) and wait for a staff member to reply. -> [!TIP] -> You can just use our [đŸ’Ŧ Discord](https://rentry.co/fmhy-invite) to send us sites or any changes. +## Making Changes -### Using Gitpod or GitHub Codespaces +Instructions on various ways to edit the wiki and preview changes. -You can use either [gitpod.io](https://gitpod.io/) or [GitHub Codespaces](https://github.com/features/codespaces) to edit the wiki. +### GitHub Editor -Follow these steps: +You can use the build-in web editor in two ways: -1. Fork the repository by clicking the "Fork" button in the top right corner. +1. Find the file you want to edit, look for the edit icon (of a pencil) and click on it, then make your changes. -2. Now, to make changes, you can either use gitpod.io or GitHub Codespaces. + ![Edit Button](https://files.catbox.moe/7w3hnm.png) -#### Gitpod.io +2. When you're done, click "Commit Changes..." then "Propose changes". Optionally add a commit description. -Login to your GitHub account and click on the "New Workspace" button. Then select your fork and you should be in your gitpod workspace. +3. You should now see a comparison page showing all your edits. Click "Create pull request", fill in the box describing your changes, then hit submit. -To close the workspace, click on the "Gitpod" button at the bottom left corner then type "Stop Workspace" and hit enter. +**OR** + +1. Fork the repository by clicking the "Fork" button in the top right. + +2. Navigate to your fork's homepage and press the `.` (period) key on your keyboard. This will open the repository in a VSCode-like environment on `github.dev`. + +3. Make your changes, then commit via the source control tab. + + ![Source Control](https://files.catbox.moe/pa571v.png) + +4. Back on your fork's homepage, click "Contribute" then "Open pull request". + +5. You should now see a comparison page showing all your edits. Click "Create pull request", fill in the box describing your changes, then hit submit. + +### Dev Environment + +If you're going to work on the site itself, or simply want to preview the site and any changes, you can do so by setting up a development environment. #### GitHub Codespaces -Click on the "Code" button on the top right corner of the page and select "Codespaces" from the dropdown menu. +This creates an environment in the browser [(with 60h/month free quota)](https://docs.github.com/en/billing/managing-billing-for-your-products/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts). To use Codespaces, follow these steps: -To close the workspace, click on the "Code" button at the top right corner then click on "Stop Codespace" and hit enter. +1. Fork the repository by clicking the "Fork" button in the top right. -### Using the GitHub editor +2. Navigate to your fork's homepage and click on the green "Code" button above your repository, open "Codespaces" tab and click "Create codespace". -1. Fork the repository by clicking the "Fork" button in the top right corner. You can open your repository in a VSCode-like environment by pressing `.` (dot) in your fork's homepage which will take you to `github.dev`. +3. You may have to wait ~5-10 minutes for the codespace to load. -2. Find the file you want to edit. Find the "Edit" icon (of a pencil) and click on it. -Select edit button and make your changes. -![Select edit button](https://i.imgur.com/lnQfeo3.png) + ![Codespace Status](https://files.catbox.moe/5bp38f.png) -3. Scroll down and select "Propose changes", and "Create Pull Request" on the next page, and don't forget to explain why you think the site(s) in question should be removed, unstarred, and/or changed. +4. Once it has loaded, run `pnpm i && pnpm docs:dev` to start the preview. Then when it appears, click "Open in Browser" in the bottom right. -![propose changes](https://i.imgur.com/IaSJvnO.png) -![create pull request](https://i.imgur.com/z5Za72l.png) +5. Make your changes and commit. -### Manually setting up a development environment +6. To shut it down, click the "Code" button again and look for the `...` dropdown next to your codespace, then click "Stop codespace". -#### Manually +#### Local Instance -1. Fork the repository by clicking the "Fork" button in the top right corner. +Making changes on a local repository may require a basic understanding of Git. You can find learning resources [here](/edupiracyguide#developer-learning). -2. Make sure you have [Node.js](https://nodejs.org/en/), [pnpm](https://pnpm.io/), [git](https://git-scm.com/), and [VSCode](https://code.visualstudio.com/) or any other editor installed. Alternatively, `pnpm` has `pnpm env` you can use to manage Node. - -3. Clone your forked repository to your local machine. - -4. Open the cloned repository in your editor of choice. Find the file you want to work on, make changes. - -5. Add your changes with git (`git add `) and commit (`git commit -m "commit message"`), then push them (`git push`). - -6. Create a pull request by clicking the "New Pull Request" button in your forked repository, and don't forget to explain why you think the site(s) in question should be removed, unstarred, and/or changed. - -#### Nix - -You can use [nix](https://nixos.org/) to set up a development environment, we have a [flake](https://nixos.wiki/wiki/Flakes) that setups `nodejs` and `pnpm`. - -1. Fork the repository by clicking the "Fork" button in the top right corner and clone your forked repository to your local machine. - -2. Run `nix flake update` to update the flake lock file. - -3. Run `nix develop` to enter the development environment. - -4. Make changes. - -5. Exit the development environment by running `exit`. - -6. Commit your changes and push them to your forked repository. - -7. Create a pull request by clicking the "New Pull Request" button in your forked repository, and don't forget to explain why you think the site(s) in question should be removed, unstarred, and/or changed. +More info on manual setup can be found [here](/other/selfhosting). \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/wiki.yml b/.github/ISSUE_TEMPLATE/wiki.yml index 5cf6f461c..17cf6c819 100644 --- a/.github/ISSUE_TEMPLATE/wiki.yml +++ b/.github/ISSUE_TEMPLATE/wiki.yml @@ -1,6 +1,6 @@ name: Create Issue description: 'Help us improve FMHY for everyone' -title: '' +title: 'Issue form title' body: - type: markdown attributes: diff --git a/.github/README.md b/.github/README.md index 772d07351..d9741c4a8 100644 --- a/.github/README.md +++ b/.github/README.md @@ -9,6 +9,7 @@ - Website: [fmhy.net](https://fmhy.net) - News & Monthly Updates: [fmhy.net/posts](https://fmhy.net/posts) - Backups: [github.com/fmhy/FMHY/wiki/Backups](https://github.com/fmhy/FMHY/wiki/Backups) +- Neither the site or github host any files ## đŸ—ēī¸ Emoji Legend diff --git a/.github/workflows/deploy-gh-pages.yml b/.github/workflows/deploy-gh-pages.yml index 8a1d9e4e5..4f10001f7 100644 --- a/.github/workflows/deploy-gh-pages.yml +++ b/.github/workflows/deploy-gh-pages.yml @@ -1,8 +1,6 @@ name: Deploy to GitHub Pages on: - push: - branches: [main] workflow_dispatch: permissions: diff --git a/.licenserc.json b/.licenserc.json index 9464af5b3..603aa6ef9 100644 --- a/.licenserc.json +++ b/.licenserc.json @@ -1,7 +1,7 @@ { "**/*.ts": [ "/**", - "* Copyright (c) taskylizard. All rights reserved.", + "* Copyright (c) 2025 taskylizard. Apache License 2.0.", "*", "* Licensed under the Apache License, Version 2.0 (the \"License\");", "* you may not use this file except in compliance with the License.", @@ -16,6 +16,15 @@ "* limitations under the License.", "*/" ], + "**/*.css": [ + "/**", + "* Copyright (c) 2025 taskylizard. Apache License 2.0.", + "* Licensed under the Apache License, Version 2.0 (the \"License\");", + "* you may not use this file except in compliance with the License.", + "* You may obtain a copy of the License at", + "* http://www.apache.org/licenses/LICENSE-2.0", + "*/" + ], "ignore": [ "node_modules", "dist", diff --git a/.mise.toml b/.mise.toml index 5d3cdd5a1..e71cb5c92 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,6 +1,7 @@ # https://github.com/vitejs/vite/issues/17291 [tools] -node = "21" +node = "latest" +pnpm = "latest" [tasks] d = "nrr docs:dev --host" diff --git a/.stylelintrc.json b/.stylelintrc.json deleted file mode 100644 index eff256099..000000000 --- a/.stylelintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "stylelint-config-standard-scss" -} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..6aecc882d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM node:21-slim AS base +ENV PNPM_HOME="/pnpm" +ENV PATH="$PNPM_HOME:$PATH" +RUN corepack enable +COPY . /app +WORKDIR /app + +FROM base AS prod-deps +RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile + +FROM base AS build +RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile +RUN pnpm run docs:build + +FROM base +COPY --from=prod-deps /app/node_modules /app/node_modules +COPY --from=build /app/docs/.vitepress/dist /app/docs/.vitepress/dist + +EXPOSE 4173 + +CMD ["pnpm", "docs:preview"] diff --git a/api/README.md b/api/README.md index f6060fbdd..eb28136e6 100644 --- a/api/README.md +++ b/api/README.md @@ -1,6 +1,3 @@ -> [!NOTE] -> The website is no longer receiving new features and is now in maintenance mode. Please refrain from opening issues or pull requests. - This is the API for the website and other related services. Licensed under the Apache License v2.0, see [LICENSE](../docs/.vitepress/LICENSE) for more information. diff --git a/api/middleware/cors.ts b/api/middleware/cors.ts index a625b8bb4..801fb83cb 100644 --- a/api/middleware/cors.ts +++ b/api/middleware/cors.ts @@ -1,5 +1,5 @@ /** - * Copyright (c) taskylizard. All rights reserved. + * Copyright (c) 2025 taskylizard. Apache License 2.0. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/api/middleware/ratelimit.ts b/api/middleware/ratelimit.ts index 200319b49..6b6628d9c 100644 --- a/api/middleware/ratelimit.ts +++ b/api/middleware/ratelimit.ts @@ -1,3 +1,18 @@ +/** + * Copyright (c) 2025 taskylizard. Apache License 2.0. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ export default defineEventHandler(async (event) => { const { cloudflare } = event.context diff --git a/api/routes/feedback.post.ts b/api/routes/feedback.post.ts index 4ab75db60..34b78218f 100644 --- a/api/routes/feedback.post.ts +++ b/api/routes/feedback.post.ts @@ -1,5 +1,5 @@ /** - * Copyright (c) taskylizard. All rights reserved. + * Copyright (c) 2025 taskylizard. Apache License 2.0. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/api/routes/index.ts b/api/routes/index.ts index 23956fa80..4d2c0440a 100644 --- a/api/routes/index.ts +++ b/api/routes/index.ts @@ -1,5 +1,5 @@ /** - * Copyright (c) taskylizard. All rights reserved. + * Copyright (c) 2025 taskylizard. Apache License 2.0. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/api/routes/single-page.ts b/api/routes/single-page.ts index b36e305d7..8561406bc 100644 --- a/api/routes/single-page.ts +++ b/api/routes/single-page.ts @@ -1,5 +1,5 @@ /** - * Copyright (c) taskylizard. All rights reserved. + * Copyright (c) 2025 taskylizard. Apache License 2.0. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/api/tsconfig.json b/api/tsconfig.json index ab45f2118..378657471 100644 --- a/api/tsconfig.json +++ b/api/tsconfig.json @@ -1,8 +1,6 @@ { "extends": "../.nitro/types/tsconfig.json", "compilerOptions": { - "types": [ - "@cloudflare/workers-types" - ] + "types": ["@cloudflare/workers-types"] } } diff --git a/api/worker-configuration.d.ts b/api/worker-configuration.d.ts index b6e97d8f0..a4ffc8a3a 100644 --- a/api/worker-configuration.d.ts +++ b/api/worker-configuration.d.ts @@ -1,6 +1,21 @@ +/** + * Copyright (c) 2025 taskylizard. Apache License 2.0. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ // Generated by Wrangler by running `wrangler types api/worker-configuration.d.ts` interface Env { - STORAGE: KVNamespace; - RATE_LIMITER: RateLimit; + STORAGE: KVNamespace + RATE_LIMITER: RateLimit } diff --git a/biome.json b/biome.json deleted file mode 100644 index 352c3f444..000000000 --- a/biome.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", - "extends": [ - "@taskylizard/biome-config", - "./.cache/imports.json" - ], - "files": { - "ignore": [ - "docs/.vitepress/**/*.vue", - "docs/.vitepress/vue-shim.d.ts", - ".cache/imports.d.ts" - ] - }, - "formatter": { - "enabled": false - }, - "css": { - "linter": { - "enabled": false - }, - "formatter": { - "enabled": false - } - }, - "json": { - "formatter": { - "enabled": false - }, - "linter": { - "enabled": false - } - }, - "vcs": { - "enabled": true, - "clientKind": "git" - }, - "javascript": { - "globals": [ - "defineNitroConfig", - "eventHandler", - "useRuntimeConfig", - "readValidatedBody", - "defineEventHandler" - ] - }, - "linter": { - "rules": { - "correctness": { - "noUndeclaredVariables": "off" - }, - "style": { - "useFilenamingConvention": "off", - "noDefaultExport": "off" - } - } - } -} diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 000000000..ebe39cf5b --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,14 @@ +services: + docs: + networks: [fmhy] + build: + context: . + dockerfile: Dockerfile + image: fmhy-docs + container_name: docs + restart: unless-stopped + ports: + - '4173:4173' + +networks: + fmhy: diff --git a/docs/.vitepress/README.md b/docs/.vitepress/README.md index d65eea6c0..e2da1674c 100644 --- a/docs/.vitepress/README.md +++ b/docs/.vitepress/README.md @@ -1,6 +1,3 @@ -> [!NOTE] -> The website is no longer receiving new features and is now in maintenance mode. Please refrain from opening issues or pull requests. - This is the website source code to be used with [VitePress](https://vitepress.dev/). Licensed under the Apache License v2.0, see [LICENSE](./LICENSE) for more information. diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 90b5d533d..dd395e66a 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -18,7 +18,7 @@ import { generateFeed, generateImages, generateMeta } from './hooks' import { defs, emojiRender, movePlugin } from './markdown/emoji' import { headersPlugin } from './markdown/headers' import { toggleStarredPlugin } from './markdown/toggleStarred' -import { transforms } from './transformer' +import { transformsPlugin } from './transformer' // @unocss-include @@ -53,7 +53,7 @@ export default defineConfig({ 'meta', { name: 'msvalidate.01', - content: '55ae5a0600A8C7827B59CFD506D76DC2' + content: 'F3028112EF6F929B562F4B18E58E3691' } ], // Google site verification @@ -116,7 +116,7 @@ export default defineConfig({ filepath: './.cache/imports.json' } }), - transforms(), + transformsPlugin(), { name: 'custom:adjust-order', configResolved(c) { @@ -145,14 +145,16 @@ export default defineConfig({ config(md) { md.use(emojiRender) md.use(toggleStarredPlugin) - md.use(headersPlugin) + meta.build.api && md.use(headersPlugin) } }, themeConfig: { search, footer: { message: `${feedback} (rev: ${commitRef})`, - copyright: `Š ${new Date().getFullYear()}, <a href="https://i.ibb.co/pLVXBSh/image.png">Estd 2018.</a>` + copyright: + `Š ${new Date().getFullYear()}, <a href="https://i.ibb.co/VJQmQ9t/image.png">Estd 2018.</a>` + + `<br/> This site does not host any files.` }, editLink: { pattern: 'https://github.com/fmhy/edit/edit/main/docs/:path', diff --git a/docs/.vitepress/constants.ts b/docs/.vitepress/constants.ts index 0bd7bd962..b9baf63b1 100644 --- a/docs/.vitepress/constants.ts +++ b/docs/.vitepress/constants.ts @@ -1,5 +1,5 @@ /** - * Copyright (c) taskylizard. All rights reserved. + * Copyright (c) 2025 taskylizard. Apache License 2.0. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ */ import type { DefaultTheme } from 'vitepress' +import consola from 'consola' import { transform, transformGuide } from './transformer' // @unocss-include @@ -23,14 +24,31 @@ export const meta = { name: 'freemediaheckyeah', description: 'The largest collection of free stuff on the internet!', hostname: 'https://fmhy.net', - keywords: ['stream', 'movies', 'gaming', 'reading', 'anime'] + keywords: ['stream', 'movies', 'gaming', 'reading', 'anime'], + build: { + api: true, + nsfw: true + } } +if (process.env.FMHY_BUILD_NSFW === 'false') { + consola.info('FMHY_BUILD_NSFW is set to false, disabling NSFW content') + meta.build.nsfw = false +} +if (process.env.FMHY_BUILD_API === 'false') { + consola.info('FMHY_BUILD_API is set to false, disabling API component') + meta.build.api = false +} + +const formatCommitRef = (commitRef: string) => + `<a href="https://github.com/fmhy/edit/commit/${commitRef}">${commitRef.slice(0, 8)}</a>` + export const commitRef = process.env.CF_PAGES && process.env.CF_PAGES_COMMIT_SHA - ? `<a href="https://github.com/fmhy/edit/commit/${process.env.CF_PAGES_COMMIT_SHA - }">${process.env.CF_PAGES_COMMIT_SHA.slice(0, 8)}</a>` - : 'dev' + ? formatCommitRef(process.env.CF_PAGES_COMMIT_SHA) + : process.env.COMMIT_REF + ? formatCommitRef(process.env.COMMIT_REF) + : 'dev' export const feedback = `<a href="/feedback" class="feedback-footer">Made with ❤</a>` @@ -113,24 +131,17 @@ export const socialLinks: DefaultTheme.SocialLink[] = [ { icon: 'github', link: 'https://github.com/fmhy/edit' }, { icon: 'discord', link: 'https://rentry.co/fmhy-invite' }, { - ariaLabel: 'Reddit', - icon: { - svg: '<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Reddit' - }, + icon: 'reddit', link: 'https://reddit.com/r/FREEMEDIAHECKYEAH' }, { - ariaLabel: 'Bluesky', - icon: { - svg: 'Bluesky' - }, + icon: 'bluesky', link: 'https://bsky.app/profile/fmhy.net' } ] export const nav: DefaultTheme.NavItem[] = [ - { text: '🔖 Glossary', link: 'https://rentry.org/The-Piracy-Glossary' }, - { text: 'â„šī¸ Guides', link: 'https://guides.fmhy.lol/' }, + { text: '📖 Glossary', link: 'https://rentry.org/The-Piracy-Glossary' }, { text: '💾 Backups', link: 'https://github.com/fmhy/FMHY/wiki/Backups' @@ -139,17 +150,30 @@ export const nav: DefaultTheme.NavItem[] = [ text: '🌱 Ecosystem', items: [ { text: '🌐 Search', link: '/posts/search' }, - { text: '🔗 Bookmarks', link: 'https://github.com/fmhy/bookmarks' }, + { text: '🔖 Bookmarks', link: 'https://github.com/fmhy/bookmarks' }, { text: '✅ SafeGuard', link: 'https://github.com/fmhy/FMHY-SafeGuard' }, + { text: '🚀 Startpage', link: 'https://fmhy.net/startpage' }, { text: '📋 snowbin', link: 'https://pastes.fmhy.net' }, - { text: '💡 Site Hunting', link: 'https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/find-new-sites/' }, - { text: '🏞 Wallpapers', link: '/other/wallpapers' }, - { text: '💙 Feedback', link: '/feedback' }, + { + text: 'ÂŽī¸ Redlib', + link: 'https://redlib.fmhy.net/r/FREEMEDIAHECKYEAH/wiki/index' + }, + { text: '🔎 SearXNG', link: 'https://searx.fmhy.net/' }, + { + text: '💡 Site Hunting', + link: 'https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/find-new-sites/' + }, { text: '❓ FAQs', link: 'https://redd.it/xrxen7' }, { text: '😇 SFW FMHY', link: 'https://fmhy.xyz/' - } + }, + { + text: '🏠 Selfhosting', + link: '/other/selfhosting' + }, + { text: '🏞 Wallpapers', link: '/other/wallpapers' }, + { text: '💙 Feedback', link: '/feedback' } ] } ] @@ -167,8 +191,6 @@ export const sidebar: DefaultTheme.Sidebar | DefaultTheme.NavItemWithLink[] = [ text: ' Contribute', link: '/other/contributing' }, - - // TODO: genetate sidebar from posts { text: 'Wiki', collapsed: false, @@ -214,7 +236,7 @@ export const sidebar: DefaultTheme.Sidebar | DefaultTheme.NavItemWithLink[] = [ link: '/android-iosguide' }, { - text: ' Linux / MacOS', + text: ' Linux / macOS', link: '/linuxguide' }, { @@ -281,10 +303,12 @@ export const sidebar: DefaultTheme.Sidebar | DefaultTheme.NavItemWithLink[] = [ text: 'More', collapsed: true, items: [ - { - text: ' NSFW', - link: 'https://rentry.co/NSFW-Checkpoint' - }, + meta.build.nsfw + ? { + text: ' NSFW', + link: 'https://rentry.co/NSFW-Checkpoint' + } + : {}, { text: ' Unsafe Sites', link: '/unsafesites' diff --git a/docs/.vitepress/hooks/Template.vue b/docs/.vitepress/hooks/Template.vue index e309fd885..da9211919 100644 --- a/docs/.vitepress/hooks/Template.vue +++ b/docs/.vitepress/hooks/Template.vue @@ -1,28 +1,13 @@