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

推荐订阅源

MongoDB | Blog
MongoDB | Blog
博客园 - 聂微东
Attack and Defense Labs
Attack and Defense Labs
WordPress大学
WordPress大学
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Spread Privacy
Spread Privacy
AI
AI
宝玉的分享
宝玉的分享
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
C
Cyber Attacks, Cyber Crime and Cyber Security
爱范儿
爱范儿
Help Net Security
Help Net Security
V
Visual Studio Blog
大猫的无限游戏
大猫的无限游戏
Forbes - Security
Forbes - Security
P
Privacy & Cybersecurity Law Blog
Project Zero
Project Zero
IT之家
IT之家
Hugging Face - Blog
Hugging Face - Blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
有赞技术团队
有赞技术团队
T
Troy Hunt's Blog
美团技术团队
T
Threatpost
K
Kaspersky official blog
V
V2EX
Scott Helme
Scott Helme
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss
T
Tailwind CSS Blog
V
Vulnerabilities – Threatpost
Last Week in AI
Last Week in AI
PCI Perspectives
PCI Perspectives
Google Online Security Blog
Google Online Security Blog
Apple Machine Learning Research
Apple Machine Learning Research
Engineering at Meta
Engineering at Meta
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
I
InfoQ
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
酷 壳 – CoolShell
酷 壳 – CoolShell
GbyAI
GbyAI
L
LINUX DO - 最新话题
T
The Exploit Database - CXSecurity.com
L
LangChain Blog
S
Security @ Cisco Blogs
The Last Watchdog
The Last Watchdog
H
Hacker News: Front Page
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
TaoSecurity Blog
TaoSecurity 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)
Save time with CloudCannon's Snippets
2022-12-10 · via CloudCannon Blog

It’s only been a few weeks since we first introduced Snippets on CloudCannon, and they’re already saving time for CloudCannon developers, as well as for content teams collaborating on static sites. Today we’ll go through exactly what a Snippet is and how it can save you time on your next web project.

What’s a Snippet? Direct link to this section

A Snippet is CloudCannon's method of configuring and then editing content with a wide range of structured components across different static site generators. With Snippets, content editors can use a simple interface to easily insert includes, shortcodes and Markdown extensions into their content — all without touching the underlying code.

What’s the difference between a Snippet, a shortcode and an include? Direct link to this section

You’ll see these terms used differently in different places around the web. Typically a static site generator will use the term ‘shortcode’ — Hugo and Eleventy both do this — to mean a relatively simple way to insert reusable content into an existing template. Some shortcodes are paired, meaning they require a closing tag, and can nest other template content inside them.

Includes, by contrast, allows you to ‘include’ or insert content onto your page from another file in your site structure. For instance, your site’s navigation, section titles and footer are best served from a single source of truth, so using includes is the most efficient and error-proof way to do so.

CloudCannon’s term Snippets is a superset, an umbrella term that covers a range of ways that static site generators use structured components. This encompasses includes in Eleventy, shortcodes in Hugo and Eleventy, and — coming soon — Markdown extensions in MkDocs and includes in Jekyll, among others. We support a wide range of SSGs, each with unique configuration requirements, but with Snippets we can support a range of different shortcodes, extensions, and includes across different SSGs, all configured in our global configuration file — allowing CloudCannon users to edit and develop more efficiently.

Why use Snippets? Direct link to this section

With Snippets, content writers can make use of reusable components within the Content or Visual Editors without having to switch over to raw HTML or Markdown — whether their task is embedding a correctly styled social media post into a page, adding navigation links between documentation pages, or any other specific repeatable content they need to do their jobs.

One of the main reasons that developers on CloudCannon use Snippets — and, let’s be honest, one of the main reasons developers use any tool — is to save time. By configuring and using Snippets, developers can avoid having to write out entire blocks of code from scratch, which can be time-consuming and error-prone, particularly when a built site is handed over to a content team for ongoing content loading.

As always, we focus on giving everyone the tools they need to work without getting in their way. Hence the simple Snippets button you’ll see in your Markdown editing menu:

After choosing which Snippet to add, all you’ll need to do is fill in the relevant fields, and your new content block is inserted directly into your Markdown. Here’s the process of adding a Snippet that uses one of Hugo’s built-in shortcodes:

Speaking as a writer and content editor, a GUI like this means I can spend more time actually seeing and thinking about the content I’m working on. (And the sooner I can see my content in its final context, the sooner I can make it better — which is why CloudCannon’s Visual Editor and Content Editor are my two most frequently used views.) Snippets are another part of the solution, and added to Bookshop components, there’s a really clear path to creating new pages (and entirely new sites) in a fraction of the time it would otherwise have taken.

Of course, having a GUI means configuring your Snippets ahead of time. Luckily, when it comes to configuring which Snippets are available for content teams to use, CloudCannon has you covered.

How to configure a new Snippet Direct link to this section

We go into a lot more detail on configuring Snippets for Hugo shortcodes and for Eleventy shortcodes in our documentation, but here’s a quick checklist of the minimum steps needed.

For Eleventy sites, in the global configuration file cloudcannon.config.yml, you’ll need to:

  • Import the built-in shortcodes or includes you want from Eleventy, using the _snippets_imports key. (This step is not required for built-in Hugo shortcodes, which are already imported.)

For both Hugo and Eleventy sites, In the global configuration file cloudcannon.config.yml you’ll need to:

  • Define any custom shortcodes you want from your chosen SSG, using the _snippets object

For example, setting up a custom Snippet for Hugo would look like this:

_snippets:
hugo_tint:
template: hugo_paired_shortcode_positional_args
inline: true
preview:
text: Tint
definitions:
shortcode_name: tint
content_key: inner_text
positional_args:
- editor_key: tint_color
type: string
_inputs:
tint_color:
type: color
inner_text:
comment: This text will be tinted

By default, when Snippets are available for either Hugo or Eleventy sites, CloudCannon will automatically add the Snippets button to your editing toolbar. (If you’ve already set custom editing options in your global configuration via the _editables object, then you’ll need to include snippets: true as well.)

Looking through our Snippets documentation, you’ll find a full list of all supported options to configure your custom shortcodes as a CloudCannon Snippet. If you have components that don’t fit our existing Snippet configuration, let us know! We’re still building out the Snippets feature, and while we have pretty clear plans, our development process is guided by user requests.


We’re also happy to help you configure your Snippets — just reach out to us in support and we’ll get back to you as soon as we can.