PangBai

PangBai's Blog

Using WeBlog to write daily blogs

Introduction#

What is a blog? It is another world for us, where you can say what you want to say, share new things you have learned, and beautiful things. It is a cozy nest.
It is a pure land undisturbed by the secular world, where no one teaches you how to do things, and you can express everything with all your heart.
It can record your life, your growth, and even your whole life if you want.
Static blog engines allow users to run their own blogs at minimal cost. Have you ever thought about writing and publishing your own blog on your phone?
Maybe it's a formal meeting, maybe it's being in a noisy crowd, maybe it's a long and boring journey. Use the time wasted on meaningless things for summarizing and sharing.
You may have already learned about some immature solutions, but now there is a better solution here.

Introduction#

WeBlog is a static blog editor running on Android. It provides the ability to write, build, and preview blogs, as well as features such as GIT, terminal, and custom Shell scripts.
Creating new articles, managing tags, modern UI, can provide a better blogging experience. If you use Hexo or Hugo to build your own blog, this will be a good choice.
Project Github Address

Quick Start#

img_1

Start a new blog#

Create an empty folder#

The folder can be located in the SDCARD directory or the WeBlog private directory.
img

Choose a blog engine and create a blog#

The currently available blog engines are Hexo and Hugo. When creating a blog with Hexo, it may get stuck due to network issues, so it is recommended to use the terminal to create a Hexo blog.
If you are new to blogging, it is recommended to use Hugo to build your own blog, because the performance gap between Hexo and Hugo on Android has been widened, specifically in blog building and real-time preview.
(We found that Hexo's real-time preview performance on Android is not good. Compared to Hugo's instant loading preview, Hexo faces the problems of slow startup and rendering. If you only use the software's markdownView for preview, you can ignore these differences).

Real-time preview and script management#

img_2

Start real-time preview and enter the preview port (default is 4000). After successful startup, the background of the real-time preview button will change. Click the button again to close the real-time preview.
We can access the real-time preview webpage through http://localhost:4000/. At this time, Hexo will listen for markdown changes and automatically render the website pages.
WeBlog provides Busybox to create a streamlined shell environment, including commonly used commands such as wget, vi, and tar.
We can manage custom build and deployment scripts through script management. Simply create a .sh file in the .scripts folder of the project to add a new script.
Click the run button in the upper right corner to execute one or more scripts (the execution order of the scripts is the order in which they are listed in the list).

img_3

Create a new article#

Click the plus button on the homepage to bring up the article creation page.

img_4

img_5

When the article title is in ASCII characters, WeBlog will automatically remove spaces and use the string after capitalizing the first letter as the md file name.
For example, "Let us start" -> "LetUsStart.md"
When the article title is in non-ASCII characters (i.e. non-English characters), WeBlog will automatically convert the characters to md5 code and use it as the md file name (this feature can be turned off in the settings, and the title will be used as the file name when turned off).
Each article can have one category, multiple tags, and an article description.
Each time you add a new category or tag, it will be recorded by the software, making it more convenient to use when creating articles.
The article description will be displayed as the article summary in the website's article list.

Website deployment#

We recommend using the automatic build of websites on platforms such as Github and Vercel for website deployment, so that you can modify and publish your articles on any platform (via git clone, push).
If you choose to only push the rendered files to the hosting website, please also refer to the following commands.

Open github -> Setting -> Developer settings-> Personal access tokens-> Tokens(classic)-> Generate new token

Create a token with sufficient permissions to access your Github page, and access your Github repository in the following format:

git -c http.extraheader="Authorization: Basic $(echo -n your-token: | base64)" push

or

git clone https://x-access-token:[email protected]/your-username/your-repo.git

Replace your-token with the token you just obtained, and modify other information as appropriate.
You can find more information about tokens for more usage.

Deploying with SSH key#

Open the terminal at the bottom of WeBlog and enter your actual Github information.

git config --global user.name "yourname"
git config --global user.email "youremail"
ssh-keygen -t rsa -C your-email

Press Enter twice in a row.
After the terminal outputs the information, execute the following command:

cat /data/data/com.pangbai.weblog/files/home/.ssh/id_rsa.pub

Copy the output information ssh-rsa****** to the clipboard.
Open the Github page https://github.com/settings/keys and add the SSH key.
After adding, enter the following command:

If a greeting is output, it means success. You can access the repository through git commands.

Deploying with Vercel#

Please register a vercel account before using.

npm i vercel -g

Install vercel, if it fails, please change the npm mirror or use a VPN.
After successful installation, execute the following command:

vc

Log in to your vercel account using your email.
After logging in, configure vercel according to your preferences.
The command for formal deployment is:

vc --prod
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.