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

推荐订阅源

Recent Commits to openclaw:main
Recent Commits to openclaw:main
GbyAI
GbyAI
Y
Y Combinator Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
aimingoo的专栏
aimingoo的专栏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
云风的 BLOG
云风的 BLOG
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
M
MIT News - Artificial intelligence
博客园_首页
B
Blog RSS Feed
Recorded Future
Recorded Future
N
Netflix TechBlog - Medium
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
D
DataBreaches.Net
IT之家
IT之家
The GitHub Blog
The GitHub Blog
P
Proofpoint News Feed
Microsoft Azure Blog
Microsoft Azure Blog
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
T
The Blog of Author Tim Ferriss
B
Blog
The Cloudflare Blog
MyScale Blog
MyScale Blog
雷峰网
雷峰网
U
Unit 42
C
Check Point Blog
月光博客
月光博客
Blog — PlanetScale
Blog — PlanetScale
T
Tailwind CSS Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
大猫的无限游戏
大猫的无限游戏
D
Docker
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
L
LangChain Blog
F
Fortinet All Blogs
腾讯CDC
Martin Fowler
Martin Fowler
I
InfoQ
J
Java Code Geeks
博客园 - Franky
Engineering at Meta
Engineering at Meta
人人都是产品经理
人人都是产品经理
有赞技术团队
有赞技术团队
阮一峰的网络日志
阮一峰的网络日志

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)
How the Jekyll SEO plugin helps you optimize your site
2021-11-15 · via CloudCannon Blog

SEO is a hot topic for Jekyll and static sites in general. WordPress has the famous Yoast plugin, which does a great job of helping you optimize a site's SEO. Jekyll has the Jekyll SEO tag plugin, which serves a similar purpose. In this showcase, we're diving into what this plugin does and how it works.

What does the Jekyll SEO plugin do? Direct link to this section

The plugin is designed to work out-of-the-box with minimal configuration. It'll set your page title, description, Canonical URL, next and previous pages for paginated pages, JSON-LD structured data to help with indexing, Open Graph data for social networks, and Twitter summary card.

The installation is straightforward, simply include the Gem and add {% seo %} to the <head> in your layout. The plugin does a good job using front matter and configuration data you likely already have set to generate the SEO metadata. It'll pick up fields like title, description, image & author. For a complete list, check out the docs.

The result after a build is a block of metadata that looks something like this:

<!-- Begin Jekyll SEO tag v2.7.1 -->
<title>Bootstrap | Cloudcannon</title>
<meta name="generator" content="Jekyll v4.1.1" />
<meta property="og:title" content="Bootstrap" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="Not only has Bootstrap helped millions of developers build websites, but their documentation is built using Hugo. Let’s dive in and deconstruct the Bootstrap documentation." />
<meta property="og:description" content="Not only has Bootstrap helped millions of developers build websites, but their documentation is built using Hugo. Let’s dive in and deconstruct the Bootstrap documentation." />
<link rel="canonical" href="https://cloudcannon.com/community/showcases/bootstrap/" />
<meta property="og:url" content="https://cloudcannon.com/community/showcases/bootstrap/" />
<meta property="og:site_name" content="Cloudcannon" />
<meta property="og:image" content="https://cloudcannon.com/community/uploads/showcases/bootstrap/bootstrap-hero.jpg" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2021-05-18T04:54:43+00:00" />
<meta name="twitter:card" content="summary_large_image" />
<meta property="twitter:image" content="https://cloudcannon.com/community/uploads/showcases/bootstrap/bootstrap-hero.jpg" />
<meta property="twitter:title" content="Bootstrap" />
<script type="application/ld+json">
{"image":"https://cloudcannon.com/community/uploads/showcases/bootstrap/bootstrap-hero.jpg","headline":"Bootstrap","dateModified":"2021-05-18T04:54:43+00:00","datePublished":"2021-05-18T04:54:43+00:00","@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"https://cloudcannon.com/community/showcases/bootstrap/"},"description":"Not only has Bootstrap helped millions of developers build websites, but their documentation is built using Hugo. Let’s dive in and deconstruct the Bootstrap documentation.","url":"https://cloudcannon.com/community/showcases/bootstrap/","@context":"https://schema.org"}
</script>
<!-- End Jekyll SEO tag -->

All of that for one line of Liquid and some front matter you probably already have set. Yes please. Before this plugin existed, this needed to be generated by hand with Liquid. It was error-prone, complicated, and a nightmare to maintain. The Jekyll SEO tag plugin almost makes it too easy.

HTML output Direct link to this section

Let's start by looking at how the HTML is generated. template.html is a file with simple HTML/Liquid that handles the bulk of the output. A small snippet is included here but if you want to dive deeper, take a look at the raw file:

<!-- Begin Jekyll SEO tag v{{ seo_tag.version }} -->
{% if seo_tag.title? %}
  <title>{{ seo_tag.title }}</title>
{% endif %}

<meta name="generator" content="Jekyll v{{ jekyll.version }}" />

{% if seo_tag.page_title %}
  <meta property="og:title" content="{{ seo_tag.page_title }}" />
{% endif %}

{% if seo_tag.author.name %}
  <meta name="author" content="{{ seo_tag.author.name }}" />
{% endif %}
<meta property="og:locale" content="{{ seo_tag.page_locale }}" />

There's nothing too crazy going on here. It's simply checking for particular variables and outputting them if they exist. Let's take a look at where these variables are initalized.

Liquid Drops Direct link to this section

The bulk of the plugin is a series of Liquid Drops. You may have heard this term before, but what exactly are Liquid Drops? A Drop is similar to a Hash in Ruby. It's an object you can use within Liquid with potentially dangerous methods removed.

Let's take the image Drop. All it does is gets an image from a page's front matter and returns it as an image path. Most of the logic is ensuring the path is in a sane format. Here's a snippet of the file. Again, take a look at the raw file for a full view.

class ImageDrop < Jekyll::Drops::Drop
include Jekyll::SeoTag::UrlHelper

def initialize(page: nil, context: nil)
raise ArgumentError unless page && context
@mutations = {}
@page = page
@context = context
end

def path
@path ||= filters.uri_escape(absolute_url) if absolute_url
end

Authors and JSON-LD are also Drops built similarly. These are all used in the Jekyll SEO drop which calculates all the values for the Liquid file include the title:

def title
@title ||= begin
if site_title && page_title != site_title
page_title + TITLE_SEPARATOR + site_title
elsif site_description && site_title
site_title + TITLE_SEPARATOR + site_tagline_or_description
else
page_title || site_title
end
end

return page_number + @title if page_number

@title
end

Description:

def description
@description ||= begin
format_string(page["description"] || page["excerpt"]) || site_description
end
end

Image:

def image
@image ||= ImageDrop.new(:page => page, :context => @context)
@image if @image.path
end

and JSON-LD:

def json_ld
@json_ld ||= JSONLDDrop.new(self)
end

Liquid Tag Direct link to this section

Liquid tags are the logic of a Liquid template, including statements, loops, case statements, and more. In this case, the SEO tag ( {% seo %}) is a Liquid Tag. It's the final piece of the puzzle and what the user calls to include the SEO metadata.

The file is mostly setting up data for the Drops. It ends with registering the SEO tag for Liquid:

Liquid::Template.register_tag("seo",Jekyll::SeoTag)

Wrap up Direct link to this section

The Jekyll SEO tag plugin is a must-have for any Jekyll site. It's usually the first plugin to install on any new Jekyll site. For more learning about Jekyll, try out this Jekyll tutorial to help with your next project.