# Linux C++ Server Development Framework 0-1 **Repository Path**: guang11cheng/Linux-CPP-Server-Development-Framework-0-1 ## Basic Information - **Project Name**: Linux C++ Server Development Framework 0-1 - **Description**: 从0到1搭建 Linux C++ 服务器开发框架 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-08-22 - **Last Updated**: 2024-03-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # README.md ## hugo 和 hugo-book 主题 [hugo github](https://gohugo.io/) [hugo-book github](https://github.com/alex-shpak/hugo-book) ## 下载安装 hugo_extended ```bash wget https://github.com/gohugoio/hugo/releases/download/v0.123.8/hugo_extended_0.123.8_linux-amd64.deb sudo dpkg -i ./hugo_extended_0.123.8_linux-amd64.deb ``` ## 创建 site ```bash hugo new site 'Linux-CPP-Server-Development-Framework-0-1' -f cd 'Linux-CPP-Server-Development-Framework-0-1' git submodule add https://github.com/alex-shpak/hugo-book themes/hugo-book echo "theme = 'hugo-book'" >> hugo.toml cp -R themes/hugo-book/exampleSite/content.en/* ./content ``` ## 启动测试服务器 ```bash hugo server -D ``` 浏览器访问:http://localhost:1313/ ## 打包到 public 目录 ```bash rm -rf public hugo mkdir -p /usr/share/nginx/html/www.datals.com/ sudo cp -rf public/* /usr/share/nginx/html/www.datals.com/ ``` nginx 配置:vi /etc/nginx/conf.d/www.datals.com.conf ```nginx server { ##### http ##### listen 80; # Configure the server for HTTP on port 80 server_name www.datals.com; # Your domain name root /usr/share/nginx/html/www.datals.com; # The files for your server index index.html; # To enable the usage of the custom 404 landing page in your Hugo theme, instead of the default Nginx page error_page 404 /404.html; ##### Enable client-side caching ##### # Media location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|mp4|ogg|ogv|webm|htc)$ { expires 30d; } # CSS and Js location ~* \.(css|js)$ { expires 7d; } } ``` sudo service nginx reload 本地 host 配置:vi /etc/hosts 127.0.0.1 www.datals.com 浏览器访问:www.datals.com ## 在 content 目录中添加内容 或者:hugo new docs/001/001/001.md 目录文件:content/menu/index.md 每个章节的描述文件:_index.md title 在每个 .md 文件中定义,如果没有定义 title,则取目录/文件名为 title。 ## toml 常用语法 ## nginx 配置 给一个域名生成一份 nginx 配置文件: 使用 certbot 管理 nginx 的 https 证书,并配置定时任务自动更新过期到证书。 todo 发布到 github 上 wowchemy: 评论插件: 遗留问题:显示了[TOC]文字。 vercel: