blogger_theme 3.0.0-alpha.1 copy "blogger_theme: ^3.0.0-alpha.1" to clipboard
blogger_theme: ^3.0.0-alpha.1 copied to clipboard

A lightweight standalone Dart library to design Blogger themes with Jaspr-like syntax.

πŸš€ blogger_theme #

pub package pub points Licence GitHub Issues Sponsor


Declarative Blogger Theme Design in Dart. #

blogger_theme is a lightweight, standalone library that lets you build structured Blogger (Blogspot) themes using a clean, Jaspr-inspired component syntax. Stop wrestling with raw XML and start building themes with the power of Dart.

Note: This library renders your component tree directly into XML. It is not an AST-based parser or transformer.

Caution: This package is currently in alpha, and some features are still experimental.


πŸ›  Features #

  • ✨ Jaspr-inspired Syntax: Build your theme structure using declarative Dart components (Component, DomComponent, Text).
  • πŸ›‘οΈ XML-Safe Rendering: Automatic escaping for &, <, >, ", ' and sanitization of XML 1.0 control characters.
  • πŸš€ Zero Dependencies: Pure Dart implementationβ€”no heavy browser runtime or UI shells required.
  • πŸ“¦ Blogger Native: Pre-built wrappers for standard tags like <b:section>, <b:widget>, <b:loop>, and <b:if>.
  • ⚑ Script Compiler: Compile your Dart logic directly into JavaScript and inject it into your Blogger layouts seamlessly.

πŸ“š Resources #


πŸš€ Quick Start #

Add the package to your pubspec.yaml:

dependencies:
  blogger_theme: ^3.0.0-alpha.1

Note: Because this package uses Dart primary constructors while the feature is still experimental, add the following to your analysis_options.yaml until the feature reaches stable release:

analyzer:
  enable-experiment:
    - primary-constructors

1. Build your Layout #

Create reusable components that map to Blogger elements:

    class BlogLayout extends Component {
      const BlogLayout();

      @override
      Iterable<Component> build() => [
        Div(
          attributes: {'class': 'wrapper-pane'},
          children: [
            BSection(
              id: 'header-area',
              className: 'header-section',
              maxwidgets: 1,
              showaddelement: true,
              children: [
                BWidget(
                  id: 'Header1',
                  type: 'Header',
                  title: 'Blog Header Title',
                  locked: true,
                ),
              ],
            ),
          ],
        ),
      ];
    }

2. Generate XML #

Assemble your theme and export it:

    void main() {
      final theme = BloggerTheme(
        attributes: {'b:responsive': 'true'},
        head: [
          Title(children: [Text('My Custom Theme')]),
          BSkin('body { background: #f4f4f4; }'),
        ],
        body: [const BlogLayout()],
      );

      print(theme.generate());
    }

πŸ— Project Structure #

    src/
    β”œβ”€β”€ core.dart              # Core contracts & renderer
    β”œβ”€β”€ blogger_components.dart # Blogger tag wrappers
    β”œβ”€β”€ html_components.dart    # HTML element helpers
    β”œβ”€β”€ client_script.dart      # Dart-to-JS compilation
    └── theme_utility.dart      # Root generator

🀝 Support & Contribution #

1
likes
0
points
110
downloads

Documentation

Documentation

Publisher

verified publisherhireflutter.uk

Weekly Downloads

A lightweight standalone Dart library to design Blogger themes with Jaspr-like syntax.

Repository (GitHub)
View/report issues

Topics

#html-generation #web #templates #blogger

Funding

Consider supporting this project:

github.com

License

unknown (license)

Dependencies

path

More

Packages that depend on blogger_theme