| 警告: An existing Chocolatey installation was detected. Installation will not continue. |
| For security reasons, this script will not overwrite existing installations. |
| |
| Please use choco upgrade chocolatey to handle upgrades of Chocolatey itself. |
| |
| |
| Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) |
- windows安装chocolatey报错:
set-ExecutionPolicy不是内部或外部命令
| |
| SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin |
| |
| |
| choco install hugo -confirm |
| |
| |
| hugo version |
| |
| |
| hugo new site hugo |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| theme = "hugo-theme-pixyll" |
| |
| themesDir = "../.." |
| |
| |
| hugo server |
| languageCode = "en-us" |
| contentdir = "content" |
| publishdir = "public" |
| builddrafts = false |
| baseUrl = "https://chniny.github.io" |
| canonifyurls = true |
| title = "当时故里" |
| author = "chniny" |
| theme = "hugo-theme-pixyll" |
| disqusShortname = "sitename" |
| |
| [indexes] |
| category = "categories" |
| tag = "tags" |
| hugo new post/文章名称.md |
| |
| # 本地博客\content\post目录下会生成一篇文章 |
| |
| # 新生成的文章中开头有一个属性,需改为false,否则本地启动服务后不会显示 |
| draft: true # 表示文章是否草稿,草稿内容不会被发布 |
| |
| # 打开md文件编辑后 |
| |
| # 启动 |
| hugo server -D |
| |
| |
|  |
| |
| |

| |
| git clone https://github.com/EmielH/tale-hugo.git |
| |
| |
| https://themes.gohugo.io/themes/tale-hugo/ |
| baseURL = 'https://chniny.github.io' |
| languageCode = 'en-us' |
| title = '当时故里' |
| theme = "tale-hugo" |
| # 进入本地博客根路径\themes\tale-hugo\layouts\_default |
| # 编辑single.html,添加如下 |
| |
| <div class="post-password"> |
| {{ if ( .Params.password | default "" ) }} |
| <script> |
| (function(){ |
| if (prompt('请输入文章密码') != {{ .Params.password }}){ |
| alert('密码错误!'); |
| if (history.length === 1) { |
| window.opener = null; |
| window.open('', '_self'); |
| window.close(); |
| } else { |
| history.back(); |
| } |
| } |
| })(); |
| </script> |
| {{ end }} |
| </div> |
| |
| # 文章头配置如下 |
| password: 123456 |
- 使用命令 hugo server 并没有在public文件夹生成静态文件
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
· 提示词工程——AI应用必不可少的技术