Error: Error building site: POSTCSS: failed to transform "scss/main.css" (text/css): Unexpected identifier
#OR
/home/user/repos/my-new-site/themes/docsy/node_modules/hugo-extended/postinstall.js:1
import install from "./lib/install.js";
^^^^^^^
SyntaxError: Unexpected identifier
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
创建 Docsy 站点的最简单方法是复制我们的示例站点。但是,如果您是经验丰富的 Hugo 用户或者我们示例站点的站点结构不符合您的需求,您可能更喜欢从头开始创建新的站点。使用此选项,您将获得 Docsy 的外观和感觉、导航和其他功能,但您需要指定自己的站点结构。
这些说明仅为您的站点项目提供最小的文件结构,以便您可以逐步构建和扩展您的实际站点。第一步是将 Docsy 主题作为 Hugo 模块添加到您的站点中。如果需要,您可以轻松地从 Docsy GitHub 存储库更新模块到最新版本。
快速设置
在您的命令提示符下运行以下命令:
hugo new site my-new-site
cd my-new-site
hugo mod init github.com/me/my-new-site
hugo mod get github.com/google/docsy@vmain
cat >> hugo.toml <<EOL
[module]
proxy = "direct"
[[module.imports]]
path = "github.com/google/docsy"
EOLhugo server
hugo new site my-new-site
cd my-new-site
hugo mod init github.com/me/my-new-site
hugo mod get github.com/google/docsy@vmain
(echo [module]^
proxy = "direct"^
[[module.imports]]^
path = "github.com/google/docsy")>> hugo.toml
hugo server
[module]proxy="direct"# uncomment line below for temporary local development of module# replacements = "github.com/google/docsy -> ../../docsy"[module.hugoVersion]extended=truemin="0.73.0"[[module.imports]]path="github.com/google/docsy"disable=false
[languages.no]languageName="Norsk"contentDir="content/no"[languages.no.params]title="Goldydocs"description="Docsy er operativsystem for skyen"time_format_default="02.01.2006"time_format_blog="02.01.2006"[languages.fa]languageName="فارسی"contentDir="content/fa"[languages.fa.params]title="اسناد گلدی"description="یک نمونه برای پوسته داکسی"time_format_default="2006.01.02"time_format_blog="2006.01.02"
Hugo 使用你提供的内容文件和站点主题提供的任何模板来构建你的站点页面。这些模板(在 Hugo 术语中称为"layouts(布局)")包括你的页面的页眉、页脚、导航和样式表链接:基本上除了页面的具体内容以外的一切。这些模板又可以由局部组成:用于页面元素(如页眉、搜索框等)的小型可重用 HTML 片段。
To add author and date information to blog posts, add them to the page frontmatter:
+++date=2018-10-06T00:00:00.000Ztitle="Easy documentation with Docsy"linkTitle="Announcing Docsy"description="The Docsy Hugo theme lets project maintainers and contributors focus on content, not on reinventing a website infrastructure from scratch"author="Riona MacNamara"[[resources]]src="**.{png,jpg}"title="Image #:counter"[resources.params]byline="Photo: Riona MacNamara / CC-BY-CA"+++
---date:2018-10-06title:"Easy documentation with Docsy"linkTitle:"Announcing Docsy"description:"The Docsy Hugo theme lets project maintainers and contributors focus on content, not on reinventing a website infrastructure from scratch"author:Riona MacNamararesources:- src:"**.{png,jpg}"title:"Image #:counter"params:byline:"Photo: Riona MacNamara / CC-BY-CA"---
{"date":"2018-10-06T00:00:00.000Z","title":"Easy documentation with Docsy","linkTitle":"Announcing Docsy","description":"The Docsy Hugo theme lets project maintainers and contributors focus on content, not on reinventing a website infrastructure from scratch","author":"Riona MacNamara","resources":[{"src":"**.{png,jpg}","title":"Image #:counter","params":{"byline":"Photo: Riona MacNamara / CC-BY-CA"}}]}
[params.links]# End user relevant links. These will show up on left side of footer and in the community page if you have one[[params.links.user]]name="User mailing list"url="<https://example.org/mail>"icon="fa fa-envelope"desc="Discussion and help from your fellow users"[[params.links.user]]name="Twitter"url="<https://example.org/twitter>"icon="fab fa-x-twitter"desc="Follow us on Twitter to get the latest news!"[[params.links.user]]name="Stack Overflow"url="<https://example.org/stack>"icon="fab fa-stack-overflow"desc="Practical questions and curated answers"# Developer relevant links. These will show up on right side of footer and in the community page if you have one[[params.links.developer]]name="GitHub"url="<https://github.com/google/docsy>"icon="fab fa-github"desc="Development takes place here!"[[params.links.developer]]name="Slack"url="<https://example.org/slack>"icon="fab fa-slack"desc="Chat with other project developers"[[params.links.developer]]name="Developer mailing list"url="<https://example.org/mail>"icon="fa fa-envelope"desc="Discuss development issues around the project"
params:links:user:- name:User mailing listurl:'<https://example.org/mail>'icon:fa fa-envelopedesc:Discussion and help from your fellow users- name:Twitterurl:'<https://example.org/twitter>'icon:fab fa-x-twitterdesc:Follow us on Twitter to get the latest news!- name:Stack Overflowurl:'<https://example.org/stack>'icon:fab fa-stack-overflowdesc:Practical questions and curated answersdeveloper:- name:GitHuburl:'<https://github.com/google/docsy>'icon:fab fa-githubdesc:Development takes place here!- name:Slackurl:'<https://example.org/slack>'icon:fab fa-slackdesc:Chat with other project developers- name:Developer mailing listurl:'<https://example.org/mail>'icon:fa fa-envelopedesc:Discuss development issues around the project
{"params":{"links":{"user":[{"name":"User mailing list","url":"https://example.org/mail","icon":"fa fa-envelope","desc":"Discussion and help from your fellow users"},{"name":"Twitter","url":"https://example.org/twitter","icon":"fa-brands fa-x-twitter","desc":"Follow us on Twitter to get the latest news!"},{"name":"Stack Overflow","url":"https://example.org/stack","icon":"fa-brands fa-stack-overflow","desc":"Practical questions and curated answers"}],"developer":[{"name":"GitHub","url":"https://github.com/google/docsy","icon":"fa-brands fa-github","desc":"Development takes place here!"},{"name":"Slack","url":"https://example.org/slack","icon":"fa-brands fa-slack","desc":"Chat with other project developers"},{"name":"Developer mailing list","url":"https://example.org/mail","icon":"fa fa-envelope","desc":"Discuss development issues around the project"}]}}}
To override any of these values for a given page, specify it in page frontmatter:
+++title="Adding Content"linkTitle="Adding Content"weight=1description='''
Add different types of content to your Docsy site.
'''[sitemap]priority=1+++
---title:"Adding Content"linkTitle:"Adding Content"weight:1description:> Add different types of content to your Docsy site.sitemap:priority:1.0---
{"title":"Adding Content","linkTitle":"Adding Content","weight":1,"description":"Add different types of content to your Docsy site.\n","sitemap":{"priority":1}}
Our table styling goes against the Bootstrap recommendation to wrap
tables with .table-responsive — however, we think letting
users create responsive tables with just Markdown table syntax is more
convenient.
+++title="Navigation and Search"linkTitle="Navigation and Search"date=2017-01-05T00:00:00.000Zweight=3description='''
Customize site navigation and search for your Docsy site.
'''+++
---title:"Navigation and Search"linkTitle:"Navigation and Search"date:2017-01-05weight:3description:> Customize site navigation and search for your Docsy site.---
{"title":"Navigation and Search","linkTitle":"Navigation and Search","date":"2017-01-05T00:00:00.000Z","weight":3,"description":"Customize site navigation and search for your Docsy site.\n"}
+++title="My Hidden Page"weight=99toc_hide=truehide_summary=truedescription='''
Page hidden from both the TOC menu and the section summary list.
'''+++
---title:"My Hidden Page"weight:99toc_hide:truehide_summary:truedescription:> Page hidden from both the TOC menu and the section summary list.---
{"title":"My Hidden Page","weight":99,"toc_hide":true,"hide_summary":true,"description":"Page hidden from both the TOC menu and the section summary list.\n"}
要创建占位符页面,请按通常方式在要在该菜单中显示链接的目录中创建一个页面文件,并将manualLink参数添加到其元数据中。如果一个页面在其元数据中具有manualLink,则Docsy会为此页面在章节菜单和章节索引中(章节在着陆页面上的子页面列表中 —— 请参见description in the Docsy docs)生成链接,但该链接目标会被替换为manualLink的值。该链接文本是您的占位符页面的title(如果设置了linkTitle,则是linkTitle)。您还可以使用manualLinkTitle参数设置链接的title属性以及使用manualLinkTarget设置链接目标 —— 例如,如果您希望一个外部链接在新选项卡中打开,则可以将其链接目标设置为_blank。Docsy会自动将rel=noopener添加到打开新标签页的链接中,作为安全最佳实践。
尽管基于您的占位符文件生成的所有菜单和着陆页链接都根据参数 manualLink 或 manualLinkRelref 设置,但 Hugo 仍会为该文件生成一个常规的 HTML 站点页面,尽管没有生成的链接指向该页面。为避免用户意外着陆到生成的占位符页面时产生混淆,我们建议在该页面的正常内容和/或页面描述中指定外部链接的 URL。
如果你使用 Hugo 的本地服务器功能 [在本地测试](/docs/deployment/#serving-your-site-locally),你需要先通过运行 ‘hugo’ 来构建你的 ‘offline-search-index.xxx.json’ 文件。如果在构建“offline-search-index.xxx.json”时运行了 Hugo 服务器,则可能需要停止服务器并重新启动它才能查看搜索结果。
Hugo 允许你定义并使用 shortcodes,而不是从头编写所有站点页面。这些可重复使用的内容片段可以包含在你的页面中,通常使用 HTML 创建难以或不可能在简单的 Markdown 中实现的效果。简码还可以具有参数,例如,让你向花哨的简码文本框中添加自己的文本。除了 Hugo 的内置简码外,Docsy 还提供了一些自己的 简码,以帮助你构建页面。
\{\{\<blocks/sectioncolor="dark"type="row"\>\}\}
\{\{\% blocks/feature icon="fa-lightbulb" title="Fastest OS **on the planet**!" \%\}\}
The new **TechOS** operating system is an open source project. It is a new project, but with grand ambitions.
Please follow this space for updates!
\{\{\% /blocks/feature \%\}\}
\{\{\% blocks/feature icon="fa-brands fa-github" title="Contributions welcome!" url="https://github.com/gohugoio/hugo" \%\}\}
We do a [Pull Request](https://github.com/gohugoio/hugo/pulls) contributions workflow on **GitHub**. New users are always welcome!
\{\{\% /blocks/feature \%\}\}
\{\{\% blocks/feature icon="fa-brands fa-twitter" title="Follow us on Twitter!" url="https://twitter.com/GoHugoIO" \%\}\}
For announcement of latest features etc.
\{\{\% /blocks/feature \%\}\}
\{\{\< /blocks/section \>\}\}
Parameter
Default
Description
height
See above.
color
See above.
type
Specify “container” (the default) if you want a general container, or “row” if the section will contain columns – which must be immediate children.
blocks/feature
\{\{\% blocks/feature icon="fa-brands fa-github" title="Contributions welcome!" url="https://github.com/gohugoio/hugo" \%\}\}
We do a [Pull Request](https://github.com/gohugoio/hugo/pulls) contributions workflow on **GitHub**. New users are always welcome!
\{\{\% /blocks/feature \%\}\}
Use the syntax above if the inner content and/or the byline parameter of your shortcode is authored in markdown. In case of HTML content, use <> as innermost delimiters: {{< imgproc >}}<b>HTML</b> content{{< /imgproc >}}.
---title:"Pet Store API"type:docsweight:1description:Reference for the Pet Store API---\{\{\< redoc "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v2.0/yaml/petstore.yaml" \>\}\}
有几种工具可用于检查站点是否可以通过iframe嵌入,例如:https://gf.dev/x-frame-options-test。请注意,当此测试显示"Couldn’t find the X-Frame-Options header in the response headers.“时,您可以嵌入它,但是当测试显示"Great! X-Frame-Options header was found in the HTTP response headers as highlighted below.“时,除非已明确启用了您的站点,否则您不可以嵌入它。
\{\{\<cardheader="**Imagine**"title="Artist and songwriter: John Lennon"subtitle="Co-writer: Yoko Ono"footer="![SignatureJohnLennon](https://server.tld/…/signature.png 'Signature John Lennon')"\>\}\}
Imagine there's no heaven, It's easy if you try<br/>No hell below us, above us only sky<br/>Imagine all the people living for today…
…
\{\{\< /card \>\}\}
此代码转换为下面的左侧的卡片,显示 John Lennon 著名歌曲 Imagine 的歌词。右侧的第二个说明性card 元素指示并解释了card 的各个组成部分:
…
{{}}
This code translates to the left card shown below, showing the lyrics of John Lennon's famous song `Imagine`. A second explanatory card element to the right indicates and explains the individual components of a card:
<div class="td-card-group card-group p-0 mb-4">
<div class="td-card card border me-4">
<div class="card-header">
<strong>Imagine</strong>
</div>
<div class="card-body">
<h5 class="card-title">
Artist and songwriter: John Lennon</h5>
<h6 class="card-title ms-2 text-body-secondary">
Co-writer: Yoko Ono</h6>
<p class="card-text">
Imagine there's no heaven, It's easy if you try<br/>
No hell below us, above us only sky<br/>
Imagine all the people living for today…
Imagine there's no countries, it isn't hard to do<br/>
Nothing to kill or die for, and no religion too<br/>
Imagine all the people living life in peace…
Imagine no possessions, I wonder if you can<br/>
No need for greed or hunger - a brotherhood of man<br/>
Imagine all the people sharing all the world…
You may say I'm a dreamer, but I'm not the only one<br/>
I hope someday you'll join us and the world will live as one
</p>
</div>
<div class="card-footer">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Firma_de_John_Lennon.svg/320px-Firma_de_John_Lennon.svg.png" alt="SignatureJohnLennon" title="Signature John Lennon"></div>
</div>
<div class="td-card card border me-4">
<div class="card-header">
<strong>Header</strong>: specified via named parameter <code>Header</code>
</div>
<div class="card-body">
<h5 class="card-title">
<strong>Card title</strong>: specified via named parameter <code>title</code></h5>
<h6 class="card-title ms-2 text-body-secondary">
<strong>Card subtitle</strong>: specified via named parameter <code>subtitle</code></h6>
<p class="card-text">
<p><strong>Content</strong>: inner content of the shortcode, this may be plain text or formatted text, images, videos, … . If your content is markdown, use the percent sign <code>%</code> as outermost delimiter of your <code>card</code> shortcode, your markup should look like <code>{{% card %}}Your **markdown** content{{% /card %}}</code>. In case of HTML content, use square brackets <code><></code> as outermost delimiters: <code>{{< card >}}Your <b>HTML</b> content{{< /card >}}</code></p>
</p>
</div>
<div class="card-footer">
<strong>Footer</strong>: specified via named parameter <code>footer</code></div>
</div>
</div>
虽然卡片的主要内容取自 `card` 简码的内部标记,但可选元素 `footer`、`header`、`title` 和 `subtitle` 都作为简码的命名参数指定。
### 简码`card-code`(用于编程代码)
如果您想在卡片上显示编程代码,可以使用专门的`card-code` 简码。下面的示例演示了如何用C编写著名的`Hello world!`应用程序的卡片元素:
```go-html-template
\{\{\< card-code header="**C**" lang="C" \>\}\}
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
puts("Hello World!");
return EXIT_SUCCESS;
}
\{\{\< /card-code \>\}\}
这段代码将转换为下面的卡片:
C
# include <stdio.h>
# include <stdlib.h>
intmain(void){puts("Hello World!");returnEXIT_SUCCESS;}
## Installation
\{\{\% alert title="Note" color="primary" \%\}\}
Check system compatibility before proceeding.
\{\{\% /alert \%\}\}
1. Download the installation files.
1. Run the installation script
`sudo sh install.sh`
1. Test that your installation was successfully completed.
您可以将此部分导入到另一个文档中:
The following section explains how to install the database:
\{\{\% readfile "installation.md" \%\}\}
这将渲染出好像指令在父文档中一样。导入文件包含简码时需要 Hugo v0.101.0+ 才能正确被渲染。
The following section explains how to install the database:
Installation
Note
Check system compatibility before proceeding.
Download the installation files.
Run the installation script
sudo sh install.sh
Test that your installation was successfully completed.
To create a new pipeline, follow the next steps:
1. Create a configuration file `config.yaml`:
\{\{\<readfilefile="includes/config.yaml"code="true"lang="yaml"\>\}\}
2. Apply the file to your cluster `kubectl apply config.yaml`
\{\{\% conditional-text include-if="foo" \%\}\}
This text appears in the output only if `buildCondition = "foo" is set in your config file`.
\{\{\% /conditional-text \%\}\}
\{\{\% conditional-text exclude-if="bar" \%\}\}
This text does not appear in the output if `buildCondition = "bar" is set in your config file`.
\{\{\% /conditional-text \%\}\}
Analytics are enabled only for production builds (called “environments”
in Hugo terminology). For information about Hugo environments and how to set
them, see the following discussion.
用户反馈
默认情况下,Docsy 在每个文档页面底部放置一个"was this page helpful?“的反馈小部件,如图1所示。
点击"Yes"后,用户应该会看到类似图2的响应。您可以在项目的 [配置文件]
Figure 2. An example Yes response
图2. 一个"Yes"响应的示例。
这些数据有什么用处?
当您有大量文档,且没有足够的时间更新所有文档时,您可以使用"was this page helpful?” 的反馈数据来帮助您决定哪些页面需要优先考虑。通常,从访问量高且评级低的页面开始。在此上下文中,“Low ratings"意味着用户更经常地点击No——页面不够有用——而不是Yes——页面有用。您还可以研究您评级高的页面,以制定关于为什么您的用户认为它们有用的假设。
As of Docsy version 0.8.0, feedback will be enabled whether
site.Config.Services.GoogleAnalytics.ID is set or not. This supports the use
case where analytics is configured outside of Docsy.
Open your project’s Hugo configuration file.
Set the response text that users see after clicking Yes or No.
[params.ui.feedback]enable=trueyes='Glad to hear it! Please <a href="https://github.com/USERNAME/REPOSITORY/issues/new">tell us how we can improve</a>.'no='Sorry to hear that. Please <a href="https://github.com/USERNAME/REPOSITORY/issues/new">tell us how we can improve</a>.'
params:ui:feedback:enable:true'yes':>- Glad to hear it! Please <a href="https://github.com/USERNAME/REPOSITORY/issues/new">
tell us how we can improve</a>.'no':>- Sorry to hear that. Please <a href="https://github.com/USERNAME/REPOSITORY/issues/new">
tell us how we can improve</a>.
{"params":{"ui":{"feedback":{"enable":true,"yes":"Glad to hear it! Please <a href=\"<https://github.com/USERNAME/REPOSITORY/issues/new\">> tell us how we can improve</a>.","no":"Sorry to hear that. Please <a href=\"<https://github.com/USERNAME/REPOSITORY/issues/new\">> tell us how we can improve</a>."}}}}
Save the edits to your configuration file.
By default, Docsy emits an event value of 100 when a user clicks “yes”. You can
change this value by setting params.ui.feedback.max_value to a positive
integer. Docsy uses 0 for “no” events.
+++title="Some super section"[cascade]github_repo="https://github.com/some-username/another-repo/"github_subdir="docs"path_base_for_github_subdir="content/some-section"…+++
---title:Some super sectioncascade:github_repo:https://github.com/some-username/another-repo/github_subdir:docspath_base_for_github_subdir:content/some-section…---
{"title":"Some super section","cascade":{"github_repo":"https://github.com/some-username/another-repo/","github_subdir":"docs","path_base_for_github_subdir":"content/some-section"}}
Once enabled site-wide, you can selectively hide last-modified notes in a page
or section by declaring the following style (optionally with a !important
modifier — not shown):
[params.taxonomy]taxonomyCloud=["projects","tags"]# set taxonomyCloud = [] to hide taxonomy cloudstaxonomyCloudTitle=["Our Projects","Tag Cloud"]# if used, must have same length as taxonomyCloudtaxonomyPageHeader=["tags","categories"]# set taxonomyPageHeader = [] to hide taxonomies on the page headers
params:taxonomy:taxonomyCloud:- projects # remove all entries- tags # to hide taxonomy cloudstaxonomyCloudTitle:# if used, must have the same- Our Projects # number of entries as taxonomyCloud- Tag CloudtaxonomyPageHeader:- tags # remove all entries- categories # to hide taxonomy clouds
[params.katex]# enable/disable KaTeX supportenable=true# Element(s) scanned by auto render extension. Default: document.bodyhtml_dom_element="document.body"[params.katex.options]# If true (the default), KaTeX will throw a ParseError when it encounters an# unsupported command or invalid LaTeX. If false, KaTeX will render unsupported# commands as text, and render invalid LaTeX as its source code with hover text# giving the error, in the color given by errorColor.throwOnError=falseerrorColor="#CD5C5C"# This is a list of delimiters to look for math, processed in the same order as# the list. Each delimiter has three properties:# left: A string which starts the math expression (i.e. the left delimiter).# right: A string which ends the math expression (i.e. the right delimiter).# display: Whether math in the expression should be rendered in display mode.[[params.katex.options.delimiters]]left="$$"right="$$"display=true[[params.katex.options.delimiters]]left="$"right="$"display=false[[params.katex.options.delimiters]]left="\\("right="\\)"display=false[[params.katex.options.delimiters]]left="\\["right="\\]"display=true
params:katex:enable:true# enable/disable KaTeX supporthtml_dom_element: document.body # Element(s) scanned by auto render extension. Default:document.bodyoptions:# If true (the default), KaTeX will throw a ParseError when it encounters an# unsupported command or invalid LaTeX. If false, KaTeX will render unsupported# commands as text, and render invalid LaTeX as its source code with hover text# giving the error, in the color given by errorColor.throwOnError:falseerrorColor:'#CD5C5C'# This is a list of delimiters to look for math, processed in the same order as# the list. Each delimiter has three properties:# left: A string which starts the math expression (i.e. the left delimiter).# right: A string which ends the math expression (i.e. the right delimiter).# display: Whether math in the expression should be rendered in display mode.delimiters:- left:$$right:$$display:true- left:$right:$display:false- left:\(right:\)display:false- left:\[right:\]display:true
```mermaid
sequenceDiagram
autonumber
Docsy user->>Discussion board: Ask question
Discussion board->>Community member: read question
loop Different strategies
Community member->>Test instance: Investigate issue raised
end
Note right of Community member: After hours of investigation:
Test instance-->>Community member: Come up with solution
Community member-->>Discussion board: Propose solution
Discussion board-->>Docsy user: check proposed solution
Docsy user->>Discussion board: Mark question as resolved
Docsy user->>Docsy user: Being happy
```
它会自动呈现为:
sequenceDiagram
autonumber
Docsy user->>Discussion board: Ask question
Discussion board->>Community member: read question
loop Different strategies
Community member->>Test instance: Investigate issue raised
end
Note right of Community member: After hours of investigation:
Test instance-->>Community member: Come up with solution
Community member-->>Discussion board: Propose solution
Discussion board-->>Docsy user: check proposed solution
Docsy user->>Discussion board: Mark question as resolved
Docsy user->>Docsy user: Being happy
```plantuml
participant participant as Foo
actor actor as Foo1
boundary boundary as Foo2
control control as Foo3
entity entity as Foo4
database database as Foo5
collections collections as Foo6
queue queue as Foo7
Foo -> Foo1 : To actor
Foo -> Foo2 : To boundary
Foo -> Foo3 : To control
Foo -> Foo4 : To entity
Foo -> Foo5 : To database
Foo -> Foo6 : To collections
Foo -> Foo7: To queue
```
自动呈现为:
participant participant as Foo
actor actor as Foo1
boundary boundary as Foo2
control control as Foo3
entity entity as Foo4
database database as Foo5
collections collections as Foo6
queue queue as Foo7
Foo -> Foo1 : To actor
Foo -> Foo2 : To boundary
Foo -> Foo3 : To control
Foo -> Foo4 : To entity
Foo -> Foo5 : To database
Foo -> Foo6 : To collections
Foo -> Foo7: To queue
[params.plantuml]enable=truetheme="default"# Set url to plantuml server# default is http://www.plantuml.com/plantuml/svg/svg_image_url="https://www.plantuml.com/plantuml/svg/"# By default the plantuml implementation uses <img /> tags to display UML diagrams.# When svg is set to true, diagrams are displayed using <svg /> tags, maintaining functionality like links e.g.# default = falsesvg=true
params:plantuml:enable:truetheme:default# Set url to plantuml server# default is http://www.plantuml.com/plantuml/svg/svg_image_url:'https://www.plantuml.com/plantuml/svg/'# By default the plantuml implementation uses <img /> tags to display UML diagrams.# When svg is set to true, diagrams are displayed using <svg /> tags, maintaining functionality like links e.g.# default = falsesvg:true
If you’re creating a new diagram, be sure to File -> Export in either svg or png format (svg is usually the best choice) and ensure the Include a copy of my diagram is selected so it can be edited again later.
contentDir="content/en"defaultContentLanguage="en"defaultContentLanguageInSubdir=false...[languages][languages.en]languageName="English"# Weight used for sortingweight=1[languages.en.params]title="Goldydocs"description="Docsy does docs"[languages.no]languageName="Norsk"contentDir="content/no"[languages.no.params]title="Goldydocs"description="Docsy er operativsystem for skyen"time_format_default="02.01.2006"time_format_blog="02.01.2006"
contentDir:content/endefaultContentLanguage:endefaultContentLanguageInSubdir:false…languages:en:languageName:Englishweight:1# used for sortingparams:title:Docsydescription:Docsy does docs'no':languageName:NorskcontentDir:content/noparams:title:Docsydescription:Docsy er operativsystem for skyentime_format_default:02.01.2006time_format_blog:02.01.2006
{"contentDir":"content/en","defaultContentLanguage":"en","defaultContentLanguageInSubdir":false,"languages":{"en":{"languageName":"English","weight":1,"params":{"title":"Docsy","description":"Docsy does docs"}},"no":{"languageName":"Norsk","contentDir":"content/no","params":{"title":"Docsy","description":"Docsy er operativsystem for skyen","time_format_default":"02.01.2006","time_format_blog":"02.01.2006"}}}}
name:Deployment to GitHub Pageson:workflow_dispatch:push:branches:- main # <-- specify the branch you want to deploy frompull_request:env:REPO_NAME:${{ github.event.repository.name }}REPO_OWNER:${{ github.repository_owner }}jobs:deploy:runs-on:ubuntu-22.04concurrency:group:${{ github.workflow }}-${{ github.ref }}steps:- uses:actions/checkout@v4with:fetch-depth:0# Fetch all history for .GitInfo and .Lastmod- name:Setup Hugouses:peaceiris/actions-hugo@v3with:hugo-version:'0.125.5'extended:true- name:Setup Nodeuses:actions/setup-node@v4with:node-version:'20'cache:'npm'cache-dependency-path:'**/package-lock.json'- run:npm ci- run:hugo --baseURL https://${REPO_OWNER}.github.io/${REPO_NAME} --minify- name:Deployuses:peaceiris/actions-gh-pages@v4if:${{ github.ref == 'refs/heads/main' }}# <-- specify same branch as above herewith:github_token:${{ secrets.GITHUB_TOKEN }}
将文件添加到暂存区域,提交更改并将更改推送到远程 GitHub 存储库:
git add .github/workflows/deploy-github-pages.yml
git commit -m "Adding workflow file for site deployment"
git push origin
在浏览器中,确保您已登录 GitHub 帐户。在存储库“设置”中,选择“页面”。
在“生成和部署”下,在“源”下拉列表中选择“从分支部署”。
从“分支”下拉列表中,选择“gh-page”作为构建站点的分支。
从“文件夹”下拉列表中,选择“/(root)”作为根目录。
就是这样!已配置站点的部署工作流。
现在,将来对工作流文件中指定的分支的任何推送都将触发工作流文件中定义的操作工作流。此外,还可以使用 GitHub Web UI 手动触发部署。
hugo deploy
Deploying to target "aws"(www.your-domain.tld)Identified 77 file(s) to upload, totaling 5.3 MB, and 0 file(s) to delete.
Success!
Invalidating CloudFront CDN...
Success!
cd /path/to/my-existing-site
hugo mod init github.com/me-at-github/my-existing-site
hugo mod get github.com/google/docsy@vmain
sed -i '/theme = \["docsy"\]/d' config.toml
mv config.toml hugo.toml
cat >> hugo.toml <<EOL
[module]
proxy = "direct"
[[module.imports]]
path = "github.com/google/docsy"
EOLhugo server
cd my-existing-site
hugo mod init github.com/me-at-github/my-existing-site
hugo mod get github.com/google/docsy@vmain
findstr /v /c:"theme = [\"docsy\"]" config.toml > hugo.toml
(echo [module]^
proxy = "direct"^
[[module.imports]]^
path = "github.com/google/docsy")>>hugo.toml
hugo server
[module]proxy="direct"# uncomment line below for temporary local development of module# replacements = "github.com/google/docsy -> ../../docsy"[module.hugoVersion]extended=truemin="0.73.0"[[module.imports]]path="github.com/google/docsy"disable=false
为了确保你的配置设置是正确的,请运行 hugo mod graph 命令,它会打印一个模块依赖项图:
hugo mod graph
hugo: collected modules in 1092 ms
github.com/me/my-existing-site github.com/google/docsy@v0.6.0
github.com/me/my-existing-site github.com/google/docsy/dependencies@v0.6.0
github.com/google/docsy/dependencies@v0.6.0 github.com/twbs/bootstrap@v5.2.3+incompatible
github.com/google/docsy/dependencies@v0.6.0 github.com/FortAwesome/Font-Awesome@v0.0.0-20230207192303-d02961b01815