search
HomeBackend DevelopmentPHP TutorialHow 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建自己的博客的全部内容,希望大家能够喜欢。

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1041329.htmlTechArticle如何使用Gitblog和Markdown建自己的博客,gitblogmarkdown 下面给大家分享下如何使用Gitblog和Markdown建自己的博客,如何大家拥有服务器或者云平台...
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
PHP Dependency Injection Container: A Quick StartPHP Dependency Injection Container: A Quick StartMay 13, 2025 am 12:11 AM

APHPDependencyInjectionContainerisatoolthatmanagesclassdependencies,enhancingcodemodularity,testability,andmaintainability.Itactsasacentralhubforcreatingandinjectingdependencies,thusreducingtightcouplingandeasingunittesting.

Dependency Injection vs. Service Locator in PHPDependency Injection vs. Service Locator in PHPMay 13, 2025 am 12:10 AM

Select DependencyInjection (DI) for large applications, ServiceLocator is suitable for small projects or prototypes. 1) DI improves the testability and modularity of the code through constructor injection. 2) ServiceLocator obtains services through center registration, which is convenient but may lead to an increase in code coupling.

PHP performance optimization strategies.PHP performance optimization strategies.May 13, 2025 am 12:06 AM

PHPapplicationscanbeoptimizedforspeedandefficiencyby:1)enablingopcacheinphp.ini,2)usingpreparedstatementswithPDOfordatabasequeries,3)replacingloopswitharray_filterandarray_mapfordataprocessing,4)configuringNginxasareverseproxy,5)implementingcachingwi

PHP Email Validation: Ensuring Emails Are Sent CorrectlyPHP Email Validation: Ensuring Emails Are Sent CorrectlyMay 13, 2025 am 12:06 AM

PHPemailvalidationinvolvesthreesteps:1)Formatvalidationusingregularexpressionstochecktheemailformat;2)DNSvalidationtoensurethedomainhasavalidMXrecord;3)SMTPvalidation,themostthoroughmethod,whichchecksifthemailboxexistsbyconnectingtotheSMTPserver.Impl

How to make PHP applications fasterHow to make PHP applications fasterMay 12, 2025 am 12:12 AM

TomakePHPapplicationsfaster,followthesesteps:1)UseOpcodeCachinglikeOPcachetostoreprecompiledscriptbytecode.2)MinimizeDatabaseQueriesbyusingquerycachingandefficientindexing.3)LeveragePHP7 Featuresforbettercodeefficiency.4)ImplementCachingStrategiessuc

PHP Performance Optimization Checklist: Improve Speed NowPHP Performance Optimization Checklist: Improve Speed NowMay 12, 2025 am 12:07 AM

ToimprovePHPapplicationspeed,followthesesteps:1)EnableopcodecachingwithAPCutoreducescriptexecutiontime.2)ImplementdatabasequerycachingusingPDOtominimizedatabasehits.3)UseHTTP/2tomultiplexrequestsandreduceconnectionoverhead.4)Limitsessionusagebyclosin

PHP Dependency Injection: Improve Code TestabilityPHP Dependency Injection: Improve Code TestabilityMay 12, 2025 am 12:03 AM

Dependency injection (DI) significantly improves the testability of PHP code by explicitly transitive dependencies. 1) DI decoupling classes and specific implementations make testing and maintenance more flexible. 2) Among the three types, the constructor injects explicit expression dependencies to keep the state consistent. 3) Use DI containers to manage complex dependencies to improve code quality and development efficiency.

PHP Performance Optimization: Database Query OptimizationPHP Performance Optimization: Database Query OptimizationMay 12, 2025 am 12:02 AM

DatabasequeryoptimizationinPHPinvolvesseveralstrategiestoenhanceperformance.1)Selectonlynecessarycolumnstoreducedatatransfer.2)Useindexingtospeedupdataretrieval.3)Implementquerycachingtostoreresultsoffrequentqueries.4)Utilizepreparedstatementsforeffi

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Article

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor