Skip to content
Open

V3 #201

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
6f953d7
Added a debounce to fix button mashing for article reactions (#174)
braydoncoyer Jun 26, 2022
7b07d7e
New work timeline
braydoncoyer Sep 5, 2022
6e61cce
Added bottom border to work timeline items
braydoncoyer Sep 5, 2022
28bd9fc
Sticky navbar. New logo.
braydoncoyer Sep 13, 2022
9c57591
Working on getting animated logo
braydoncoyer Sep 16, 2022
bdc8e76
New project section
braydoncoyer Sep 18, 2022
06fa7b7
Removed import of WorkTimeline data type
braydoncoyer Sep 20, 2022
7d4ced5
removed motion imports
braydoncoyer Sep 20, 2022
0811866
Testing build
braydoncoyer Sep 20, 2022
dfed2d9
Removing imports of assets
braydoncoyer Sep 20, 2022
3431418
Removed Preact config from next.config.js
braydoncoyer Sep 25, 2022
9e8776b
New community wall updates
braydoncoyer Sep 30, 2022
45f44ca
v3: articles can be filtered by category via query params in url
braydoncoyer Oct 21, 2022
9cf6db3
New tag list, new article page layout, timeline view now on changelog
braydoncoyer Oct 29, 2022
d77e28b
New social card via edge functions
braydoncoyer Oct 31, 2022
278cff3
New OG image for blog posts with Vercel API
braydoncoyer Nov 12, 2022
e2ab7ad
Centered OG image
braydoncoyer Nov 13, 2022
173acd0
Created Speaking page
braydoncoyer Nov 15, 2022
eb0bd16
Re-designed newsletter form, created sticky slots on blog page for re…
braydoncoyer Nov 15, 2022
6665e9b
Created the OG image for pages other than blog articles
braydoncoyer Nov 27, 2022
9efde7e
Reformatted toolbox page
braydoncoyer Nov 29, 2022
874ac34
Disable tslint in og file and disable custom font
braydoncoyer Dec 2, 2022
adcabb8
Added ignore rule to eslint for tw property for og images
braydoncoyer Dec 2, 2022
c15b3c9
including public directory in tracking
braydoncoyer Dec 2, 2022
1f8e936
Updated to next13
braydoncoyer Dec 3, 2022
2ec7626
Added latest endpoint to reroute to latest blog post
braydoncoyer Dec 3, 2022
3c8529e
Basic link preview working
braydoncoyer Dec 3, 2022
767c813
Link previews working with NextImage
braydoncoyer Dec 3, 2022
d18cee6
A few updates to link previews
braydoncoyer Dec 3, 2022
ed43b6f
Replaced anchor tags with Nextjs Links
braydoncoyer Dec 3, 2022
7128e6c
Added link previews to toolbox page
braydoncoyer Dec 3, 2022
a6cf594
Small changes and linting fixes, Carbon ads added
braydoncoyer Dec 4, 2022
e15b6e7
Removed Carbon ad, added origin to link preview api call
braydoncoyer Dec 4, 2022
75c14b2
Added back custom fonts for OG images
braydoncoyer Dec 4, 2022
4128a25
Fixed custom font error with og images
braydoncoyer Dec 4, 2022
9e024eb
Tidying up
braydoncoyer Dec 4, 2022
997f8cd
Resolving some hook dependencies
braydoncoyer Dec 4, 2022
306861f
Resolving some hook dependencies
braydoncoyer Dec 4, 2022
9b55441
Resolving some hook dependencies
braydoncoyer Dec 4, 2022
83d0bf5
Fixed reaction style issue
braydoncoyer Dec 4, 2022
2f587b1
Final touches
braydoncoyer Dec 8, 2022
4f91141
Added Open Graph images to proper link tag, added new archive link fo…
braydoncoyer Dec 10, 2022
9bde2ad
Added Playwright for screenshots
braydoncoyer Dec 10, 2022
249a635
added puppeteer again
braydoncoyer Dec 10, 2022
9a78ed1
Added microlink for image previews
braydoncoyer Dec 10, 2022
bbbdc02
Removed chromium and playwright
braydoncoyer Dec 10, 2022
0e4c447
Fixed some CSS issues, added gradient overlay for link previews
braydoncoyer Dec 11, 2022
69086cb
Adds plausible dispatch to track link previews, added Carbon ads to m…
braydoncoyer Dec 11, 2022
74e6479
Added Carbon Ads to article page, fixed community wall date issue whe…
braydoncoyer Dec 13, 2022
f049e5e
Changed Plausible analytics to grab pageviews for all time (#202)
braydoncoyer Jan 17, 2023
b8b4986
Loops (#209)
braydoncoyer Jun 2, 2023
b9dbcaa
Removed call to get all subscribers (#210)
braydoncoyer Jun 2, 2023
e177d1e
Removed the newsletter link in the footer of the website (#211)
braydoncoyer Jun 2, 2023
0996d2a
Removed a call to the Twitter API that was causing a crash on build (…
braydoncoyer Jun 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
GA_MEASUREMENT_ID=

REVUE_API_KEY=

API_KEY=
AUTH_DOMAIN=
DATABASE_URL=
Expand All @@ -10,4 +8,10 @@ STORAGE_BUCKET=
MESSAGING_SENDER_ID=
APP_ID=
MEASUREMENT_ID=
NEXT_PUBLIC_GOOGLE_ADSENSE=
NEXT_PUBLIC_GOOGLE_ADSENSE=
TOOLBOX_SOFTWARE_DB=
TOOLBOX_HARDWARE_DB=
TOOLBOX_THIS_SITE_DB=
WORK_TIMELINE_DB=
SPEAKING_DATA_DB=
NEXT_LOOPS_API_KEY=
4 changes: 3 additions & 1 deletion .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ REVUE_API_KEY=
TWITTER_BEARER_TOKEN=
PLAUSIBLE_API_TOKEN=
TWITTER_USER_ID=
NEXT_PUBLIC_GOOGLE_ADSENSE=
NEXT_PUBLIC_GOOGLE_ADSENSE=
WORK_TIMELINE_DB=
SPEAKING_DATA_DB=
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": ["next"],
"rules": {
"react/prop-types": 0,
"react/no-unescaped-entities": 0
"react/no-unescaped-entities": 0,
"react/no-unknown-property": ["error", { "ignore": ["tw"] }]
}
}
1 change: 1 addition & 0 deletions .frontmatter/database/mediaDb.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public/feed.xml
.env.local
.env.development
.env.local
/public
.netlify
/node_modules
/platforms
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ $ npm run dev
Create a `.env` file similar to `.env.example` and include the appropriate keys.

## Notion Article Template
Duplicate [the following Notion database](https://www.notion.so/0d3e00c6bbe54231897b9fcbc7747f78?v=4d7f0006d9a144b5bd8b9251f2ec39cd), grab the database ID and add it to the environment variables in the `.env` file.

Duplicate [the following Notion database](https://www.notion.so/0d3e00c6bbe54231897b9fcbc7747f78?v=4d7f0006d9a144b5bd8b9251f2ec39cd), grab the database ID and add it to the environment variables in the `.env` file.
Binary file added assets/Inter-Bold.ttf
Binary file not shown.
Binary file added assets/Inter-Medium.ttf
Binary file not shown.
Binary file added assets/Inter-Regular.ttf
Binary file not shown.
46 changes: 0 additions & 46 deletions components/Adsense.tsx

This file was deleted.

15 changes: 5 additions & 10 deletions components/ArticleCard.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
import { Article } from '@/lib/types';
import Image from 'next/image';
import Image from 'next/legacy/image';
import { handleArticleClicked } from '@/lib/handleArticleClick';
import siteMetadata from '@/data/siteMetadata';
import slugify from 'slugify';
import { useIsArticleRead } from '@/hooks/useIsArticleRead';
import { useRouter } from 'next/dist/client/router';

type Props = {
article: Article;
};

export function ArticleCard({ article }: Props) {
const router = useRouter();
const slug = slugify(article.title).toLowerCase();

const [hasRead] = useIsArticleRead(slug);

return (
<div>
<button onClick={() => handleArticleClicked(slug)}>
<div className="group">
<Image
className="rounded-xl group-hover:opacity-75"
className="rounded-3xl group-hover:opacity-75"
objectFit="cover"
src={article.coverImage}
placeholder="blur"
Expand All @@ -31,11 +28,9 @@ export function ArticleCard({ article }: Props) {
layout="intrinsic"
alt={'article cover'}
/>
<div className="text-left w-full">
<div className="w-full text-left">
<h3 className="mt-2 text-2xl">{article.title}</h3>
{/* {JSON.stringify(article)} */}
{/* <p>{article.summary}</p> */}
<span className="text-base font-semibold flex items-center">
<span className="flex items-center text-base font-semibold">
{new Date(article.publishedDate).toLocaleDateString(
siteMetadata.locale,
{
Expand All @@ -45,7 +40,7 @@ export function ArticleCard({ article }: Props) {
}
)}{' '}
{hasRead && (
<span className="text-sm inline-flex items-center text-teal-600 dark:text-teal-800 opacity-75 ml-3">
<span className="inline-flex items-center ml-3 text-sm text-teal-600 opacity-75 dark:text-teal-800">
<svg width="24" height="24" fill="none" viewBox="0 0 24 24">
<path
stroke="currentColor"
Expand Down
59 changes: 49 additions & 10 deletions components/ArticleList.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,55 @@
import { Article } from '@/lib/types';
import { ArticleCard } from '@/components/ArticleCard';

type Props = {
articles: Article[];
};

export function ArticleList({ articles }) {
export function ArticleList({
articles,
showEndMessage = false,
fullHeight = false
}) {
return (
<div className="list-none grid grid-cols-1 md:grid-cols-3 gap-8">
{articles.map((article) => (
<ArticleCard key={article.title} article={article} />
))}
<div className={`space-y-12 ${fullHeight && 'min-h-screen '}`}>
<div className="grid grid-cols-1 gap-8 list-none md:grid-cols-3">
{articles.map((article) => (
<ArticleCard key={article.title} article={article} />
))}
</div>
{showEndMessage && (
<div className="flex items-center justify-center space-x-2 text-xs text-slate-400 dark:text-slate-500">
<p>You've reached the end of the list.</p>
<svg
className="w-5"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z"
stroke="currentColor"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
></path>
<path
d="M9.75 13.75C9.75 13.75 10 15.25 12 15.25C14 15.25 14.25 13.75 14.25 13.75"
stroke="currentColor"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
></path>
<path
d="M10.5 10C10.5 10.2761 10.2761 10.5 10 10.5C9.72386 10.5 9.5 10.2761 9.5 10C9.5 9.72386 9.72386 9.5 10 9.5C10.2761 9.5 10.5 9.72386 10.5 10Z"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
></path>
<path
d="M14.5 10C14.5 10.2761 14.2761 10.5 14 10.5C13.7239 10.5 13.5 10.2761 13.5 10C13.5 9.72386 13.7239 9.5 14 9.5C14.2761 9.5 14.5 9.72386 14.5 10Z"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
></path>
</svg>
</div>
)}
</div>
);
}
29 changes: 25 additions & 4 deletions components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,37 @@ export const Button: React.FC<Props> = ({
<button
aria-label="button"
type="button"
className={`md:w-auto md:inline-flex py-3 px-2 md:px-12 rounded-full w-full ${
className={`group inline-flex items-center rounded-full px-6 py-1.5 font-semibold transition ${
buttonType === ButtonType.PRIMARY
? 'bg-midnight text-white dark:bg-gray-200 dark:text-midnight'
? 'bg-midnight text-white dark:bg-gray-200 dark:text-midnight hover:bg-slate-700'
: buttonType === ButtonType.SECONDARY
? 'bg-gray-200 dark:bg-midnight text-midnight dark:text-white'
? 'text-midnight dark:text-white'
: null
} items-center justify-center general-ring-state font-medium`}
}`}
onClick={() => onButtonClick()}
>
{children}
<svg
className={`mt-0.5 ml-2 -mr-1 stroke-2 ${
buttonType === ButtonType.PRIMARY
? 'stroke-white dark:stroke-midnight'
: 'stroke-midnight dark:stroke-white'
}`}
fill="none"
width="10"
height="10"
viewBox="0 0 10 10"
aria-hidden="true"
>
<path
className="transition opacity-0 group-hover:opacity-100"
d="M0 5h7"
></path>
<path
className="transition group-hover:translate-x-[3px]"
d="M1 1l4 4-4 4"
></path>
</svg>
</button>
);
};
2 changes: 1 addition & 1 deletion components/Callout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function Callout({ children }) {
return (
<div className="flex p-3 space-x-4 bg-gray-100 rounded-lg dark:bg-midnight">
<div className="flex p-3 space-x-4 rounded-lg bg-slate-100 dark:bg-midnight">
{children}
</div>
);
Expand Down
53 changes: 41 additions & 12 deletions components/CommunityEntry.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Image from 'next/image';
import dayjs from 'dayjs';
import { useSWRConfig } from 'swr';

Expand Down Expand Up @@ -26,18 +27,46 @@ export function CommunityEntry({ session, message }) {
mutate('/api/community-wall');
}
return (
<>
<p className="p-0 m-0 text-gray-900 dark:text-white">{message.content}</p>
<div className="flex items-center space-x-6 text-base">
<p>
{message.user.name} ∿ {dayjs(message.created_at).format('MM/DD/YYYY')}
</p>
{session && session.user.id === message.user_id ? (
<button onClick={handleDeleteMessage} className="text-rose-400">
Delete
</button>
) : null}
<div className="p-6 rounded-3xl bg-[#F8FAFC] dark:bg-midnight">
<div className="flex items-start justify-between mb-4 space-x-6">
<div className="flex items-start space-x-6">
<Image
width={32}
height={32}
className="flex-shrink-0 rounded-full"
src={
message.user.avatar_url
? message.user.avatar_url
: `https://robohash.org/${message.user.name}.png`
}
alt="profile picture"
/>
<div>
<h5 className="text-indigo-600 dark:text-indigo-500">
{message.user.name}
</h5>
<p className="flex items-start p-0 m-0 leading-7">
<span>{message.content}</span>
</p>
<div className="mt-4 text-base">
{session && session.user.id === message.user_id ? (
<button
onClick={handleDeleteMessage}
className="text-rose-400 hover:text-rose-500"
>
Delete
</button>
) : null}
</div>
</div>
</div>

<div>
<p className="hidden p-0 m-0 text-base md:block text-slate-400 dark:text-slate-500">
{dayjs(message.created_at).format('MM/DD/YYYY')}
</p>
</div>
</div>
</>
</div>
);
}
9 changes: 6 additions & 3 deletions components/CommunityForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ export function CommunityForm({ loggedIn, supabase, session }) {
message: 'Sending note...'
});
const content = message.current.value;
console.log(session.user?.user_metadata.avatar_url);
const res = await fetch('/api/community-wall', {
body: JSON.stringify({
message: {
content,
userId: session.user.id
userId: session.user.id,
userPhoto: session.user?.user_metadata.avatar_url
}
}),
headers: {
Expand Down Expand Up @@ -52,7 +54,7 @@ export function CommunityForm({ loggedIn, supabase, session }) {
}
return (
<>
<div className="border border-gray-200 rounded-lg p-6 my-4 w-full dark:border-gray-700 bg-[#F8FAFC] dark:bg-midnight">
<div className="border border-gray-200 rounded-3xl p-6 my-4 w-full dark:border-gray-700 bg-[#F8FAFC] dark:bg-midnight">
<h3 className="p-0 mt-0">Leave a note</h3>
<p>Share a message with me or another visitor of my site.</p>
{loggedIn ? (
Expand All @@ -76,7 +78,8 @@ export function CommunityForm({ loggedIn, supabase, session }) {
</button>
</form>
<p className="p-0 m-0 text-base opacity-60 no-prose">
Your information is only used to display your name.
Your information is only used to display your name & GitHub
profile picture.
</p>
{form.state === Form.Error ? (
<ErrorMessage>{form.message}</ErrorMessage>
Expand Down
Loading