当前位置:网站首页>[technical grass planting] cdn+ lightweight server +hugo= let the blog "cloud native"
[technical grass planting] cdn+ lightweight server +hugo= let the blog "cloud native"
2022-06-24 01:30:00 【User 1435446】
Building your own blog site should be one of the first romantic experiences of many programmers , Various reasons often make this romance fade away . Today I will introduce my blog solution :cdn+ Lightweight servers +hugo= Let blog “ Cloud native ” once .
How convenient is this solution ?
I'm writing this blog right now , There are only three things you need to do to publish to a website :
hugo new posts/cloudnative-blog-using-tencent-cloud.md- Use vscode edit markdown file
bash deploy.sh
deploy.sh I wrote my own one click script , Role is :
- Commit current changes to github
- ssh To a lightweight server , Installation dependency (hugo、nginx)、git pull、 Use hugo Generate static blogs 、nginx reload.
Don't be shell The script scared ,deploy.sh It's very simple :
#! /bin/bash
dir=$PWD
host=$([ "$1" = "" ]&& echo "yourhostname"|| echo "$1")
port=22
git pull
git add .
git commit -m "commit @arloor $(date)"
git push
if [ "$?" = 0 ]
then
# Call... On the server tarloor command
# The order will check httpd、hugo、 and git Warehouse , And generate static websites to nginx Of html Catalog , Realize one click website deployment
ssh [email protected]$host -p$port -t "
bash tarloor 0 # 0 Don't use agents ,1 Using agents
"
echo -e "\033[32m Please visit : https://"$host"\033[0m"
else
echo -e "\033[32m Push failed \033[0m"
fissh To a lightweight server tarloor The command is also a shell Script , The following commands can be executed on the lightweight server to download :
# centos8、centos stream、rockylinux、almalinux Etc rpm Of Linux Distribution version wget -O /usr/local/bin/tarloor http://arloor.com/tarloor.sh # ubuntu、debian Etc deb Of Linux Distribution version wget -O /usr/local/bin/tarloor http://www.arloor.com/tarloor_deb.sh
There is such a convenient writing and publishing environment , Blogging is fun !
hugo The fastest static website builder
hugo Our ecology is very good , There are many custom themes to choose from . The theme I choose is hyde-hyde, It's quite retro . Students can go to hugo Theme page Choose a theme , You can also directly put the github project clone Come down , hold content\posts You can have your own original blog by deleting all the articles under .
Use cdn Accelerate domestic visits
Because the lightweight server will execute git pull To github Pull the latest content from the blog , And domestic server access GitHub Speed is really pulling the crotch , I chose the server of Tencent cloud in Hong Kong .
Tencent cloud's lightweight servers in Hong Kong, China have a good domestic access speed , For the sake of stability , I still use Tencent cloud cdn Accelerated domestic visits , Just open cdn service , Then configure the origin station .
边栏推荐
- Dart series part: asynchronous programming in dart
- CODING CD
- How to open Tencent enterprise mailbox and Tencent enterprise mailbox login portal
- Shengdun technology joined dragon lizard community to build a new open source ecosystem
- November 17, 2021: the longest path of the same value. Given a binary tree, find the longest path
- How to build a practical website and how to operate after the website goes online
- Application analysis of video edge computing gateway easynvr in video overall monitoring solution
- How to write the domain name of trademark registration? What is the process of trademark and domain name registration?
- Build a smart drug supervision platform based on easycvr video technology and build a drug safety firewall
- How to build a pagoda panel web site on Tencent ECS?
猜你喜欢

【Flutter】如何使用Flutter包和插件

Cvpr2022 𞓜 thin domain adaptation
Talk to Wu Jiesheng, head of Alibaba cloud storage: my 20 years of data storage (unlimited growth)

Cross domain and jsonp

LMS Virtual. Derivation method of lab acoustic simulation results
Shengdun technology joined dragon lizard community to build a new open source ecosystem

An accident caused by a MySQL misoperation, and the "high availability" cannot withstand it!

Use recursion to form a multi-level directory tree structure, with possibly the most detailed notes of the whole network.
![[flutter] comment utiliser les paquets et plug - ins flutter](/img/a6/e494dcdb2d3830b6d6c24d0ee05af2.png)
[flutter] comment utiliser les paquets et plug - ins flutter

985 Android programmers won the oral offer of Alibaba P6 in 40 days. After the successful interview, they sorted out these interview ideas
随机推荐
How does the fixed assets management software reduce costs and increase efficiency for enterprises?
EasyPlayer. JS play m3u8 error net:: err_ EMPTY_ Response, how to solve it?
Batch generation of 2D codes from txt files
Is the domain name available for trademark registration? How long is the trademark registration cycle?
Online and offline integrated operation of channel sales system in the home furnishing industry to promote product update and iteration
5-step method to quickly find data analysis ideas
Build a smart drug supervision platform based on easycvr video technology and build a drug safety firewall
NJS triggers system command operation
[technical grass planting] take you to Tencent cloud's private cloud disk in ten minutes
Activity Registration - Tencent cloud digital intelligence driven SME transformation and upgrading series salon · Zhuhai station
Longest substring without duplicate characters
How to build a practical website and how to operate after the website goes online
CDN access log quality performance monitoring and operation statistical analysis best practices
Interviewer: why does the new generation memory need two survivor zones?
[shutter] how to use shutter packages and plug-ins
Shengdun technology joined dragon lizard community to build a new open source ecosystem
2021-11-21: map[i][j] = = 0, which means that (I, J) is an ocean. If you cross it, the cost will be
. Net core cross platform development bbs forum (connotation source code + complete operation video)
Openstack
Solve the problem that Base64 compressed files are extracted with spaces after post request