diff --git a/src/components/shortcodes/ProtectedContent.astro b/src/components/shortcodes/ProtectedContent.astro deleted file mode 100644 index 1ab737d..0000000 --- a/src/components/shortcodes/ProtectedContent.astro +++ /dev/null @@ -1,131 +0,0 @@ ---- -import { encrypt } from '../../plugins/encrypt'; -import {siteConfig} from "../../config"; - -interface Props { - password?: string; - pwEnv?: string; -} - -const { password: propPassword, pwEnv } = Astro.props; -// Get password from props, environment variable, or site config -const password = (pwEnv ? import.meta.env[pwEnv] : propPassword) || siteConfig.contentPassword || import.meta.env.CONTENT_PASSWORD || Math.random().toString(); - -// Get the slot content -const content = await Astro.slots.render('default'); - -// Encrypt content at build time -const { encryptedData, iv } = encrypt(content, password); ---- - -
This content is protected. Enter the password to view it:
- -