MIT License

项目介绍

netlify-templates/nextjs-blog-theme 是一个托管在 GitHub 上的开源项目,主要使用 JavaScript 编写,采用 MIT License 许可证,目前获得 579 个 Star、259 次 Fork。

仓库全名
netlify-templates/nextjs-blog-theme
开源许可证
MIT License
Star 数
579
Fork 数
259
未关闭 Issue
7

README 摘要

A customizable blog starter using: Next.js v15 (Pages Router) Tailwind v4.x Built-in MDX support Includes modern design with dark & light themes Take a gander at the demo. Click here to watch the template walkthrough! Table of Contents: Getting Started Setting Up Locally Using the Wizard Configuring the Blog Adding New Posts Testing Included Default Testing Removing Renovate Getting Started You can get started with…

完整内容见 GitHub 原始 README 或本页 。

常见问题

nextjs-blog-theme 用什么语言开发?

主要使用 JavaScript 编写,采用 MIT License 许可证,目前有 579 个 Star。

nextjs-blog-theme 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 nextjs-blog-theme 的源码?

可以直接克隆仓库:git clone https://github.com/netlify-templates/nextjs-blog-theme.git,默认分支为 main;安装与运行步骤见仓库 README。

nextjs-blog-theme 最近还在维护吗?

仓库最近一次更新为 2 天前,当前有 7 个未关闭 Issue;Star 数为 579,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

A customizable Next.js and Tailwind blog starter with visual editing and Git Content Source. Designed by the Bejamas agency.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
1104
价值分
425
活跃状态
活跃

语言占比

CSS
JavaScript
MDX

README

Netlify Next.js Blog Template designed by Bejamas

Deploy to Netlify Button

A customizable blog starter using:

  • Next.js v15 (Pages Router)
  • Tailwind v4.x
  • Built-in MDX support
  • Includes modern design with dark & light themes

Preview of blog theme. Author named Jay Doe and blog's name is "Next.js Blog Theme" with one blog post

Take a gander at the demo.

Click here to watch the template walkthrough!

Table of Contents:

Getting Started


You can get started with this project in two ways: locally or using the setup wizard.

Setting Up Locally

If you’re doing it locally, start with clicking the use this template button on GitHub. This will create a new repository with this template’s files on your GitHub account. Once that is done, clone your new repository and navigate to it in your terminal.

From there, you can install the project’s dependencies by running:

yarn install

Finally, you can run your project locally with:

yarn run dev

Open your browser and visit http://localhost:3000, your project should be running!

Using the Setup Wizard

Preview of Setup Wizard showing the initial page of a setup form

Through the setup wizard, you can create your blog in a few clicks and deploy to Netlify.

Configuring the blog

The config is based on environment variables to make it easy to integrate with any Jamstack platform, like Netlify.

Here are the variables you can edit:

Variable Description Options
BLOG_NAME the name of your blog, displayed below the avatar
BLOG_TITLE the main header (h1) on the home page
BLOG_FOOTER_TEXT the text in the footer
BLOG_THEME the theme to pass to Tailwind default
BLOG_FONT_HEADINGS the font-family for all HTML headings, from h1 to h6 sans-serif (default), serif, monospace
BLOG_FONT_BODY the font-family for all other HTML elements sans-serif (default), serif, monospace

All of the env variables can be configured through the Wizard or through setting the project’s environment variables. You can do this in your Netlify dashaboard (Site settings/Build & deploy/Environment/Environment variables).

https://user-images.githubusercontent.com/3611928/153997545-6dcdeef0-e570-49e7-93d6-ce0d393d16c9.mp4

[alt: video walkthrough of editing env vars]

If setting an environment variable isn’t your cup of tea, the defaults can be changed in utils/global-data.js. You can also remove the variables and hard code blog information where these variables are used in the code base.

Adding new posts

All posts are stored in /posts directory. To make a new post, create a new file with the .mdx extension.

Since the posts are written in MDX format you can pass props and components. That means you can use React components inside your posts to make them more interactive. Learn more about how to do so in the MDX docs on content.

https://user-images.githubusercontent.com/3611928/152727802-102ec296-41c8-446d-93ed-922d11187073.mp4

[alt: video walkthrough of adding a new blog post]

Testing

Included Default Testing

We’ve included some tooling that helps us maintain these templates. This template currently uses:

  • Renovate - to regularly update our dependencies

If your team is not interested in this tooling, you can remove them with ease!

Removing Renovate

In order to keep our project up-to-date with dependencies we use a tool called Renovate. If you’re not interested in this tooling, delete the renovate.json file and commit that onto your main branch.

Support

If you get stuck along the way, get help in our support forums.

评论

暂无评论