feature - added promotekit

This commit is contained in:
James Wyndham 2024-03-22 07:25:55 +08:00
parent 4cdb73a9fd
commit 187ce1b57f
4 changed files with 71 additions and 23 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -4,11 +4,11 @@ sidebar_position: 1
# Quick Start # Quick Start
Let's discover **Docusaurus in less than 3 hours** with free hosting. Let's get setup with **FastPocket in less than 3 hours** with free hosting.
Assumptions Assumptions
- We are going straight to live, using stripe and react - We are going straight to live, using stripe and react and we aren't going to host our own environment yet
## Overview ## Overview
@ -38,31 +38,48 @@ Assumptions
- [Node.js](https://nodejs.org/en/download/) version 18.0 or above: - [Node.js](https://nodejs.org/en/download/) version 18.0 or above:
- When installing Node.js, you are recommended to check all checkboxes related to dependencies. - When installing Node.js, you are recommended to check all checkboxes related to dependencies.
## Generate a new site ## Setup Your Tooling - Skip if this ain't your first rodeo (35 min)
Generate a new Docusaurus site using the **classic template**. ### Stripe CLI (5 min)
The classic template will automatically be added to your project after you run the command: ### NVM (5 min)
```bash ### Setup stripe account (10 min)
npm init docusaurus@latest my-website classic
```
You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor. ### Setup fly.io account (5 min)
The command also installs all necessary dependencies you need to run Docusaurus. ### Setup vercel account (5 min)
## Start your site ### Setup posthog account (5 min)
Run the development server: ### Setup google analytics account (5 min)
```bash ## Registering a new domain (5 min)
cd my-website
npm run start
```
The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there. ### Finding a good name (3 min)
The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/. ### Purchasing on Porkbun (2 min)
Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes. Every great project starts with registering a new domain so naturally we will start there as well.
## Designing a new logo (20 min)
In order to make a new logo you are going to want to create
## Design a nice background (10 min)
You are wanting to make a nice background
## Setup Stripe
### Setup products
### Setup webhooks
### Setup checkout page
### Setup manage page
## Setup FastPocket instance
##

View File

@ -9,6 +9,7 @@ import { cookies } from "next/headers";
import { isAuthenticated } from "@/lib/auth"; import { isAuthenticated } from "@/lib/auth";
import { GTagProvider, PHProvider, ThemeProvider } from "./providers"; import { GTagProvider, PHProvider, ThemeProvider } from "./providers";
import { title } from "@/constants"; import { title } from "@/constants";
import Script from "next/script";
const raleway = Arimo({ const raleway = Arimo({
variable: "--body-font", variable: "--body-font",
@ -63,6 +64,39 @@ export default async function RootLayout({
theme="colored" theme="colored"
/> />
</ThemeProvider> </ThemeProvider>
<Script
id="promotekit-js"
async
src="https://cdn.promotekit.com/promotekit.js"
data-promotekit="41c8e339-d2aa-414b-88b8-31b6d6346e2b"
/>
<Script
id="promotekit-jq"
src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"
/>
<Script
id="promotekit"
dangerouslySetInnerHTML={{
__html: `
$(document).ready(function(){
setTimeout(function() {
$('a[href^="https://buy.stripe.com/"]').each(function(){
const oldBuyUrl = $(this).attr("href");
const referralId = window.promotekit_referral;
if (!oldBuyUrl.includes("client_reference_id")) {
const newBuyUrl = oldBuyUrl + "?client_reference_id=" + referralId;
$(this).attr("href", newBuyUrl);
}
});
$("[pricing-table-id]").each(function(){
$(this).attr("client-reference-id", window.promotekit_referral);
});
}, 2000);
});
`,
}}
></Script>
</body> </body>
</PHProvider> </PHProvider>
</html> </html>

View File

@ -1,9 +1,6 @@
import "aos/dist/aos.css"; import "aos/dist/aos.css";
import React from "react"; import React from "react";
import { import { SquaredBackgroundHero } from "@/sections/Hero";
SquaredBackgroundHero,
WaitingListWithImageHero,
} from "@/sections/Hero";
import PageWrapper from "@/components/Utilities/PageWrapper"; import PageWrapper from "@/components/Utilities/PageWrapper";
import Footer from "@/components/Footer"; import Footer from "@/components/Footer";
import PageHeader from "@/sections/PageHeader"; import PageHeader from "@/sections/PageHeader";