Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ixkaito/nextsss
Next.js static site starter including full setup for TypeScript, Tailwind CSS, Google Analytics, Next SEO, etc.
https://github.com/ixkaito/nextsss
autoprefixer eslint google-analytics next-seo nextjs nextjs-starter postcss prettier sass tailwindcss typescript
Last synced: 3 months ago
JSON representation
Next.js static site starter including full setup for TypeScript, Tailwind CSS, Google Analytics, Next SEO, etc.
- Host: GitHub
- URL: https://github.com/ixkaito/nextsss
- Owner: ixkaito
- Created: 2021-05-25T23:46:48.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-20T05:51:33.000Z (about 2 years ago)
- Last Synced: 2024-10-23T10:35:19.177Z (3 months ago)
- Topics: autoprefixer, eslint, google-analytics, next-seo, nextjs, nextjs-starter, postcss, prettier, sass, tailwindcss, typescript
- Language: TypeScript
- Homepage:
- Size: 4.59 MB
- Stars: 87
- Watchers: 6
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
NextSSS is a [Next.js](https://nextjs.org/) starter template especially for static site including full setup for TypeScript, Tailwind CSS, Google Analytics, Next SEO, active link component, etc.
## How to Use
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the template:
```bash
npx create-next-app --example https://github.com/ixkaito/nextsss
```or
```bash
yarn create next-app --example https://github.com/ixkaito/nextsss
```### Google Analytics
Edit `GA_TRACKING_ID` in `/lib/gtag.ts`.
Example:
```ts
export const GA_TRACKING_ID = 'G-XXXXXXXXXX'
```### Active `className` on a link
Example:
```ts
import Link from '../components/ActiveLink'const Nav: React.FC = () => {
return (
Home
About
)
}export default Nav
```This will dynamically add the `active` class name to each links. You can also change the `activeClassName` like this:
```ts
import Link from '../components/ActiveLink'const Nav: React.FC = () => {
return (
Home
About
)
}export default Nav
```### Image Component
You can use the same syntax of [next/image](https://nextjs.org/docs/api-reference/next/image) with static export.
Example:
```ts
import Image from '../components/Image'
import example1 from '../public/example1.png'const Home: React.FC = () => {
return (
)
}export default Home
```Note: If you want to deploy the project to Vercel, remove the custom loader from `next.config.js` and `components/Image.tsx`.
`next.config.js`
```diff
...
- images: {
- loader: 'custom',
- path: '/',
- },
...
````components/Image.tsx`
```diff
...
-const customLoader = ({ src }: { src: string }) => {
- return src
-}const Image = (props: ImageProps) => {
- return
+ return
}
...
```## Learn More
To learn more about Next.js, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
## License
MIT