Skip to content

Commit

Permalink
Merge pull request tangly1024#1879 from tangly1024/feat/landing-theme…
Browse files Browse the repository at this point in the history
…-pricing

Feat/landing theme pricing
  • Loading branch information
tangly1024 authored Feb 6, 2024
2 parents 01620a0 + 76f14ce commit a93d765
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 29 deletions.
13 changes: 7 additions & 6 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ function scanSubdirectories(directory) {
const subdirectories = []

fs.readdirSync(directory).forEach(file => {
const fullPath = path.join(directory, file)
const stats = fs.statSync(fullPath)
// 这段代码会将landing排除在可选主题中

// landing主题比较特殊,不在可切换的主题中显示
if (stats.isDirectory() && file !== 'landing') {
subdirectories.push(file)
}
// const fullPath = path.join(directory, file)
// const stats = fs.statSync(fullPath)
// landing主题默认隐藏掉,一般网站不会用到
// if (stats.isDirectory() && file !== 'landing') {
// subdirectories.push(file)
// }
})

return subdirectories
Expand Down
10 changes: 5 additions & 5 deletions themes/landing/components/Features.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ export default function Features() {
<section className="relative">

{/* Section background (needs .relative class on parent and next sibling elements) */}
<div className="absolute inset-0 bg-gray-100 pointer-events-none mb-16" aria-hidden="true"></div>
<div className="absolute inset-0 bg-gray-100 dark:bg-black pointer-events-none mb-16" aria-hidden="true"></div>
<div className="absolute left-0 right-0 m-auto w-px p-px h-20 bg-gray-200 transform -translate-y-1/2"></div>

<div className="relative max-w-6xl mx-auto px-4 sm:px-6">
<div className="pt-12 md:pt-20">

{/* Section header */}
<div className="max-w-3xl mx-auto text-center pb-12 md:pb-16">
<h1 className="h2 mb-4">{siteConfig('LANDING_FEATURES_HEADER_1', null, CONFIG)}</h1>
<p className="text-xl text-gray-600 leading-relaxed" dangerouslySetInnerHTML={{ __html: siteConfig('LANDING_FEATURES_HEADER_1_P', null, CONFIG) }}></p>
<h1 className="h2 mb-4 dark:text-white">{siteConfig('LANDING_FEATURES_HEADER_1', null, CONFIG)}</h1>
<p className="text-xl text-gray-600 dark:text-gray-400 leading-relaxed" dangerouslySetInnerHTML={{ __html: siteConfig('LANDING_FEATURES_HEADER_1_P', null, CONFIG) }}></p>
</div>

{/* Section content */}
Expand All @@ -43,8 +43,8 @@ export default function Features() {
{/* Content */}
<div className="max-w-xl md:max-w-none md:w-full mx-auto md:col-span-7 lg:col-span-6 md:mt-6" data-aos="fade-right">
<div className="md:pr-4 lg:pr-12 xl:pr-16 mb-8">
<h3 className="h3 mb-3">{siteConfig('LANDING_FEATURES_HEADER_2', null, CONFIG)}</h3>
<p className="text-xl text-gray-600">{siteConfig('LANDING_FEATURES_HEADER_2_P', null, CONFIG)}</p>
<h3 className="h3 mb-3 dark:text-white">{siteConfig('LANDING_FEATURES_HEADER_2', null, CONFIG)}</h3>
<p className="text-xl text-gray-600 dark:text-gray-400">{siteConfig('LANDING_FEATURES_HEADER_2_P', null, CONFIG)}</p>
</div>
{/* Tabs buttons */}
<div className="mb-8 md:mb-0">
Expand Down
18 changes: 9 additions & 9 deletions themes/landing/components/FeaturesBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ export default function FeaturesBlocks() {
<section className="relative">

{/* Section background (needs .relative class on parent and next sibling elements) */}
<div className="absolute inset-0 top-1/2 md:mt-24 lg:mt-0 bg-gray-900 pointer-events-none" aria-hidden="true"></div>
<div className="absolute inset-0 top-1/2 md:mt-24 lg:mt-0 bg-gray-900 dark:bg-black pointer-events-none" aria-hidden="true"></div>
<div className="absolute left-0 right-0 bottom-0 m-auto w-px p-px h-20 bg-gray-200 transform translate-y-1/2"></div>

<div className="relative max-w-6xl mx-auto px-4 sm:px-6">
<div className="py-12 md:py-20">

{/* Section header */}
<div className="max-w-3xl mx-auto text-center pb-12 md:pb-20">
<h2 className="h2 mb-4">{siteConfig('LANDING_FEATURES_BLOCK_HEADER', null, CONFIG)}</h2>
<p className="text-xl text-gray-600" dangerouslySetInnerHTML={{ __html: siteConfig('LANDING_FEATURES_BLOCK_P', null, CONFIG) }}></p>
<h2 className="h2 mb-4 dark:text-white">{siteConfig('LANDING_FEATURES_BLOCK_HEADER', null, CONFIG)}</h2>
<p className="text-xl text-gray-600 dark:text-gray-400" dangerouslySetInnerHTML={{ __html: siteConfig('LANDING_FEATURES_BLOCK_P', null, CONFIG) }}></p>
</div>

{/* Items */}
<div className="max-w-sm mx-auto grid gap-6 md:grid-cols-2 lg:grid-cols-3 items-start md:max-w-2xl lg:max-w-none">

{/* 1st item */}
<div className="relative flex flex-col items-center p-6 bg-white rounded shadow-xl">
<div className="relative flex flex-col items-center p-6 bg-white rounded-md shadow-xl border">
<svg className="w-16 h-16 p-1 -mt-1 mb-2" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fillRule="evenodd">
<rect className="fill-current text-blue-600" width="64" height="64" rx="32" />
Expand All @@ -39,7 +39,7 @@ export default function FeaturesBlocks() {
</div>

{/* 2nd item */}
<div className="relative flex flex-col items-center p-6 bg-white rounded shadow-xl">
<div className="relative flex flex-col items-center p-6 bg-white rounded-md shadow-xl border">
<svg className="w-16 h-16 p-1 -mt-1 mb-2" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fillRule="evenodd">
<rect className="fill-current text-blue-600" width="64" height="64" rx="32" />
Expand All @@ -55,7 +55,7 @@ export default function FeaturesBlocks() {
</div>

{/* 3rd item */}
<div className="relative flex flex-col items-center p-6 bg-white rounded shadow-xl">
<div className="relative flex flex-col items-center p-6 bg-white rounded-md shadow-xl border">
<svg className="w-16 h-16 p-1 -mt-1 mb-2" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fillRule="evenodd">
<rect className="fill-current text-blue-600" width="64" height="64" rx="32" />
Expand All @@ -72,7 +72,7 @@ export default function FeaturesBlocks() {
</div>

{/* 4th item */}
<div className="relative flex flex-col items-center p-6 bg-white rounded shadow-xl">
<div className="relative flex flex-col items-center p-6 bg-white rounded-md shadow-xl border">
<svg className="w-16 h-16 p-1 -mt-1 mb-2" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fillRule="evenodd">
<rect className="fill-current text-blue-600" width="64" height="64" rx="32" />
Expand All @@ -89,7 +89,7 @@ export default function FeaturesBlocks() {
</div>

{/* 5th item */}
<div className="relative flex flex-col items-center p-6 bg-white rounded shadow-xl">
<div className="relative flex flex-col items-center p-6 bg-white rounded-md shadow-xl border">
<svg className="w-16 h-16 p-1 -mt-1 mb-2" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fillRule="evenodd">
<rect className="fill-current text-blue-600" width="64" height="64" rx="32" />
Expand All @@ -105,7 +105,7 @@ export default function FeaturesBlocks() {
</div>

{/* 6th item */}
<div className="relative flex flex-col items-center p-6 bg-white rounded shadow-xl">
<div className="relative flex flex-col items-center p-6 bg-white rounded-md shadow-xl border">
<svg className="w-16 h-16 p-1 -mt-1 mb-2" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fillRule="evenodd">
<rect className="fill-current text-blue-600" width="64" height="64" rx="32" />
Expand Down
5 changes: 5 additions & 0 deletions themes/landing/components/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ export default function Footer() {

{/* Social as */}
<ul className="flex mb-4 md:order-1 md:ml-4 md:mb-0">
<li>
<div className='h-full flex justify-center items-center text-gray-600 hover:text-gray-900 bg-white hover:bg-white-100'>
Powered by<a href='https://github.com/tangly1024/NotionNext' className='mx-1 hover:underline font-semibold'>NotionNext {siteConfig('VERSION')}</a>
</div>
</li>
{/* <li>
<a href="#0" className="flex justify-center items-center text-gray-600 hover:text-gray-900 bg-white hover:bg-white-100 rounded-full shadow transition duration-150 ease-in-out" aria-label="Twitter">
<svg className="w-8 h-8 fill-current" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
Expand Down
4 changes: 2 additions & 2 deletions themes/landing/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function Header() {
}, [top])

return (
<header className={`fixed w-full z-30 md:bg-opacity-90 transition duration-300 ease-in-out ${!top ? 'bg-white backdrop-blur-sm shadow-lg' : ''}`}>
<header className={`fixed w-full z-50 md:bg-opacity-90 transition duration-300 ease-in-out ${!top ? 'bg-white dark:bg-hexo-black-gray backdrop-blur-sm shadow-lg' : ''}`}>
<div className="max-w-6xl mx-auto px-5 sm:px-6">
<div className="flex items-center justify-between h-16 md:h-20">

Expand All @@ -36,7 +36,7 @@ export default function Header() {
{/* Desktop sign in links */}
<ul className="flex grow justify-end flex-wrap items-center">
<li>
<Link href={siteConfig('LANDING_HEADER_BUTTON_1_URL', null, CONFIG)} target='_blank' className="font-medium hover:font-bold text-gray-600 hover:text-gray-900 px-5 py-3 flex items-center transition duration-150 ease-in-out">
<Link href={siteConfig('LANDING_HEADER_BUTTON_1_URL', null, CONFIG)} target='_blank' className="font-medium hover:font-bold text-gray-600 hover:text-gray-900 dark:text-gray-400 px-5 py-3 flex items-center transition duration-150 ease-in-out">
<div>{siteConfig('LANDING_HEADER_BUTTON_1_TITLE', null, CONFIG)}</div>
</Link>
</li>
Expand Down
2 changes: 1 addition & 1 deletion themes/landing/components/Hero.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function Hero() {
<span className="bg-clip-text text-transparent bg-gradient-to-r from-blue-500 to-teal-400">{siteConfig('LANDING_HERO_TITLE_1', null, CONFIG)}</span>
</h1>
<div className="max-w-3xl mx-auto">
<p className="text-xl text-gray-600 mb-8" data-aos="zoom-y-out" data-aos-delay="150">{siteConfig('LANDING_HERO_P_1', null, CONFIG)}</p>
<p className="text-xl text-gray-600 dark:text-gray-400 mb-8" data-aos="zoom-y-out" data-aos-delay="150">{siteConfig('LANDING_HERO_P_1', null, CONFIG)}</p>
<div className="max-w-xs mx-auto sm:max-w-none sm:flex sm:justify-center" data-aos="zoom-y-out" data-aos-delay="300">
<div>
<a target='_blank' className="btn text-white bg-blue-600 hover:bg-blue-700 w-full mb-4 sm:w-auto sm:mb-0"
Expand Down
56 changes: 56 additions & 0 deletions themes/landing/components/Pricing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { siteConfig } from '@/lib/config'
import CONFIG from '../config'
import Link from 'next/link'

/**
* 价格收费表
*/
export const Pricing = (props) => {
return <div class="w-full mx-auto bg-white dark:bg-black px-5 py-10 text-gray-800 mb-10">
<div class="text-center max-w-xl mx-auto">
<h1 class="text-5xl md:text-5xl font-bold mb-5 dark:text-white">{siteConfig('LANDING_PRICING_TITLE', null, CONFIG)}</h1>
<h3 class="text-xl font-medium mb-10 dark:text-gray-400">{siteConfig('LANDING_PRICING_P', null, CONFIG)}</h3>
</div>
<div class="max-w-4xl mx-auto md:flex">
<div class="w-full md:w-1/3 md:max-w-none bg-white dark:bg-hexo-black-gray px-8 md:px-10 py-8 md:py-10 mb-3 mx-auto md:my-6 rounded-md shadow-lg shadow-gray-600 md:flex md:flex-col">
<div class="w-full flex-grow dark:text-gray-400">
<h2 class="text-center font-bold uppercase mb-4">{siteConfig('LANDING_PRICING_1_TITLE', null, CONFIG)}</h2>
<h3 class="text-center font-bold text-4xl mb-5">{siteConfig('LANDING_PRICING_1_PRICE', null, CONFIG)}</h3>
<ul class="text-sm px-5 mb-8">
{siteConfig('LANDING_PRICING_1_CONTENT', null, CONFIG)?.split(',').map((item, index) => <li key={index} class="leading-tight"><i class="mdi-check-bold text-lg"></i>{item}</li>
)}
</ul>
</div>
<Link class="w-full" href={siteConfig('LANDING_PRICING_1_URL', null, CONFIG)}>
<button class="font-bold bg-blue-600 hover:bg-blue-700 text-white rounded-md px-10 py-2 transition-colors w-full">{siteConfig('LANDING_PRICING_1_BUTTON', null, CONFIG)}</button>
</Link>
</div>
<div class="w-full md:w-1/3 md:max-w-none bg-white dark:bg-hexo-black-gray px-8 md:px-10 py-8 md:py-10 mb-3 mx-auto md:-mx-3 md:mb-0 rounded-md shadow-lg shadow-gray-600 md:relative md:z-20 md:flex md:flex-col">
<div class="w-full flex-grow dark:text-gray-400">
<h2 class="text-center font-bold uppercase mb-4">{siteConfig('LANDING_PRICING_2_TITLE', null, CONFIG)}</h2>
<h3 class="text-center font-bold text-4xl md:text-5xl mb-5">{siteConfig('LANDING_PRICING_2_PRICE', null, CONFIG)}</h3>
<ul class="text-sm px-5 mb-8">
{siteConfig('LANDING_PRICING_2_CONTENT', null, CONFIG)?.split(',').map((item, index) => <li key={index} class="leading-tight"><i class="mdi-check-bold text-lg"></i>{item}</li>
)}
</ul>
</div>
<Link class="w-full" target='_blank' href={siteConfig('LANDING_PRICING_2_URL', null, CONFIG)}>
<button class="font-bold bg-blue-600 hover:bg-blue-700 text-white rounded-md px-10 py-2 transition-colors w-full">{siteConfig('LANDING_PRICING_2_BUTTON', null, CONFIG)}</button>
</Link>
</div>
<div class="w-full md:w-1/3 md:max-w-none bg-white dark:bg-hexo-black-gray px-8 md:px-10 py-8 md:py-10 mb-3 mx-auto md:my-6 rounded-md shadow-lg shadow-gray-600 md:flex md:flex-col">
<div class="w-full flex-grow dark:text-gray-400">
<h2 class="text-center font-bold uppercase mb-4">{siteConfig('LANDING_PRICING_3_TITLE', null, CONFIG)}</h2>
<h3 class="text-center font-bold text-4xl mb-5">{siteConfig('LANDING_PRICING_3_PRICE', null, CONFIG)}</h3>
<ul class="text-sm px-5 mb-8">
{siteConfig('LANDING_PRICING_3_CONTENT', null, CONFIG)?.split(',').map((item, index) => <li key={index} class="leading-tight"><i class="mdi-check-bold text-lg"></i>{item}</li>
)}
</ul>
</div>
<Link class="w-full" target='_blank' href={siteConfig('LANDING_PRICING_3_URL', null, CONFIG)}>
<button class="font-bold bg-blue-600 hover:bg-blue-700 text-white rounded-md px-10 py-2 transition-colors w-full">{siteConfig('LANDING_PRICING_3_BUTTON', null, CONFIG)}</button>
</Link>
</div>
</div>
</div>
}
4 changes: 2 additions & 2 deletions themes/landing/components/Testimonials.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 22 additions & 1 deletion themes/landing/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const CONFIG = {
LANDING_FEATURES_BLOCK_6_P: 'NotionNext,助您轻松开始写作',

// 感言
LANDING_TESTIMONIALS_HEADER: '已搭建超5300个网站、总浏览量突破100,000,000+',
LANDING_TESTIMONIALS_HEADER: '已搭建超7000个网站、总浏览量突破100,000,000+',
LANDING_TESTIMONIALS_P: '网站内容涵盖地产、教育、建筑、医学、机械、IT、电子、软件、自媒体、数位游民、短视频、电商、学生、摄影爱好者、旅行爱好者等等各行各业',

LANDING_TESTIMONIALS_AVATAR: 'https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F22de3fcb-d90d-4271-bc01-f815f476122b%2F4FE0A0C0-E487-4C74-BF8E-6F01A27461B8-14186-000008094BC289A6.jpg?table=collection&id=a320a2cc-6ebe-4a8d-95cc-ea94e63bced9&width=200',
Expand All @@ -60,6 +60,27 @@ const CONFIG = {
LANDING_POST_REDIRECT_ENABLE: process.env.NEXT_PUBLIC_POST_REDIRECT_ENABLE || false, // 是否开启文章地址重定向 ; 用于迁移旧网站域名
LANDING_POST_REDIRECT_URL: process.env.NEXT_PUBLIC_POST_REDIRECT_URL || 'https://blog.tangly1024.com', // 重定向网站地址

LANDING_PRICING_TITLE: '价格表',
LANDING_PRICING_P: 'NotionNext开源免费,此处是演示SAAS订阅付费功能。若您喜欢也可以选择捐赠支持。',

LANDING_PRICING_1_TITLE: '个人版',
LANDING_PRICING_1_PRICE: '免费',
LANDING_PRICING_1_CONTENT: '项目源代码,部署教程,不定时技术答疑',
LANDING_PRICING_1_BUTTON: '开始体验',
LANDING_PRICING_1_URL: 'https://docs.tangly1024.com/about',

LANDING_PRICING_2_TITLE: '捐赠版',
LANDING_PRICING_2_PRICE: '$9.9/月',
LANDING_PRICING_2_CONTENT: '项目源代码,部署教程,长期技术答疑,代码升级合并,内部社群',
LANDING_PRICING_2_BUTTON: '立即购买',
LANDING_PRICING_2_URL: 'https://tangly1024.lemonsqueezy.com/checkout/buy/0adb9153-0799-4f51-91aa-1f06391ea4e0',

LANDING_PRICING_3_TITLE: '企业版',
LANDING_PRICING_3_PRICE: '$59/月',
LANDING_PRICING_3_CONTENT: '项目源代码,部署教程,VIP技术咨询,代码升级合并,内部社群,定制功能开发,SEO优化',
LANDING_PRICING_3_BUTTON: '立即购买',
LANDING_PRICING_3_URL: 'https://tangly1024.lemonsqueezy.com/checkout/buy/df924d66-09dc-42a4-a632-a6b0c5cc4f28',

LANDING_NEWSLETTER: process.env.NEXT_PUBLIC_THEME_LANDING_NEWSLETTER || false // 是否开启邮件订阅 请先配置mailchimp功能 https://docs.tangly1024.com/article/notion-next-mailchimp
}
export default CONFIG
8 changes: 5 additions & 3 deletions themes/landing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@ import CONFIG from './config'
import Loading from '@/components/Loading'
import { isBrowser } from '@/lib/utils'
import { siteConfig } from '@/lib/config'
import { Pricing } from './components/Pricing'

/**
* 布局框架
* 作为一个基础框架使用,定义了整个主题每个页面必备的顶部导航栏和页脚
* 其它页面都嵌入到此框架中使用
* Landing 主题用作产品落地页展示
* 结合Stripe或者lemonsqueezy插件可以成为saas支付订阅
* @param {*} props
* @returns
*/
const LayoutBase = (props) => {
const { children } = props

return <div id='theme-landing' className="overflow-hidden flex flex-col justify-between bg-white">
return <div id='theme-landing' className="overflow-hidden flex flex-col justify-between bg-white dark:bg-black">

{/* 顶部导航栏 */}
<Header />
Expand All @@ -58,6 +59,7 @@ const LayoutIndex = (props) => {
<Features />
<FeaturesBlocks />
<Testimonials />
<Pricing/>
<Newsletter />
</>
)
Expand Down

0 comments on commit a93d765

Please sign in to comment.