Original address: www.hz-bin.cn/BuildBlog

1. How to use Github Page to deploy personal blog

  • The logingithubClick on the upper right corner to create a warehouse and fill in the name of the warehouseusername.github.io, includingusernameFill in your owngithubThe name, such as the blogger’s ishz-binIs the warehouse namehz-bin.github.io.

  • project-entrySettings->PagesPage,SourcechoosemasterAnd then clickSaveIf yes, the deployment is completehz-bin.github.ioTo make an interview.

2. How to edit blog content using Jekyll and TeXt themes

  • Local deploymentjekyllEnvironmental resourcesJekyll 中文 版
  • Local cloneThe TeXt themeAnd then enter intojekyll-TeXt-themeCatalog, if availableGemfile.lockFile, delete the file first.
  • Then execute it on the command line firstgem install bundler jekyllCommand, and then executebundle exec jekyll serve, the local blog is set up
  • Type in the browserhttp://localhost:4000/Access to blog content.
  • How to add a blogIn:_postsNew directorymarkdownFormat File name formatyyyy-mm-dd-blogname.md.jekyllIt builds automatically.

3. How to configure Gitalk as the comment system of blog

  • First, you need to create an OAuth Application (upper right profile picture -> Settings -> Developer Settings -> OAuth Apps -> New OAuth App), as shown below:

  • Click on theGenerate a new client secret:

  • willClient IDAnd the newly createdClient secretsCopy to_config.ymlIn the file, other parameters are shown as follows:

After the configuration is complete, a 403 error may occur when logging in to Gitalk. Please refer to gitalk comments to troubleshoot the 403 problem and create a free online proxy on CloudFlare to troubleshoot the 403 problem

4. How to configure leanCloud to record the number of articles accessed

  • First of all to enterLeanCloud, create an application and fill in the name of the application. Then enter the setting interface, as shown below,_config.ymlConfiguration,pageviewproviderleancloud.leancloudapp_idapp_keyFill in the application credential interface respectivelyAppIDAppKey.

  • app_classBlogOr define a name for yourself,LeanCloudWill use the name inData Storage -> Structured dataClass, which is equivalent to storing the number of times the table is accessed.

  • Modify the_includes/pageview-providers/leancloud/leancloud.js, as shown below,serverURLsInstead ofserverURL, the value is changed to that in the application credentials aboveREST API server address.

Please refer to official documentation:

Initialization: leancloud.cn/docs/sdk_se…

Data Storage Primer · JavaScript: leancloud.cn/docs/leanst…

5. How to set a custom domain name for your blog

  • First need to apply for a domain name, this blog domain name from Tencent cloud application.
  • After applying for a domain name, enter the domain name management page and click Resolve.

  • Add the following two records, whereipThe address is throughping hz-bin.github.io:

  • Into thegithubThe projectSettings -> PagesConfiguration interface,Custom domainEnter the domain name you just registered and tick itEnforce HTTPSAnd then save. Wait about 10 minutes and you’ll be throughhttps://www.hz-bin.cnThe visit.

Gitalk and Cloudflare are modified

  • After the domain name is configured, the gitalk login cannot be accessed and the article count cannot be obtained. You need to modify the related configuration.
  • The logingithubIn the upper right corner of the profile picture -> Settings -> Developer Settings -> OAuth Apps, see the following interface, click the new in section 3OAuth applicationThat will beHomepage URLAuthorization callback URLChange to a new blog addresshttps://www.hz-bin.cnAnd then save.

  • Log in to CloudFlare and do as shown:

This article is published by OpenWrite!