. ├── components │ ├── Banner.js │ ├── Footer.js │ ├── Header.js │ ├── ItemPost.js │ ├── Pagnation.js │ ├── Post.js │ └── Sidebar.js ├── config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import '../styles/globals.css' | |
import Head from "next/head"; | |
import Script from "next/script"; | |
function MyApp({ Component, pageProps }) { | |
return ( | |
<> | |
<Head> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<link | |
href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.8' | |
services: | |
blog: | |
image: ghost | |
restart: always | |
ports: | |
- 8080:2368 | |
volumes: | |
- ./assets:/var/lib/ghost/content/themes/fastest/assets | |
- ./partials:/var/lib/ghost/content/themes/fastest/partials |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// pages/index.js | |
import Login from '../components/login'; | |
import { getProviders } from "next-auth/react" | |
import { unstable_getServerSession } from "next-auth/next" | |
import { authOptions } from "./api/auth/[...nextauth]"; | |
export default function Home({ posts, Session , providers }) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// pages/index.js | |
import Login from '../components/login'; | |
import { useSession, getProviders } from "next-auth/react" | |
// rest import here | |
export default function Home({ posts, totalPostCount, providers }) { | |
// get session from next-auth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// components/login.js | |
import React from 'react' | |
import { signIn } from "next-auth/react" | |
export default function SignIn({ providers }) { | |
return ( | |
<> | |
<div className="container mb-5"> | |
<div className="col-md-6 mx-auto text-center"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// pages/api/auth/[...nextauth].js | |
import NextAuth from "next-auth" | |
import GithubProvider from "next-auth/providers/github" | |
export const authOptions = { | |
providers: [ | |
GithubProvider({ | |
clientId: process.env.GITHUB_ID, | |
clientSecret: process.env.GITHUB_SECRET, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import '../styles/globals.css' | |
import Head from "next/head"; | |
import Header from "../components/Header"; | |
import Footer from "../components/Footer"; | |
import { DefaultSeo } from 'next-seo'; | |
import SEO from '../next-seo.config'; | |
import { SessionProvider } from "next-auth/react" | |
// for error handing | |
import ErrorBoundary from '../components/ErrorBoundary'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Content Manager</title> | |
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script> | |
</head> | |
<body> | |
<!-- Include the script that builds the page and powers Netlify CMS --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backend: | |
name: git-gateway | |
branch: main | |
media_folder: "public/images" # Media files will be stored in the repo under static/images/uploads | |
public_folder: "/images" # The src attribute for uploaded media will begin with /images/uploads | |
collections: | |
- name: "blog" # Used in routes, e.g., /admin/collections/blog | |
label: "Blog" # Used in the UI | |
folder: "posts" # The path to the folder where the documents are stored | |
create: true # Allow users to create new documents in this collection |