export default function Home({articles}) {
return (
<div>
{articles.data.map(item=><div>{item.title}</div>)}
</div>
)
}
export async function getStaticProps() {
// Call an external API endpoint to get posts
const articles = await Axios({
method: 'get',
url: '/articlelist?page=1',
})
return {
props: {
articles:articles.data,
},
}
}
常见错误如下:
Error: Error serializing `.articles` returned from `getStaticProps` in “/”. Reason: `undefined` cannot be serialized as JSON. Please use `null` or omit this value.
You can use Docker Compose to easily run WordPress in an isolated environment built with Docker containers. This quick-start guide demonstrates how to use Compose to set up and run WordPress. Before starting, make sure you have Compose installed.
You can name the directory something easy for you to remember. This directory is the context for your application image. The directory should only contain resources to build that image.
The docker volumes db_data and wordpress_data persists updates made by WordPress to the database, as well as the installed themes and plugins. Learn more about docker volumes
WordPress Multisite works only on ports 80 and 443.
wodpress多站点工作仅仅在80和443端口
Build the project
Now, run docker-compose up -d from your project directory.
现在在项目文件夹运行 docker-compose up -d
This runs docker-compose up in detached mode, pulls the needed Docker images, and starts the wordpress and database containers, as shown in the example below.
这个运行 docker-compose up 在分离模式,拉去需要的docker 镜像,然后启动wordpress和数据库容器,如下所示。
Bring up WordPress in a web browser
At this point, WordPress should be running on port 8000 of your Docker Host, and you can complete the “famous five-minute installation” as a WordPress administrator.
Shutdown and cleanup
The command docker-compose down removes the containers and default network, but preserves your WordPress database.
The command docker-compose down --volumes removes the containers, default network, and the WordPress database.
All of the components in Tailwind UI are designed for Tailwind CSS >= v2.0. To make sure that you are on the latest version of Tailwind, update via npm:
All of the examples in Tailwind UI rely on the default Tailwind CSS v2.0 configuration, but some rely on additional first-party plugins like @tailwindcss/forms, @tailwindcss/typography, and @tailwindcss/aspect-ratio.
We’ve used Inter font family for all of the Tailwind UI examples because it’s a beautiful font for UI design and is completely open-source and free. Using a custom font is nice because it allows us to make the components look the same on all browsers and operating systems.
我们使用 Inter 字体为所有的tailwind ui 示例 因为它是一个漂亮的字体为ui设计并且完全开源和自由。使用自定义字体很好因为它允许我们使组件在所有浏览器和操作系统看起来一样。
You can use any font you want in your own project of course, but if you’d like to use Inter, the easiest way is to first add it via the CDN:
EditorConfig helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs. The EditorConfig project consists of a file format for defining coding styles and a collection of text editor plugins that enable editors to read the file format and adhere to defined styles. EditorConfig files are easily readable and they work nicely with version control systems.