> For the complete documentation index, see [llms.txt](https://docs.v2.like.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.v2.like.co/general-guides/dapp/creator/self-host/hugo.md).

# Hugo

How to embed LikeCoin button into Hugo

{% hint style="warning" %}
The documentation is designed for Liker Land and LikeCoin v2. For information on [3ook.com](https://3ook.com/) and LikeCoin v3, please visit [docs.3ook.com](https://docs.3ook.com) and [dao.like.co](https://dao.like.co/).
{% endhint %}

Thanks to the user [Wancat](https://www.wancat.cc/post/hugo-install-likecoin/) for providing the tutorial.

Before adding the LikeCoin button, please [register a Liker ID](/general-guides/dapp/liker-id.md).

Choose a theme for your website first. The following is an example using the [CleanWhite](https://themes.gohugo.io/hugo-theme-cleanwhite) theme.

Hugo allows users to use custom layouts to change the website design without altering the theme. The LikeCoin button can be added using this function. Follow the steps below:

Copy the post template by copying the `layouts` folder from your `theme` to the repository directory:

```
cp -r theme/YOUR_THEME/layouts/ .
```

Hugo allows users to create simple templates with [Partial Templates](https://gohugo.io/templates/partials/) and embed them into a page. Create a file named `likecoin.html` in `partials` folder of the `layouts` directory. Fill in the following code. You can also include words to encourage clapping the LikeCoin button in HTML format:

```
<iframe class="LikeCoin" height="235" src="https://button.like.co/in/embed/{{ .Site.Params.likerID }}/button?referrer={{ .Permalink }}" width="100%" frameborder=0></iframe>
```

&#x20;Add the following code to your `config.toml` file and change \[LikerID] to your Liker ID:

```
[[params]]
	likerID = "likerID"
```

Edit the post template, which is usually located in `_default/single.html`. This is a Go Template. It is suggested to place the code after `{{ .Content }}` so that the LikeCoin button will appear at the end of the article:

```
{{ partial "likecoin.html" . }}
```

Hugo will render this partial for your posts. Remember to include the "." in the code, otherwise the LikeCoin template won't be able to read the data. In fact, it is not necessary to modify the original Hugo theme.

The last step is to run `hugo server` to preview your website.

By following these steps, the LikeCoin button will be added to your website.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.v2.like.co/general-guides/dapp/creator/self-host/hugo.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
