用Hexo的方式管理WordPress(使用Github Actions自动更新文章到WordPress)

Overview

方圆小站Github仓库

---start---

目录(2021年02月17日更新)

《刺杀小说家》一个勇士屠恶龙救苍生的故事

衡水的中学为高考服务,996.icu为人民企业家服务

轻薄的代价(纪念不足两岁MacBook轻薄本的陨落)

PP鸭最佳替代品!《图压》批量压缩图片而不损失画质,支持JPG,PNG,GIF,SVG

解决Chrome开发中http强制跳转https

Node.js爬虫获取漫威超级英雄电影海报

InDesign转曲字体 导出PDF的技巧

Python写给前端的脚本!网站图片素材中文转英文

B站黑白滤镜

简单三步, 搭建全平台私有同步网盘

让Css3动画变得有趣WOWjs

193MB的 Office 2016 四合一精简珍藏版,支持 win7 win8 win8.1 win10 x86/x64 系统

使用Github Actions 动态更新Github主页

《百度网盘闲时下载卡》别家公司996, 我百度凌晨1点刚上线,如何改进闲时下载卡?Make Baidu Great Again!

从「我的代码要改变世界」到「代码也不是最重要滴」

用Github Actions运行Python脚本更新仓库博客到WordPress,手机写Markdown同步更新到Github和WordPress攻略

Xbox 2020 series手柄体验实录(附自制Xbox体感射击技巧)

建立个人独立博客有什么好处?

zhaoolee的Github主页

---end---

用Github Actions写Markdown文章,自动更新到WordPress

  • 写博客最舒服的格式是Markdown;

  • 管理博客站最省心的方式是WordPress;

  • 推广博客站最好的平台是Github;

这个项目可以让你用Markdown写博客,push更新到Github后,Github Actions自动将文章更新到WordPress,并将WordPres站的文章索引更新到Github仓库的README.md,供搜索引擎收录。

image-20210119181051609

程序永久开源更新地址

https://github.com/zhaoolee/WordPressXMLRPCTools

如何实现WordPress登录授权?

WordPress默认开启了xmlrpc服务,xmlrpc是一套的统用的博客更新标准,允许用户以POST方式自动对文章内容进行增删改查。授权方式为 用户名 和 密码, 在WordPress中是后台登录的账户名和密码

我的WordPress网站为 https://fangyuanxiaozhan.com

image-20210119180338929

它的xmlrpc服务地址为 https://fangyuanxiaozhan.com/xmlrpc.php

image-20210119180403270

使用Github Actions 有什么好处?

Github Actions 可以让我们无需安装开发环境,即可完成代码的运行。

image-20210119180656968

对于本项目而言,我可以用手机版Git App,或者Github网页完成新建文章, 然后push到仓库,Github Actions会自动帮我完成相关代码运行,代码可以帮我更新文章到WordPress网站,并生成新的文章目录索引,并自动给你更新到README.md, 供搜索引擎收录。

image-20210119180529083

如何保护自己的WordPress账户密码?

Github 有一个secrets 功能,可以将用户名密码等关键信息保护起来,只有Github Actions可以读取到关键信息。

本项目需要设置三个secret

  • WordPress登录用户名, 变量名为 USERNAME
  • WordPress登录密码,变量名为 PASSWORD
  • WordPress的xmlrpc.php,变量名为 XMLRPC_PHP

image-20210119173133800

如何新建文章?

_post 目录下新建 后缀为 .md 的markdown文件即可

image-20210119181544158

文章管理:如何为文章分类/加关键词标签?

.md 文件顶部填写以下初始化信息,即可完成标题(title),标签(tags),分类(categories)的设置,其中title为必填项目(这些关键词不是我定义的,我借用了著名静态博客构建工具 hexo 的标准)

---
title: 我是标题
tags: 
- 我是0号标签关键词
- 我是1号标签关键词
- 我是2号标签关键词
categories:
- 我是1号分类
- 我是2号分类
---

标签(tags)和分类(categories)有什么区别?

标签(tags)是针对单篇文章的关键词,比如香蕉的标签有 黄色味甜 (标签是香蕉的属性) 分类(categories)是本篇文章的归属,比如香蕉的分类为 水果植物

image-20210119182027684

如何设置固定链接?

对于博客而言,文章拥有一个固定的链接,是很重要的,我经过各种尝试,最终借鉴了 简书 的文章url形式,域名后加 /p/ , 再加英文文件名,只要不改变英文文件名,文章就有固定的链接,我在_posts 目录下新建一个 2020-01-18-blog.md 文件,同步后的文章url为

https://fangyuanxiaozhan.com/p/2020-01-18-blog/

文件名与网站url严格对应,既方便了修改,又可以在网站数据库出事故后,迅速从github仓库迅速恢复文章内容(容灾),连url都不会变。

image-20210119171713841

如何使用?

完成以上配置后

每次在_posts 文件夹新增或更新文章后,运行

git pull && git add _posts && git commit -m "update" && git push

image-20210119182503520

即可!

image-20210119182653436

Github README.md显示效果,(新增的文章排在首位)

image-20210119184015781

WordPress网站也同步发布了文章

image-20210119182849720

https://fangyuanxiaozhan.com/p/2020-01-19-18-00-wordpressxmlrpctools/

如何用手机完成博客更新操作?

微信图片_20210119192838

用锤子便签,可以优雅舒适地写Markdown,手机App很好用,还有网页版可以用,有5GB的免费空间,能写到锤子倒闭。

如果遇到插入图片的问题,可以使用 免费图床图壳

https://imgkr.com/#upload

Pocket Git 和 MT管理器可以配合完成Git 文件的新增更新和上传。

程序永久开源更新地址(求Star):

https://github.com/zhaoolee/WordPressXMLRPCTools

当我们把毕生所学,通过几十年如一日的博客更新,逐步开源到互联网上时,必将会造福更多志同道合的人。

Owner
zhaoolee
不要因为走的太远,就忘了当初为什么出发。(指「为人民服务」)
zhaoolee
用Hexo的方式管理WordPress(使用Github Actions自动更新文章到WordPress)

方圆小站Github仓库 ---start--- 目录(2021年02月17日更新) 《刺杀小说家》一个勇士屠恶龙救苍生的故事 衡水的中学为高考服务,996.icu为人民企业家服务 轻薄的代价(纪念不足两岁MacBook轻薄本的陨落) PP鸭最佳替代品!《图压》批量压缩图片而不损失画质,支持JPG,

zhaoolee 166 Jan 06, 2023
Python scripts to interact with the CakeCMS API.

Python scripts to interact with the CakeCMS API. Installation of the python module Prerequisites The cakecms module has to be installed first. Install

Fabian Thomas 3 Jan 31, 2022
A Django content management system focused on flexibility and user experience

Wagtail is an open source content management system built on Django, with a strong community and commercial support. It's focused on user experience,

Wagtail 13.8k Jan 01, 2023
Ticket shop application for conferences, festivals, concerts, tech events, shows, exhibitions, workshops, barcamps, etc.

pretix Reinventing ticket presales, one ticket at a time. Project status & release cycle While there is always a lot to do and improve on, pretix by n

pretix 1.3k Jan 01, 2023
The easy-to-use and developer-friendly CMS

django CMS Open source enterprise content management system based on the Django framework and backed by the non-profit django CMS Association. Get inv

django CMS Association 9.1k Jan 08, 2023
Simple yet powerful and really extendable application for managing a blog within your Django Web site.

Django Blog Zinnia Simple yet powerful and really extendable application for managing a blog within your Django Web site. Zinnia has been made for pub

Julien Fache 2.1k Dec 24, 2022
🐰 Bunnybook 🐰 A tiny social network (for bunnies), built with FastAPI and React+RxJs.

🐰 Bunnybook 🐰 A tiny social network (for bunnies), built with FastAPI and React+RxJs. Click here for live demo! Included features: 💬 chat 🔴 online

Pietro Bassi 190 Jan 03, 2023
Link aggregator community organised by tags in python3/django3 + sqlite3.

sic Link aggregator community organised by tags in python3/django3 + sqlite3. Public instance at https://sic.pm and Tor hidden service.

Manos Pitsidianakis 97 Dec 30, 2022
Website for PyCon

PyCon 2019 Web Site Built by the Python Community atop the Django web framework. Rather than use this as the basis for your conference site directly,

PyCon 155 Nov 05, 2022
Indico - A feature-rich event management system, made @ CERN, the place where the Web was born.

Indico Indico is: ? a general-purpose event management tool; ? fully web-based; ? feature-rich but also extensible through the use of plugins; ⚖️ O

Indico 1.4k Dec 31, 2022
The Plone CMS: root integration package

About Plone Plone is a mature, secure and user-friendly Content Management System (CMS). Plone - and the Open Source community behind it - aggregates

Plone Foundation 200 Jan 08, 2023
Journey is a journaling app where users can create their own journal and entries in it!

Journey is a journaling app where users can create their own journal and entries in it!

Hieu Ma 8 Dec 12, 2021
Random tarot card generator + rudimentary Django CMS

TAROT JUICER This is a rudimentary Django-based CMS which dynamically presents tarot-related content placed onto unconventional but familiar contexts

Kyle Rafa Lazaro 7 Apr 26, 2022
A plugin for Wagtail CMS, to have Icon Blocks (Fontawesome support)

WAGTAIL ICONIFY Library developed for Wagtail CMS, its purpose is to provide icon blocks from various libraries Special thanks to Alex Gleason, as wel

2 Jun 07, 2022
An encylopedia that runs on Django as part of CS50w's coursework

Django Wiki As part of the CS50w course, this project aims to apply the use of Django together with HTML and CSS to replicate an encyclopedia. Require

Beckham 1 Oct 28, 2021
LOOKING FOR NEW MAINTAINER - Quokka is a Content Management System - `docker run --rm -it -p 5000:5000 quokka/quokka`

Quokka The Happiest CMS in the world Quokka is a Content Management Framework written in Python. A lightweight framework to build CMS (Content Managem

Quokka Project 2.2k Jan 01, 2023
LibreLingo🐢 🌎 📚 a community-owned language-learning platform

LibreLingo's mission is to create a modern language-learning platform that is owned by the community of its users. All software is licensed under AGPLv3, which guarantees the freedom to run, study, s

Daniel Kantor 1.4k Jan 09, 2023
An open source CMS, in python and integrable in Django

Python CMS based on the Django Framework

Titouan Bénard 0 Sep 10, 2021
A Django blog app implemented in Wagtail

Puput Puput is a powerful and simple Django app to manage a blog. It uses the awesome Wagtail CMS as content management system. Puput is the catalan n

APSL 535 Jan 08, 2023
Open Source CRM based on Django

Django-CRM Django CRM is opensource CRM developed on django framework. It has all the basic features of CRM to start with. We welcome code contributio

MicroPyramid 1.4k Dec 31, 2022