@a1local/eleventy-adpages
v0.1.0
Published
Eleventy plugin helpers for local business schema, landing-page metadata QA, and service-area pages.
Maintainers
Readme
@a1local/eleventy-adpages
Eleventy plugin scaffold for lightweight local SEO and landing-page QA helpers. The package is intentionally small: no runtime dependencies, no network calls, and no hard dependency on Eleventy types.
What is included
adpagesEleventy()returns an Eleventy-compatible plugin function.localBusinessSchemashortcode creates a JSON-LD script tag for LocalBusiness-style schema.localBusinessSchemaDatafilter returns schema data for custom templates.metadataChecklistfilter checks common landing-page metadata fields.serviceAreaPagesfilter builds a normalized service-by-area page matrix.
Install
npm install @a1local/eleventy-adpagesConfigure Eleventy
Use an ESM Eleventy config:
import adpagesEleventy from "@a1local/eleventy-adpages";
export default function (eleventyConfig) {
eleventyConfig.addPlugin(adpagesEleventy, {
business: {
name: "Example Plumbing",
businessType: "Plumber",
url: "https://example.com"
}
});
}LocalBusiness JSON-LD
Use the shortcode with the configured default business:
{% localBusinessSchema %}Or pass page-specific data:
{% localBusinessSchema {
name: "Example Plumbing Fremantle",
businessType: "Plumber",
url: "https://example.com/plumber/fremantle/",
areaServed: ["Fremantle"]
} %}Use the filter if you want to render the JSON yourself:
{% set schema = pageBusiness | localBusinessSchemaData %}Metadata checklist
The metadata helper accepts frontmatter-like objects:
{% set qa = page | metadataChecklist %}
{% if not qa.ok %}
<pre>{{ qa.warnings | dump }}</pre>
{% endif %}Expected useful fields are title, description, canonical, service, serviceArea, layout, and permalink. The result includes ok, score, missing, warnings, and itemized checks.
Service-area page data
Build a predictable matrix for local landing pages:
{% set matrix = {
services: ["Blocked drains", "Hot water repairs"],
areas: ["Perth", "Fremantle"],
basePath: "/services"
} | serviceAreaPages %}
{% for item in matrix.pages %}
<a href="{{ item.path }}">{{ item.title }}</a>
{% endfor %}The pure helper is usually easier in JavaScript data files:
import { buildServiceAreaPages } from "@a1local/eleventy-adpages";
export default buildServiceAreaPages({
services: ["Blocked drains", "Hot water repairs"],
areas: ["Perth", "Fremantle"],
basePath: "/services",
defaultStatus: "draft"
});API
adpagesEleventy(options?: AdPagesEleventyOptions): EleventyPlugin;
buildLocalBusinessSchemaData(input, options?): LocalBusinessSchemaData;
renderLocalBusinessSchema(input, options?): string;
checkLandingPageMetadata(input, options?): MetadataChecklistResult;
buildServiceAreaPages(input): ServiceAreaPageMatrix;
slugify(value: string): string;Publishing notes
This scaffold is realistic for npm and Eleventy community distribution, but the first public release still needs final package ownership, examples tested in a real Eleventy starter, logo/social preview assets, and a public privacy/support page if it becomes part of a larger AdPages product funnel.
