


How to use Gitblog and Markdown to build your own blog, gitblogmarkdown_PHP tutorial
如何使用Gitblog和Markdown建自己的博客,gitblogmarkdown
下面给大家分享下如何使用Gitblog和Markdown建自己的博客,如何大家拥有服务器或者云平台提供的云主机,我推荐大家使用Linux+ Nginx 来运行Gitblog,如果大家目前只有Apache环境也可以。
域名解析
将你准备好的域名解析到你的主机IP,推荐使用 dnspod 来管理和监控你的域名,具体的使用方法参考dnspod官方说明文档,非常简单。
Nginx+PHP运行环境
首先安装好你的Nginx和PHP环境,PHP版本要求5.3以上。如果你没有安装过,可Google搜索相关教程,也可以参照Nginx和PHP官方的文档。这是第一步,有一个正常的Nginx + PHP的运行环境。
配置Nginx
nginx可参考如下配置:
server { listen 80; server_name jockchou.gitblog.cn; root /data/vhosts/jockchou.gitblog.cn; index index.html index.htm index.php; location ~ \.(jpg|png|gif|js|css|swf|flv|ico)$ { expires 12h; } location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?$1 last ; break; } } location ~* ^/(doc|logs|app|sys)/ { return 403; } location ~ .*\.(php|php5)?$ { fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
将以上配置中的server_name和root改成你自己的,fastcgi_pass配成你的CGI进程端口。
权限配置
由于Gitblog的缓存机制需要写 app/cache 目录,必要时请查看并修改这个目录的权限,以确保你的PHP拥有写这个目录的权限。通常你只需要将此目录的所属者和组修改成CGI的运行账户。
运行
以上配置好以后,启动你的Nginx和CGI服务,上传Gitblog源代码到网站目录,通过浏览器访问解析到本机的域名观察页面效果。如果页面没有正常显示,通过错误码来检查你的CGI和Nginx配置。
Gitblog介绍
一. 简介
Gitblog是一个简单易用的Markdown博客系统,它不需要数据库,没有管理后台功能,更新博客只需要添加你写好的Markdown文件即可。它摆脱了在线编辑器排版困难,无法实时预览的缺点,一切都交给Markdown来完成,一篇博客就是一个Markdown文件。同时也支持评论,代码高亮,数学公式,页面PV统计等常用功能。Gitblog提供了不同的主题样式,你可以根据自己的喜好配置,如果你想自己制作博客主题,也是非常容易的。Gitblog还支持整站静态导出,你完全可以导出整站静态网页部署到Github Pages。
二. 功能特点
使用Markdown
评论框
代码高亮
PV统计
Latex数学公式
自制主题
响应式
全站静态导出
良好的SEO
三. GitBlog优势
无需数据库,系统更轻量,移植更方便
使用Markdown编写,摆脱后台编辑排版困难,无法实时预览的缺点
可全站静态导出
配置灵活,可自由开关某些功能
多主题支持,可自制主题
博客,分类,标签,归档
四. 环境要求
PHP 5.2.4+
五. 安装步骤
下载Gitblog源代码
解压上传到你的PHP网站根目录
打开浏览器,访问网站首页
上传Markdown文件到 posts 文件夹
以上内容就是如何使用Gitblog和Markdown建自己的博客的全部内容,希望大家能够喜欢。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Vue implements the blog front-end and needs to implement markdown parsing. If there is code, it needs to implement code highlighting. There are many markdown parsing libraries for Vue, such as markdown-it, vue-markdown-loader, marked, vue-markdown, etc. These libraries are all very similar. Marked is used here, and highlight.js is used as the code highlighting library. The specific implementation steps are as follows: 1. Install dependent libraries. Open the command window under the vue project and enter the following command npminstallmarked-save//marked to convert markdown into htmlnpmins

Starting from scratch, I will teach you step by step how to install Flask and quickly build a personal blog. As a person who likes writing, it is very important to have a personal blog. As a lightweight Python Web framework, Flask can help us quickly build a simple and fully functional personal blog. In this article, I will start from scratch and teach you step by step how to install Flask and quickly build a personal blog. Step 1: Install Python and pip Before starting, we need to install Python and pi first

With the development of the Internet, blogs have become a platform for more and more people to share their lives, knowledge and ideas. If you also want to create a blog of your own, then this article will introduce how to use PHP and SQLite to create a simple blog. Determine the needs Before starting to create a blog, we need to determine the functions we want to achieve. For example: Create a blog post Edit a blog post Delete a blog post Display a list of blog posts Display blog post details User authentication and permission control Install PHP and SQLite We need to install PHP and S

Blog, also translated as web log, blog or blog, is a website that is usually managed by individuals and posts new articles from time to time. So how to set up a blog? What are the PHP blog systems? Which blogging system is best to use? Below, PHP Chinese website will summarize and share the top ten open source PHP blog systems with you. Let’s take a look!

First, make sure you have Python3 and Tkinter installed. Other things we need are tkhtmlview and markdown2. You can install them by running pipinstalltkhtmlviewmarkdown2 or pip3installtkhtmlviewmarkdown2 (if you have multiple Python versions). Now launch your favorite editor or IDE and create a new file (for example www.linuxidc.com.py (I named it linuxidc.com editor)). We'll start by importing the necessary libraries. fromtkinterimport*fro

How to use markdown in VScode? The following article will introduce you to the method of configuring Markdown in VScode, and talk about the basic syntax of Markdown. I hope it will be helpful to you!

How to create a simple blog using PHP 1. Introduction With the rapid development of the Internet, blogs have become an important way for people to share experiences, record life and express opinions. This article will introduce how to use PHP to create a simple blog, with specific code examples. 2. Preparation Before starting, you need to have the following development environment: a computer with a PHP interpreter and Web server (such as Apache) installed, a database management system, such as MySQL, a text editor or IDE3

With the popularity of the Internet, blogs play an increasingly important role in information dissemination and communication. In this context, more and more people are starting to build their own blog sites. This article will introduce how to use the PythonDjango framework to build your own blog website. 1. Introduction to the PythonDjango framework PythonDjango is a free and open source web framework that can be used to quickly develop web applications. The framework provides developers with powerful tools to help them build feature-rich
