contentgate

v0.2.0
io.github.adsandcode/contentgate Checked 1 day ago Published 1 month ago

Pre-deploy checks for content sites: keywords, translations, links, claims, page SEO/GEO audit.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

check_keywords

Verify that target keywords actually appear in a rendered page. Every term tied at the highest search volume must appear at least `primary_min_hits` times; every other term at least once. Matching is literal and case-insensitive: whitespace is never normalised, because 'web hosting' and 'webhosting' are different terms with different search volumes.

ParameterTypeDescription
html *stringRendered HTML of the page.
keywords *objectMap of keyword to monthly search volume, taken from real tool data.
exclude_classesarrayClasses whose subtree is ignored. Use this for site-wide call-to-action blocks, otherwise they satisfy the check on every page.
primary_min_hitsinteger
scopearrayElement to look inside, as [tag, class], e.g. ["article","post"]. Omit to read the whole document.

check_translation

Compare a translation against its source document for structural drift: heading sequence, HTML tag sequence, table row count, internal link paths, price tokens, locale prefix on internal links, leftover source-script characters, introduced em dashes and emoji. This checks structure, not meaning: it cannot tell you a translation is good, only that it is no longer the same document.

ParameterTypeDescription
locale *stringLocale code of the translation, e.g. "es". Internal links are expected to carry it as a prefix.
source *stringThe source-language markdown.
translation *stringThe translated markdown.
check_locale_prefixboolean
forbid_source_scriptbooleanSet false when the target legitimately shares the source script, e.g. Simplified Chinese from a Traditional Chinese source.
require_front_matterbooleanRequire line 1 to be an H1 and line 2 to be a summary blockquote.

check_claims

Scan copy for affirmative performance claims of the kind that get finance, health and other regulated advertising rejected: guaranteed profit, stated win rates, promised returns. A disclaimer is not flagged when its negation governs the claim itself, shortly before it in the same clause (不保證獲利, 'we do not guarantee profit', 'no guaranteed returns'), or when the phrase is named as forbidden ('guaranteed profit claims are banned'). A negation elsewhere in the sentence does not count: 保證獲利,絕不會虧損 is still a claim.

ParameterTypeDescription
text *stringPlain text or HTML. HTML tags are ignored.

sitemap_lastmod

Decide a sitemap lastmod date honestly. Hash the meaningful content of a page, compare it against the stored hash, and move the date only when the content genuinely changed. Stamping today's date on every URL every build teaches crawlers that the field carries no information.

ParameterTypeDescription
body *stringCurrent HTML of the page.
today *stringToday's date, ISO format.
previous_hashstring | nullStored hash from the last run, or null for a page seen for the first time.
previous_lastmodstring | nullStored lastmod, ISO date.
strip_classesarrayClasses to remove before hashing: visitor counters, build ids, anything that changes on its own.
strip_patternsarrayRegular expressions to remove before hashing.

content_hash

Hash the meaningful content of a page, with volatile blocks and scripts removed. Use it to tell a real edit from a rebuild.

ParameterTypeDescription
body *string
strip_classesarray
strip_patternsarray

audit_page

Page-level SEO/GEO audit of one rendered HTML page, before it ships. Checks: visible_text (characters readable with JavaScript off, excluding <template> and elements with the hidden attribute; Google renders JavaScript, but many AI crawlers read only the HTML the server sent, so an article injected by a script is invisible to them); structured_data (every JSON-LD block parses, required @type values are present, dateModified exists; a required type is satisfied by its schema.org subtypes, e.g. BlogPosting or NewsArticle for Article; a ProfilePage is not required to be an Article); outbound_link…

ParameterTypeDescription
html *stringRendered HTML of the page, as the server sends it.
url *stringThe page's public URL. Decides which links are external and whether this is the home page.
checksarrayRun only these checks. Default: all six.
cite_okarrayoutbound_links: domains you cite editorially, matched with their subdomains, e.g. ["gov.uk"]. Ordinary editorial links need no rel, so this is the right fix for a reported citation, not adding nofollo…
min_charsintegervisible_text: minimum characters readable with JavaScript off. 1200 is a house rule, not a search-engine number.
require_date_modifiedbooleanstructured_data: require a dateModified.
require_typesarraystructured_data: @type values that must be present.
stock_phrasesarraystock_phrases: phrases to flag, matched case-insensitively. Default: one editor's Traditional Chinese list, whose connectives (因此,, 然而,) also flag ordinary sentences; replace it with your…

compare_pages

Measure how many sentences two pages share word for word, using the text a crawler sees with JavaScript off (navigation and footers excluded). Sentences split on 。!? and on . ! ? followed by whitespace; sentences under ten characters are ignored. The share is measured in characters, in both directions, and the larger figure decides, because a short page copied into a long one is a small share of the long page and all of the short one.

ParameterTypeDescription
html_a *stringRendered HTML of the first page.
html_b *stringRendered HTML of the second page.
max_sharenumberLargest acceptable shared share, 0 to 1.