Back to templates

Template details

Gohugo Theme Yinwang

A Hugo blog theme styled after yinwang.org, with per-post CSS overrides, code copy, GitHub edit links, and raw HTML/CSS shortcodes.

About this template

Gohugo Theme Yinwang is a Hugo blog theme that recreates the look of yinwang.org, designed for static blog publishing with Markdown content. It is built on Hugo and maintained by chinanf-boy (yobrave Lee) as a fork of the basics theme. The theme outputs a static blog with category and tag archives, per-page CSS overrides, and optional integration with Google Analytics and GitHub for in-page edit links.

What is Gohugo Theme Yinwang?

Gohugo Theme Yinwang is a Hugo theme for blogs, styled after the personal site yinwang.org. As input it takes Markdown files in content/post, a config.toml with theme parameters, and optional per-page front matter; as output it generates a complete static website with post pages, category/tag listings, and a home page. The theme is authored by chinanf-boy and is available on GitHub, installed by adding it as a git submodule with theme = "yinwang" in configuration.

What makes Gohugo Theme Yinwang stand out?

  • Hugo static generation — Built entirely on Hugo, with no frontend build step; content is written in Markdown and served as static HTML.
  • Per-post front matter overrides — Each post can override theme-wide settings for editBtn, anchorLink, copyCode, imageZoom, and labels, giving individual pages independent behaviors.
  • Raw HTML/CSS shortcodes — The theme registers the shortcodes rawhtml and rawcss so authors can inject unescaped HTML and CSS inside Markdown, bypassing Hugo's default escaping.
  • GitHub edit button — Configure githubRepo and editBtn together to render an "edit this page" link on every post, pointing to the source file on GitHub.
  • Code interaction tools — With copyCode = true each code block gets a copy button, and anchorLink = "¶" adds copyable anchor links to heading elements.
  • Customizable styling — Set backgroundColor in config, choose a highlight theme for highlight.js (default is github), and add custom CSS files per page via the front matter css list.
  • Menu and analytics hooks — Enable menus = true to define custom navigation menus in config, and set googleAnalytics to enable Google Analytics gtag tracking.

Who is Gohugo Theme Yinwang for?

  • Technical bloggers — Write posts in Hugo's standard Markdown format, use the post directory convention, and publish a clean blog with tag/category support.
  • Chinese-speaking Hugo users — The theme documentation is written in Chinese and the default languageCode is zh-CN, making it approachable for Chinese developers.
  • Designers who want site-level control — The combination of config.toml params and per-page front matter lets you tune colors, menu items, code themes, and custom CSS without editing theme files.
  • Open-source fans — Because the theme is installed as a git submodule and has an edit button, contributors can suggest changes via pull requests directly from any post.

What can you do with Gohugo Theme Yinwang?

  • Publish a personal tech blog — Create post entries with hugo new post/hello.md, add front matter categories/tags, and build a static site with hugo server -D.
  • Style individual posts — Use the front matter css array to load additional stylesheets for a single post, or wrap content in the rawhtml shortcode for custom markup.
  • Manage a content series — Add a series field to front matter to group related posts, with a series listing script included in the theme's footer.
  • Tie posts back to source — Set githubRepo and editBtn so every post displays a direct edit link, making maintenance and community contributions straightforward.

How does Gohugo Theme Yinwang work?

The README walks through a setup flow: initialize a git repository, add the theme as a submodule from its GitHub URL, set theme = "yinwang" in config.toml, create content with hugo new post/hello.md, then run hugo server -D for local development. For production, build with hugo -b "/" if the site is served from a subpath, and be sure baseURL ends with a slash. The theme renders standard Hugo output, and most behavior toggles are controlled from config.toml or per-page front matter.