hydraline 0.0.4 copy "hydraline: ^0.0.4" to clipboard
hydraline: ^0.0.4 copied to clipboard

Hydraline pure-Dart core: DocumentNode model, single-pass HTML serializer, contextual escaping, SEO metadata, JSON-LD, sitemap/robots and manifests.

hydraline #

Pure-Dart core of Hydraline - the foundation all other packages build on.

What's inside #

Module Description
DocumentNode Sealed immutable tree - headings, paragraphs, links, images, tables, islands
HtmlSerializer Single-pass deterministic HTML serializer (buffered + streaming + fragment)
SafeUrl Type-safe URL validation against a scheme allowlist
SeoMeta Open Graph, Twitter Card, hreflang, canonical, meta tags
JsonLd Type-safe JSON-LD builders (Article, Product, FAQ, BreadcrumbList, …)
Sitemap sitemap.xml generation with defaults + auto-split at 50k URLs
Robots robots.txt generation
RouteManifest hydraline.routes.yaml parser + Dart builder
IslandSpec / IslandStateCodec data-state props contract (JSON-safe, ~10 KB budget)
SsgCollector Widget-to-node registration surface
SeoValidator / Audit SEO validation + crawler-view audit
runAuditCli dart run hydraline:audit - page audit + anti-cloaking check
vanillaIslandsJs Level-1 vanilla islands bundle (≤ 8 KB)
htmxGlueJs HTMX bootstrap glue (< 1 KB)

Rules #

No package:flutter, dart:ui, or dart:html - ever. This package is pure Dart.

Quick start #

import 'package:hydraline/hydraline.dart';

final root = DocumentRootNode(
  head: buildHead(SeoMeta(
    title: 'My Page',
    description: 'A Hydraline-powered page',
    openGraph: OpenGraph(
      title: 'My Page',
      image: SafeUrl.parse('https://example.com/og.png'),
    ),
  )),
  body: [
    HeadingNode(level: 1, children: [TextNode('Welcome')]),
    ParagraphNode(children: [TextNode('This is real HTML from Dart.')]),
  ],
);

const serializer = HtmlSerializer();
print(serializer.serialize(root)); // <!DOCTYPE html><html>...

Runnable example: example/main.dart - document building, streaming, sitemap, robots and validation in one file.

Audit CLI #

dart run hydraline:audit https://example.com            # what a crawler sees
dart run hydraline:audit dist/index.html                # audit a local file
dart run hydraline:audit --server-integration <url>     # anti-cloaking check

Documentation #

  • Document Model - full node hierarchy
  • Configuration - route manifest, sitemap, SEO
  • Security - SafeUrl, escaping, CSP
  • Getting Started - prerequisites, examples

License #

MIT - Yevhen Leonidov

0
likes
0
points
130
downloads

Publisher

verified publisherleonidov.dev

Weekly Downloads

Hydraline pure-Dart core: DocumentNode model, single-pass HTML serializer, contextual escaping, SEO metadata, JSON-LD, sitemap/robots and manifests.

Homepage
Repository (GitHub)
View/report issues

Topics

#seo #ssr #flutter-web #html #prerender

License

unknown (license)

Dependencies

html, yaml

More

Packages that depend on hydraline