使用hugo建立静态个人网站

安装Hugo Hugo程序可以从这里下载 Windows建议下载hugo_extended_0.81.0_Windows-64bit.zip,其他系统可下载对应版本。 另,CentOS安装hugo可参考此文 使用hugo 首先使用hugo new test来建立新的站点。 $ hugo new site test Congratulations! Your new Hugo site is created in D:\test. Just a few more steps and you're ready to go: 1. Download a theme into the same-named folder. Choose a theme from https://themes.gohugo.io/ or create your own with the "hugo new theme <THEMENAME>" command. 2. Perhaps you want to add some content. You can add single files with "hugo new <SECTIONNAME>\<FILENAME>.<FORMAT>". 3. Start the built-in live server via "hugo server". Visit https://gohugo.io/ for quickstart guide and full documentation. 新建的站点没有任何内容,也没有主题,下来需要添加主题。 ...

三月 13, 2021 · JQX

Github Actions自动生成Hugo站点并部署到Github Pages

使用hugo建立建立个人网站可以参考使用hugo建立静态个人网站 使用github pages来部署个人网站可以参考GithubPages部署免费网站 下面将会介绍如何通过Github Actions来将以上两个操作关联在一起并自动化完成! github建立Repositories 建立一个unixetc/ghsource.git属性为私有(private)的用来放置Hugo源码,然后再建一个unixetc/unixetc.github.io.git属性为公有(public)并设置Github Pages服务。 github设置Deploy keys与Secrets 使用ssh-keygen命令来生成私钥与公钥。 $ ssh-keygen.exe -t rsa -b 4096 -C "[email protected]" #邮箱自定义 Generating public/private rsa key pair. Enter file in which to save the key (/c/Users/alair/.ssh/id_rsa): #存放目录,可自定义 Created directory '/c/Users/alair/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /c/Users/alair/.ssh/id_rsa #私钥 Your public key has been saved in /c/Users/alair/.ssh/id_rsa.pub #公钥 The key fingerprint is: SHA256:ZiNPDGtAKC6MA [email protected] The key's randomart image is: +---[RSA 4096]----+ | .. +o. | | . . o.. | | . + .... . | |o+ o o = .o . | |+EO o = S . . | |o B . % + . | | .o .oB * | | ...++ B | | ... .. o | +----[SHA256]-----+ 在unixetc/unixetc.gihub.io.git的设置中将公钥内容添加至Deploy keys,名称自定义,并勾选allow write access。 ...

十月 25, 2020 · JQX

CentOS安装Hugo

Hugo是由Go语言实现的静态网站生成器。简单、易用、高效、易扩展、快速部署。 新建hugo.repo文件,sudo vi /etc/yum.repos.d/hugo.repo,填入以下内容。 [daftaupe-hugo] name=Copr repo for hugo owned by daftaupe baseurl=https://copr-be.cloud.fedoraproject.org/results/daftaupe/hugo/epel-7-$basearch/ type=rpm-md skip_if_unavailable=True gpgcheck=1 gpgkey=https://copr-be.cloud.fedoraproject.org/results/daftaupe/hugo/pubkey.gpg repo_gpgcheck=0 enabled=1 保存后更新安装Hugo sudo yum update sudo yum install hugo -y

二月 4, 2020 · JQX