惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Check Point Blog
L
LINUX DO - 最新话题
博客园_首页
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
WordPress大学
WordPress大学
V
Visual Studio Blog
博客园 - 【当耐特】
小众软件
小众软件
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
量子位
IT之家
IT之家
H
Hacker News: Front Page
O
OpenAI News
V2EX - 技术
V2EX - 技术
Attack and Defense Labs
Attack and Defense Labs
K
Kaspersky official blog
罗磊的独立博客
博客园 - 聂微东
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Threatpost
N
News and Events Feed by Topic
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Hugging Face - Blog
Hugging Face - Blog
Hacker News: Ask HN
Hacker News: Ask HN
Hacker News - Newest:
Hacker News - Newest: "LLM"
腾讯CDC
P
Privacy International News Feed
V
Vulnerabilities – Threatpost
C
CXSECURITY Database RSS Feed - CXSecurity.com
Help Net Security
Help Net Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Spread Privacy
Spread Privacy
H
Help Net Security
S
Secure Thoughts
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
Cloudbric
Cloudbric
NISL@THU
NISL@THU
云风的 BLOG
云风的 BLOG
Microsoft Security Blog
Microsoft Security Blog
Google DeepMind News
Google DeepMind News
C
CERT Recently Published Vulnerability Notes
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Latest news
Latest news
T
Troy Hunt's Blog

CloudCannon Blog

Building with AI: Git-based vs headless vs traditional CMS CloudCannon + Astro: performance meets powerful content management Introducing the Astro Component Starter Introducing Jetstream — built on the Astro Component Starter Why we switched to the system font stack Redesigning CloudCannon’s docs with Diátaxis, Lume, and Pagefind Make content editing more visual: upgraded Editable Regions How Configuration Mode makes building editing interfaces easy Your hosting just got an upgrade (and a price cut) Custom testing domains for professional branding Keep your content consistent with input validation Managing multilingual content in CloudCannon Simplify team publishing with conflict resolution and domain tools Open Beta: Publishing Conflict Resolution Getting started with CloudCannon and Astro: Bookshop, components, and live editing Welcome to the CloudCannon Community! Omnichannel delivery is just marketing spin from API-based CMS companies Getting started with CloudCannon and Astro: Snippets and Collections Managing digital assets in CloudCannon: a guide to smart asset storage Understanding CloudCannon's branching workflows and Projects: a complete guide What is a static website? CloudCannon’s 2024 wrapped Getting started with CloudCannon and Astro: WYSIWYG blogging Jamstack vs. WordPress: reasons to make the change The top five static site generators for 2025 (and when to use them!) Free Jekyll themes for 2025: ten great community options Eleventy (11ty) vs. Hugo How to set up WYSIWYG editing with MkDocs Material The rise of static-first websites: why major brands are making the switch Watching your Core Web Vitals on Jamstack Understanding the difference between static, dynamic, and hybrid websites Looking for an alternative to Netlify CMS or Decap CMS? Designing components for your website editors: a CloudCannon case study Does my website look big in this? Six tips to lower your page weight Content is sacred — so own your revision history The eternal balancing act: load time vs. delay time Streamlined Headless Mode, Unified Configuration, and live data editing What is a headless CMS? Looking for a TinaCMS or Tina Cloud alternative? The ultimate guide to Hugo Sections Coming soon: Live config editing and data reloading Faster publishing workflows out now! Why information architecture matters for your website Website UX vs SEO: picking your battles Easily manage your multilingual Astro site in CloudCannon How you can optimize publishing workflows for your content team How you can optimize your CMS for SEO success How you can optimize your Content Editor for long-form articles How you can optimize your Visual Editor for page building Secure, swift, and stable: static sites for the financial sector Enhanced flexibility for teams with Custom Permissions Building static sites that scale The Inaugural 11ty International Symposium on Making Web Sites Real Good How to manage hundreds of connected websites with a Git-based headless CMS How we’re building CloudCannon for accessibility CloudCannon’s new editing improvements are here! Open Beta | New ways to collaborate on editing your websites Top 11 free Eleventy themes for 2024 Top 10 free Astro themes to use in 2024 Why choose a Git-based headless CMS over a monolithic DXP in 2024? Learning web development: a self-guided roadmap Partner Site of the Month: Blüthner Piano Centre, by Winteractive CloudCannon’s 2023 wrapup Let’s create a microblog with visual editing using Bookshop and Eleventy Update and visualize your branches with CloudCannon Projects What is a Git-based CMS and why you should use one CloudCannon secures SOC 2 certification The complete guide to growing your web development agency Automatically optimize your images with Eleventy Image and CloudCannon Share components and syndicate content with Site Mounting Partner Site of the Month: Cru Uncorked, by Ed Meehan New web component for responsive HTML tables Wrapping up HugoConf 2023 Partner Site of the Month: Van Dillen Antieke Bouwmaterialen, by Fulldev How to become a freelance web developer: a comprehensive guide Q3 2023: CloudCannon features and improvements 22 ways to deliver more value to your web development clients Partner Site of the Month: DC Gay Flag Football League, by Ed Cupaioli A new way to configure your CloudCannon sites CloudCannon — the official CMS partner of Eleventy Full CloudCannon support for Nuxt static sites Partner Site of the Month: Stadium Bike, by Insight Creative, Inc. HugoConf 2023, brought to you by CloudCannon DAM Support for Cloudflare R2 and DigitalOcean Spaces Eleventy (11ty) vs. Gatsby in 2023 – which SSG is best for you? How CloudCannon’s live editing works with Astro and Bookshop Partner Site of the Month: Fiducian, by Croissant & Baguette Eleventy (11ty) vs. Astro How to customize CloudCannon’s Client Sharing interface Let anyone, anywhere, edit your CloudCannon sites Top 23 free Astro themes for building out-of-this-world static sites in 2023 How Jampack optimizes our Eleventy website and improves performance Astro vs. Next.js CloudCannon.com is now built with Eleventy! Out-of-this-world support for all Astro users Introducing the CloudCannon Partner Program Full CloudCannon support for Gatsby Top 10 Free SvelteKit Themes for Building Lighting-Fast Static Sites in 2023 Enhanced CloudCannon support for Next.js users Upcoming CloudCannon Interface improvements (Open Beta)
Going Wild with Hugo Modules
2022-07-30 · via CloudCannon Blog

At the recent HugoConf, Jeanne Haskett, Nathalie Laroche, and Kimberley Brown — part of the Nuance Communications TechPubs team — presented their process for using Hugo modules, which enables efficient content reuse and consistency across Nuance's multiple products. We found their presentation really helpful and informative, so without further ado, let's find out more about…

How Nuance TechPubs stepped up their game with Hugo modules Direct link to this section

The Nuance Technical Publications team recently moved to Hugo, which we love, and discovered that Hugo modules solve many of our consistency and standardization needs.

With a team of over 15 writers, and a portfolio that includes dozens of products, it's important for our documentation to read, and look, like it's coming from the same organization.

Enter modules.

The official Hugo documentation defines modules as follows:

Hugo Modules are the core building blocks in Hugo. A module can be your main project or a smaller module providing one or more of the 7 component types defined in Hugo: static, content, layouts, data, assets, i18n, and archetypes.

Our use of Hugo modules spanned three phases. We took it slow at first. But once we discovered how powerful modules can be, we went wild!

The journey Direct link to this section

We've broken our journey into three phases to match three distinct goals:

  • Phase 1: Consistency
    • Pull common content into multiple Hugo projects, ensuring consistency. For example, archetypes and modifications to a theme.
  • Phase 2: Branding
    • Easily configure projects at the product level, to use different logos and favicons, and eventually entire CSS "skins".
  • Phase 3: Content reuse
    • Share common content across all project repos but prevent modification: content fragments, entire topics, glossary definitions.

Phase 1: Consistency Direct link to this section

In the first phase, we considered the contents of a typical Hugo project and identified the components that should be the same for all projects.

Nuance

The common content that we centralized includes:

  • archetypes folder, since we use it to provide writers with templates for new topics. For example, we write a lot of API documentation, so we created an archetype for gRPC topics that writers can use to quickly get started. Archetypes are a handy Hugo feature!
  • assets folder, which contains some of our Docsy overrides like our logo. (We use the Docsy theme, which we love.)
  • layouts folder, which includes theme overrides as well as our custom shortcodes.
  • static folder, which includes common files like our favicon.

We took all these files and put them in a Hugo module, which we called, very originally, hugo-common-modules. 😉

If you’re familiar with Hugo modules, then you know that the next step is to configure your project to import the module. We decided to break the config.toml file into multiple configuration files for ease of maintenance.

Here is the content of our module configuration file, module.toml:

[[imports]]
path = "github.com/████████/hugo-common-modules"
disabled = false

[[imports.mounts]]
source = "static"
target = "static"

[[imports.mounts]]
source = "layouts"
target = "layouts"

[[imports.mounts]]
source = "assets"
target = "assets"

[[imports.mounts]]
source = "archetypes"
target = "archetypes"

...

Notice that we're mounting the four folders that we need. Next, we copied this file into all our Hugo projects. This was pretty simple, as you can see, and fit our needs precisely.

Phase 2: Project-specific branding Direct link to this section

At the beginning of our Hugo journey, we had plans to use the Hugo framework for one product, which meant a single look and feel. Pretty soon other writers on the team, writing for other products, wanted to use Hugo. This meant serving multiple products, each with slightly different branding. Our solution: Hugo modules!

We started by identifying the elements that would form part of the boilerplate or global template and put all that code in the respective files of the assets/ directory of our hugo-common-modules. To easily build and deploy our docs sets with different skins, we created a new directory called project-specific/. This directory, which contains subdirectories per product, houses each product’s proprietary logo and favicon, SCSS, and any file overrides specific to that product.

Nuance

We then updated our module.toml accordingly. In the image below, “mix” is a product with its own logo, favicon, color palette, landing page images, and so on. By simply changing “mix” to another product name we can quickly switch to (import) an entirely different skin for an entirely different product.

Nuance

Phase 3: Content reuse Direct link to this section

Previously, we mentioned archetypes and how useful they are to the content development process. Archetypes allow us to standardize specific types of content like API documentation, for example, or a quick start or getting started topic. As mentioned, we were already using our hugo-common-modules to import archetypes.

Content reuse is not limited to entire topics. It can also include fragments of content, which some writers call snippets, that remain the same within a project or even across projects and are meant to be used again and again. Another example are common terms like glossary definitions. As you might expect, we expanded our use of hugo-common-modules to include content like snippets and glossary definitions. This approach satisfied our goal to write it once and use it in many different places.

Nuance

However, when a project imports a Hugo module, the content is imported silently; that is, it does not appear in the project. This approach worked fine for files writers didn’t care about such as Docsy overrides, custom shortcodes, project-specific SCSS, and so on. To reuse content, however, writers needed to view it to determine if it suited their needs. Writers needed not only access to common content—shared in a single, central location—but also needed to see it.

Our solution: Vendor modules.

Hugo “vendoring” of content Direct link to this section

Using a module that is "vendored” creates a _vendor directory in the project, which in our case allows writers to see the contents of the module dependencies as they’re working locally in the project. They can easily view the content of the files and reference the local filepath of shared content they wish to reuse, since “vendored” content behaves as if it belongs to the project.

Note: If you use this approach in Git, remember to add the _vendor directory to your .gitignore file to avoid committing it, since you only need it when working locally in the project.

This approach also nicely fulfilled our goal of ensuring consistency: Should a writer feel inclined to change a shared content file—and they often do!—he or she can do so only by submitting a merge request via the hugo-common-modules project, since local changes to “vendored” content are not retained once you do another import (run hugo mod vendor again).

Nice. That solution worked for us! But that’s not the end of our journey.

Sharing doc sets Direct link to this section

What about documentation sets that form part of other doc sets? Consider a component that is common to many different products such as a license server. It might even “stand alone” as a product.

For a small product we might decide to place the documentation for installing and configuring the license server at the top level of the doc set; however, for a complex product we might prefer to pull the content into a “Requirements" section that includes additional prerequisites.

Once again, Hugo modules to the rescue: We simply store the license server documentation in its own module, which we then pull into each project at the desired location via the project’s module.toml file.

In this example, we are importing documentation and images from two modules (docs-mix-event-logs and docs-mix-nluaas-grpc) and specifying the path of both the source and target files.

Nuance

Recap Direct link to this section

In summary, modules have created a ton of value for us. We have been able to successfully apply archetypes and theme overrides, project-specific branding, and content reuse, all with the help of modules. And we’re only getting started.

What's next Direct link to this section

Since we presented at HugoConf, we've added Docsy as a module, greatly simplifying the workflow for writers.

Next, we plan to create a series of dashboards that will read in the content of all the component modules we use. These dashboards will allow us to see at a glance all the shared content, across all projects. Think of it as the control room for all things documentation.

Who we are Direct link to this section

We're the “terrible trio” (😉), also known as the "Hugo Admins", in our TechPubs group. Feel free to watch our HugoConf tech talk on this subject and to contact us with any questions, comments, or suggestions. Also be sure to check out Kim's lightning talk on Implementing conditional processing in Hugo, another innovation we can’t live without.

Jeanne Haskett
Content Architect & Senior Principal Technical Writer
Nuance Communications
jeanne.haskett@nuance.com

Nathalie Laroche
Senior Principal Technical Writer
Nuance Communications
nathalie.laroche@nuance.com

Kimberley Brown
Frontend Developer
Nuance Communications
kimberley.brown@nuance.com