静态网站生成器hugo安装配置主题

install-hugo 下载Hugo 对应平台解压得到二进制文件 Linux安装hugo 以64bit为例,此安装方法适用于debian ubuntu centos openwrt等X64位的系统 wget https://github.com/gohugoio/hugo/releases/download/v0.54.0/hugo_0.54.0_Linux-64bit.tar.gz tar zxvf hugo_0.54.0_Linux-64bit.tar.gz mv hugo /usr/bin/hugo Windows安装hugo 下载hugo_extended_0.54.0_Windows-64bit.zip 并解压缩 C:\Hugo\bin - hugo.exe - LICENSE - README.md 添加到PATH set PATH=%PATH%;C:\Hugo\bin 验证是否安装成功 hugo version 能看到Hugo版本号说明已经成功安装好了hugo C:\Hugo>set PATH=%PATH%;C:\Hugo\bin C:\Hugo>hugo version Hugo Static Site Generator v0.54.0/extended windows/amd64 BuildDate: unknown C:\Hugo> Hugo新建网站 使用以下命令新建站点 hugo new site blog Hugo会自动新建名为blog的文件夹 C:\HUGO\BLOG ├─archetypes ├─content ├─data ├─layouts ├─static └─themes 文件夹描述相关 archetypes使用hugu new post生成新文章的模板,可以自定义里面的值 content 存放网站内容 data 存储Hugo在生成您的网站时可以使用的配置文件 layouts 以.html文件的形式存储模板,指定如何将内容的视图呈现到静态网站中 static 存储所有静态内容:图像,CSS,JavaScript等,当Hugo构建您的站点时,静态目录中的所有资产都将按原样复制 themes 存放主题 config.toml 配置文件 进入blog的文件夹 ...

七月 19, 2018 · admin

在Linux_VPS上使用rclone挂载GoogleDrive云端硬盘和MicrosoftOneDrive

rclone可以在Linux上挂载包括 Rclone is a command line program to sync files and directories to and from: Alibaba Cloud (Aliyun) Object Storage System (OSS) Amazon Drive (See note) Amazon S3 Backblaze B2 Box Ceph DigitalOcean Spaces Dreamhost Dropbox FTP Google Cloud Storage Google Drive HTTP Hubic Jottacloud IBM COS S3 Koofr adminmset Memstore adminga Microsoft Azure Blob Storage Microsoft OneDrive Minio Nextcloud OVH OpenDrive Openstack Swift Oracle Cloud Storage ownCloud pCloud put.io QingStor Rackspace Cloud Files Scaleway SFTP Wasabi WebDAV Yandex Disk The local filesystem 且不会占用本地硬盘空间 ...

六月 13, 2018 · admin

利用Caddy,Nginx反向代理谷歌YouTube等网站

Caddy - The HTTP/2 Web Server with Automatic HTTPS go语言一个二进制单文件就是服务端 自动申请Let’s Encrypt免费的SSL/TLS证书,自动续期。 Caddy一键安装脚本 wget -N --no-check-certificate https://raw.githubusercontent.com/ojbk8/ToyoDAdoubiBackup/master/caddy_install.sh && chmod +x caddy_install.sh && bash caddy_install.sh caddy_conf_file="/usr/local/caddy/Caddyfile" 日志文件:cat /tmp/caddy.log 使用说明:service caddy start | stop | restart | status 或者使用:/etc/init.d/caddy start | stop | restart | status ...

五月 21, 2018 · admin

gitbook安装和插件的使用

gitbook安装使用插件教程 安装gitbook 先下载安装Node.js,然后 npm install -g gitbook-cli gitbook init gitbook install ./ gitbook build gitbook serve 提示如下 D:\gitbook>gitbook serve Live reload server started on port: 35729 Press CTRL+C to quit ... info: 7 plugins are installed info: loading plugin "livereload"... OK info: loading plugin "highlight"... OK info: loading plugin "search"... OK info: loading plugin "lunr"... OK info: loading plugin "sharing"... OK info: loading plugin "fontsettings"... OK info: loading plugin "theme-default"... OK info: found 5 pages info: found 4 asset files info: >> generation finished with success in 1.0s ! Starting server ... Serving book on http://localhost:4000 你可以你的浏览器中打开这个网址: (http://localhost:4000) 预览 ...

五月 17, 2018 · admin

hexo备份更换设备后同步编辑

备份hexo原始配置文件 压缩打包备份原始的hexo配置文件scaffolds, source, themes 和 _config.yml 在新电脑上重新布署安装一次hexo cd /d npm install hexo-cli -g hexo init blog cd blog npm install npm install hexo-deployer-git --save git init npm install hexo-generator-feed --save npm install hexo-generator-sitemap --save npm install hexo-generator-baidu-sitemap --save npm install hexo-generator-searchdb --save git clone https://github.com/iissnan/hexo-theme-next themes/next 然后覆盖替换掉原有的文件scaffolds, source, themes 和 _config.yml hexo远程同步到github 登陆GitHub并创建分支为username.github.io 可以点击Join GitHub注册账号 git config --global user.name "username" git config --global user.email "youremail@gmail.com" ssh-keygen -t rsa -C 'youremail@gmail.com' Your public key has been saved in /c/Users/admin/.ssh/id_rsa.pub. 按提示一路回车即可以得到KEY,并收到邮件提醒。 用文本编辑器打开/c/Users/admin/.ssh/id_rsa.pub这个文件将里面的所有文本文字 复制到repo-Settings-Deploy keys-Add deploy key中,Title可以随便填写 回到Git Bash ...

四月 11, 2018 · admin

Linux下scp使用RSA秘钥传输数据Scp命令免密码远程下载上传

生成密钥对 ssh-keygen id_rsa为私钥文件(保存在client) id_rsa.pub为公钥(用于追加到server的用户目录/.ssh/authorized_keys文件中) 下载数据 scp -i ~/.ssh/id_rsa -r root@server_ip:/var/www/ /var/www/ 上传数据 scp -i ~/.ssh/id_rsa -r /var/www/ root@server_ip:/var/www/ ssh登录 ssh user@host 其它 ssh使用RSA密钥对登录也是同理,service名称为sshd,配置文件为/etc/ssh/sshd_config chmod -R 700 ~/.ssh/ chmod 600 ~/.ssh/authorized_keys 指定端口 -P: 大写的P, 指定端口号 scp -P 788 -i ~/.ssh/id_rsa -r /var/www/ root@server_ip:/var/www/

四月 11, 2018 · admin

Ubuntu18.04关闭iptables防火墙开放所有端口

sudo iptables -P INPUT ACCEPT sudo iptables -P FORWARD ACCEPT sudo iptables -P OUTPUT ACCEPT sudo iptables -F iptables-save > /etc/iptables/rules.v4

四月 11, 2018 · admin

hexo同步布署在github-coding并实现国内外自动分流

建议单独托管在github上,因为国内大环境背景下,你懂的啦! 域名解析 登陆DNSPOD控制台 在域名添加2条记录值 记录类型 线路类型 记录值 CNAME 国外 username.github.io CNAME 国内 username.coding.me ...

三月 29, 2018 · admin

Debian/Ubuntu系统手动更新内核并启用TCP BBR拥塞控制算法

查看内核版本 uname -r BBR要求内核为kernel4.9以上版本。 如果大于或等于4.9的可以直接开启BBR,开启步骤如下 配置文件 echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf 加载配置到内核参数中 sysctl -p sysctl net.ipv4.tcp_available_congestion_control 顺利的话下面的命令就能看到bbr模块了 lsmod | grep bbr sysctl net.ipv4.tcp_available_congestion_control 返回值一般为: net.ipv4.tcp_available_congestion_control = bbr cubic reno sysctl net.ipv4.tcp_congestion_control 返回值一般为: net.ipv4.tcp_congestion_control = bbr sysctl net.core.default_qdisc 返回值一般为: net.core.default_qdisc = fq 如果内核版本低于4.9的需要手动升级到4.9或以上才能开启 去这里下载最新版的内核 deb 安装包 如果系统是 64 位,则下载 amd64 的 linux-image 中含有 generic 这个 deb 包; 如果系统是 32 位,则下载 i386 的 linux-image 中含有 generic 这个 deb 包; 安装的命令如下(以最新版的 64 位 4.12.4 举例而已,请替换为下载好的 deb 包): ...

十二月 21, 2017 · admin

IPv6的VPS连接IPv4和IPv4的VPS免费获取IPv6

只有IPv6的VPS连通IPV4 无ipv4纯ipv6先编辑/etc/resolv.conf改成DNS64地址 nameserver 2001:67c:2b0::4 nameserver 2001:67c:27e4::64 然后执行 chattr +i /etc/resolv.conf service systemd-resolved restart IPV4免费获得IPV6 只有IPV4的VPS通过Hurricane Electric Internet Services免费获得IPV6。 Hurricane Electric Free IPv6 Tunnel Broker 注册 登陆 按提示输入公网IPV4,选择地区区域,获得IPV6。 选择自己VPS的系统对应版本按提示附加上去 enjoy Cloudflare WARP 一键安装脚本 转载自项目地址、Cloudflare WARP 一键安装脚本 使用教程 无论 VPS 是 IPv4 还是 IPv6 又或都有,添加 WARP Wire­Guard 双栈全局网络,直接使用以下 WARP 脚本命令一把梭: # 自动配置 WARP WireGuard 双栈全局网络 bash <(curl -fsSL git.io/warp.sh) d 添加或更改 IPv4/​IPv6 网络中的一个出口走 WARP Wire­Guard 网络,使用以下 WARP 脚本命令一把梭: # 自动配置 WARP WireGuard IPv4 网络 bash <(curl -fsSL git.io/warp.sh) 4 # 自动配置 WARP WireGuard IPv6 网络 bash <(curl -fsSL git.io/warp.sh) 6 其它相关命令: # 查看 WARP 脚本子命令列表 bash <(curl -fsSL git.io/warp.sh) help # 重启 WARP WireGuard 网络接口 systemctl restart wg-quick@wgcf # 禁用 WARP WireGuard 网络接口 systemctl disable wg-quick@wgcf --now

十一月 9, 2017 · admin