Skip to content
CMSKite

Add your blog with two lines

Two lines on one page of your site show your posts there, in your site’s own fonts and colours. The list is on that page; a post opens on the same page with its own address. Everything below is optional — the two lines work as they are.

Updated

On this page
  1. The two lines
  2. Where to paste them
  3. What it does for search engines
  4. Addresses like /blog/my-post
  5. One post on any page
  6. A sitemap for your posts

The two lines

Your own two lines, with your blog’s name already in them, are on the Connect website page of your dashboard. They look like this:

html
<div id="cmskite-blog"></div>
<script src="https://cmskite.com/embed.js" data-blog="your-blog" async></script>
AttributeWhat it does
data-blogYour blog’s name. The only one you need.
data-pathGives each post an address like /blog/my-post. See below.
data-paramThe name in ?post=my-post, if post clashes with something on your site.
data-accentA colour for links and labels, e.g. #2563eb.
data-targetThe id of the element to draw into, if not cmskite-blog.
data-postOne post’s slug: shows only that post, anywhere. See below.

Where to paste them

Make a page called Blog on your site, then paste the two lines into the box your platform has for code. Each platform has a page with the steps and its quirks:

PlatformWhere the two lines goSteps
WordPressA Custom HTML block on your blog pagecmskite.com/for/wordpress
WixAdd → Embed Code → Embed HTMLcmskite.com/for/wix
ShopifyA page template of its own with a Custom Liquid sectioncmskite.com/for/shopify
WebflowA Code Embed element on your blog page (needs a paid site plan)cmskite.com/for/webflow
SquarespaceA Code block on your blog page (Core plan and above)cmskite.com/for/squarespace
LovableNo pasting: copy the ready-made prompt from your dashboard into the Lovable chatcmskite.com/for/lovable
Any HTML pageAnywhere in the page’s body, where the posts should appearThis page

What it does for search engines

With a post open, the script gives your page the post’s title and description, a canonical link to the post’s one address on your site, and Article structured data (headline, description, image, author, published and updated dates) — the same your free blog page carries. Google runs the script when it renders the page, so it reads all of it.

Once your page has shown the posts, your free blog page on cmskite.com points search engines at your site, so the two never compete for the same post.

Addresses like /blog/my-post

By default a post’s address is your blog page plus ?post=my-post. That works everywhere and Google indexes it. If your host lets you add a rewrite, you can have /blog/my-post instead: add data-path="/blog" (your blog page’s own path) to the script tag, then tell your server to answer every /blog/… address with the blog page itself.

html
<div id="cmskite-blog"></div>
<script src="https://cmskite.com/embed.js" data-blog="your-blog" data-path="/blog" async></script>

Old ?post= links keep working, and their canonical link names the new address. The rewrite for your host:

  1. WordPress

    Your blog page must be the page with the slug blog. Add this with the Code Snippets plugin (or your theme’s functions.php), then open Settings → Permalinks and press Save once.

    php
    add_action('init', function () {
      add_rewrite_rule('^blog/([^/]+)/?$', 'index.php?pagename=blog', 'top');
    });
  2. Plain HTML on Apache (.htaccess)

    Next to your site’s files. Use the file your blog page really is.

    apache
    RewriteEngine On
    RewriteRule ^blog/[^/]+/?$ /blog/index.html [L]
  3. Plain HTML on Nginx

    Inside your site’s server { } block, then reload Nginx.

    nginx
    location ~ ^/blog/[^/]+/?$ {
      try_files /blog/index.html =404;
    }
  4. Netlify or Cloudflare Pages (_redirects)

    A file named _redirects at the top of what you deploy. The 200 makes it a rewrite, not a redirect.

    plain
    /blog/*  /blog/index.html  200
  5. Vercel (vercel.json)

    At the top of your project.

    json
    { "rewrites": [{ "source": "/blog/:slug", "destination": "/blog/index.html" }] }

On a page served from a rewrite, write your own CSS and image paths from the root (/style.css, not style.css), or they are looked for under /blog/my-post/.

One post on any page

To show a single post somewhere else, such as a landing page, a partner’s site or a help centre, add data-post with the post’s slug. Only that post appears: no list of other posts and no back link. Every published post’s own page in the dashboard has these two lines ready to copy.

html
<div id="cmskite-post-my-post"></div>
<script src="https://cmskite.com/embed.js" data-blog="your-blog" data-post="my-post" async></script>

The post is a guest on that page, so the page keeps its own title, description and canonical link, and the view still counts. Several posts can sit on one page: each pair of lines draws into its own cmskite-post-… element. A post that is unpublished later shows “This post is not available.”

A sitemap for your posts

A sitemap tells search engines every post’s address, which matters most while your blog is new. Your site does not know your posts, so we keep one for you, with each post at its address on your site:

plain
https://cmskite.com/b/your-blog/site-sitemap.xml

It uses your site’s addresses once a visitor has opened your blog page with the two lines on it; before that it lists your free blog’s. Then do one of these:

  1. Name it in your robots.txt (best: it stays up to date). Add the line Sitemap: https://cmskite.com/b/your-blog/site-sitemap.xml. Search engines accept a sitemap on another site when your own robots.txt names it. WordPress: your SEO plugin’s robots.txt editor (Yoast: Tools → File editor). Shopify: Online Store → Themes → Edit code → add the template robots.txt. Webflow: Site settings → SEO → Robots.txt.
  2. Or upload it. Open the address above, save the file, upload it to your site (e.g. as /blog-sitemap.xml), and submit that address in Google Search Console under Sitemaps. Upload it again after you publish new posts.

If your host allows neither, search engines still find your posts by following the links on your blog page — it only takes longer. On Wix there is nothing to do: the posts rank under your free blog link, which is in our own sitemap already.