{"id":3234,"date":"2025-05-24T16:53:06","date_gmt":"2025-05-24T08:53:06","guid":{"rendered":"http:\/\/www.51cos.com\/?p=3234"},"modified":"2025-05-25T14:56:20","modified_gmt":"2025-05-25T06:56:20","slug":"%e5%9c%a8vps%e4%b8%8b%e8%bd%bdhugo%e6%ba%90%e7%a0%81%e5%b9%b6%e8%bf%9b%e8%a1%8c%e5%ae%89%e8%a3%85%ef%bc%8c%e7%94%9f%e6%88%90%e4%b8%aa%e4%ba%ba%e7%bd%91%e7%ab%99%e7%9a%84%e5%ae%8c%e6%95%b4%e6%ad%a5","status":"publish","type":"post","link":"http:\/\/www.51cos.com\/?p=3234","title":{"rendered":"\u5728VPS\u4e0b\u8f7dhugo\u6e90\u7801\u5e76\u8fdb\u884c\u5b89\u88c5\uff0c\u751f\u6210\u4e2a\u4eba\u7f51\u7ad9\u7684\u5b8c\u6574\u6b65\u9aa4"},"content":{"rendered":"<pre><code class=\"language-bash line-numbers\">1.\u5b89\u88c5git\n\n2.\u5b89\u88c5go\n\n\u4e0b\u8f7d\nwget https:\/\/go.dev\/dl\/go1.24.3.linux-amd64.tar.gz\n\nrm -rf \/usr\/local\/go &amp;&amp; tar -C \/usr\/local -xzf go1.24.3.linux-amd64.tar.gz\n\n#Add \/usr\/local\/go\/bin to the PATH environment variable\nexport PATH=<span class=\"katex math inline\">PATH:\/usr\/local\/go\/bin\nsource ~\/.bashrc\n\n#\u786e\u8ba4go\u5b89\u88c5\u6210\u529f\uff1a\ngo version\n\n3.\u4e0b\u8f7d\u7f16\u8bd1\u5b89\u88c5hugo\uff1a\n\n#Hugo Extended \u652f\u6301\uff1a\n#SCSS \/ SASS \u89e3\u6790\u548c\u7f16\u8bd1\n#PostCSS \u96c6\u6210\n#\u4e00\u4e9b\u9ad8\u7ea7\u4e3b\u9898\uff08\u5982 lotusdocs\uff09\u5fc5\u987b\u4f9d\u8d56\u5b83\n#\u666e\u901a\u7248 Hugo \u65e0\u6cd5\u7f16\u8bd1 SCSS\uff0c\u5bfc\u81f4\u6a21\u5757\u52a0\u8f7d\u5931\u8d25\u3002\n\nCGO_ENABLED=1 go install -tags extended github.com\/gohugoio\/hugo@latest\n\n#\u5982\u679c\u4e0a\u9762\u6307\u4ee4\u5361\u4f4f\uff0c\u53ef\u4ee5\u5206\u5e03\u8fdb\u884c\uff1a\ngit clone https:\/\/github.com\/gohugoio\/hugo.git\ncd hugo\n#\u5207\u6362\u5230\u6700\u65b0\u7248\u672c\uff1a\ngit checkout v0.147.5\n#\u8fd9\u6761\u547d\u4ee4\u4f1a\u57fa\u4e8e\u5f53\u524d\u76ee\u5f55\u7684 go.mod\uff0c\u6784\u5efa\u51fa Hugo Extended \u53ef\u6267\u884c\u6587\u4ef6\uff0c\u5e76\u5b89\u88c5\u5230<\/span>HOME\/go\/bin\u3002\nCGO_ENABLED=1 go install -tags extended\n\n\n#\u786e\u8ba4hugo\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a\n#\u6267\u884c\uff1a\nls <span class=\"katex math inline\">HOME\/go\/bin\/hugo\n\/root\/go\/bin\/hugo\n\n#\u5c06<\/span>HOME\/go\/bin \u6dfb\u52a0\u5230\u4f60\u7684 PATH\uff1a\necho 'export PATH=<span class=\"katex math inline\">PATH:<\/span>HOME\/go\/bin' &gt;&gt; ~\/.bashrc\nsource ~\/.bashrc\n\n\u6267\u884c\uff1ahugo version\n<\/code><\/pre>\n<h2>Run these commands to create a Hugo site with the Ananke theme.<\/h2>\n<pre><code class=\"language-bash line-numbers\">hugo new site quickstart\ncd quickstart\n<\/code><\/pre>\n<h2>Edit the hugo.toml configuration file<\/h2>\n<p>\u53c2\u8003\uff1ahttps:\/\/github.com\/colinwilson\/lotusdocs<br \/>\n\u4f7f\u7528Hugo Module \u6a21\u5f0f\uff0c\u914d\u7f6e hugo.toml\uff0c\u4e0b\u8f7d\u4e3b\u9898\u3002<\/p>\n<pre data-language=HTML><code class=\"language-markup line-numbers\">baseURL = 'http:\/\/www.wangshumian.com\/'\nlanguageCode = 'en-us'\ntitle = 'My New Hugo Site'\nenableEmoji = true\n\n[module]\n    [[module.imports]]\n        path = \"github.com\/colinwilson\/lotusdocs\"\n\n[markup]\n  [markup.goldmark.renderer]\n    unsafe = true\n  [markup.tableOfContents]\n    startLevel = 1\n    endLevel = 3\n  [markup.goldmark.parser.attribute]\n    block = true\n<\/code><\/pre>\n<p>\u7ee7\u7eed<\/p>\n<pre><code class=\"language-bash line-numbers\">rm -rf themes\nhugo mod init github.com\/yourusername\/wsmlite\ncat go.mod\n#module github.com\/yourusername\/wsmlite\n#go 1.24.3\nhugo mod tidy\n\n<\/code><\/pre>\n<p>\u6267\u884c\uff1a<br \/>\n<code>go list -m all<\/code><br \/>\n\u786e\u8ba4\u4e3b\u9898lotusdocs \u88ab\u6b63\u786e\u62c9\u53d6\u3002<\/p>\n<h2>\u751f\u6210\u793a\u4f8b\u5185\u5bb9<\/h2>\n<pre><code class=\"language-bash line-numbers\">#\u521b\u5efa\u9875\u9762\u76ee\u5f55\u7ed3\u6784\uff08\u63a8\u8350\u4f7f\u7528 docs\/\uff09\nhugo new docs\/getting-started\/index.md\nhugo new docs\/installation\/index.md\nhugo new docs\/configuration\/index.md\nhugo new docs\/faq\/index.md\n#\u7f16\u8f91getting-started index.md \u6587\u4ef6\u5185\u5bb9\n---\ntitle: \"Getting Started\"\ndescription: \"\u672c\u9875\u9762\u4ecb\u7ecd\u5982\u4f55\u5feb\u901f\u4e0a\u624b Hugo + lotusdocs \u4e3b\u9898\u5efa\u7ad9\u3002\"\nlead: \"\u5feb\u901f\u6784\u5efa\u4f60\u7684\u7b2c\u4e00\u4e2a Hugo \u7f51\u7ad9\"\ndate: 2025-05-24\nlastmod: 2025-05-24\ndraft: false\nmenu:\n  docs:\n    parent: \"\"\n    weight: 10\n---\n\n##  \u5feb\u901f\u5f00\u59cb\n\n\u6b22\u8fce\u4f7f\u7528 Hugo + lotusdocs \u4e3b\u9898\uff01\u672c\u6559\u7a0b\u5c06\u5e2e\u52a9\u4f60\u5feb\u901f\u751f\u6210\u4e00\u4e2a\u73b0\u4ee3\u5316\u7684\u9759\u6001\u7f51\u7ad9\u3002\n\n### \u73af\u5883\u51c6\u5907\n\n- \u5df2\u5b89\u88c5 Hugo Extended \u7248\u672c\n- \u5df2\u521d\u59cb\u5316 Hugo Module\n- \u5df2\u914d\u7f6e lotusdocs \u4e3b\u9898\n\n### \u9879\u76ee\u7ed3\u6784\n\n```bash\n.\n\u251c\u2500\u2500 content\/\n\u2502   \u2514\u2500\u2500 docs\/\n\u2502       \u2514\u2500\u2500 getting-started\/\n\u2502           \u2514\u2500\u2500 index.md  \u2190 \u672c\u9875\u9762\n\u251c\u2500\u2500 hugo.toml\n\u251c\u2500\u2500 go.mod\n&lt;\/code&gt;&lt;\/pre&gt;\n\n#\u5176\u4ed6\u6bcf\u4e2a index.md \u4e2d\u8f93\u5165\nmenu:\n  docs:\n    parent: &quot;Getting Started&quot;  # \u6216\u5176\u4ed6\u7ae0\u8282\u6807\u9898\n    weight: 20\n#lotusdocs \u4f1a\u6839\u636e menu.docs \u81ea\u52a8\u751f\u6210\u4fa7\u8fb9\u680f\u5bfc\u822a\u3002\n\n#\u542f\u52a8\u672c\u5730\u670d\u52a1\u5668\u9884\u89c8\nhugo server --buildDrafts\n#\u6b63\u5f0f\u53d1\u5e03\nhugo\n\n&lt;pre&gt;&lt;code class=&quot;line-numbers&quot;&gt;```html\n\n\u4e3b\u8981\u4f9d\u9760chatgpt\u89e3\u51b3\u95ee\u9898\uff0c\u6709\u53c2\u8003\uff1ahttps:\/\/gohugo.io\/getting-started\/quick-start\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1.\u5b89\u88c5git 2.\u5b89\u88c5go \u4e0b\u8f7d wget https:\/\/go.dev\/dl\/go1.24.3.linux [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-3234","post","type-post","status-publish","format-standard","hentry","category-bbs"],"_links":{"self":[{"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/posts\/3234","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.51cos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3234"}],"version-history":[{"count":9,"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/posts\/3234\/revisions"}],"predecessor-version":[{"id":3243,"href":"http:\/\/www.51cos.com\/index.php?rest_route=\/wp\/v2\/posts\/3234\/revisions\/3243"}],"wp:attachment":[{"href":"http:\/\/www.51cos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.51cos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3234"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.51cos.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}