An open API service indexing awesome lists of open source software.

https://github.com/lasso-js/lasso-marko-taglib

A taglib to use Marko with Lasso
https://github.com/lasso-js/lasso-marko-taglib

Last synced: 4 months ago
JSON representation

A taglib to use Marko with Lasso

Awesome Lists containing this project

README

          

Lasso.js Taglib for Marko
==========================

The [Lasso.js](README.md) includes a taglib for Marko for easily injecting `` and `<link>` tags into a page, as well as resource URLs for images and other types of front-end resources.

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
# Table of Contents

- [Example](#example)
- [Tags](#tags)
- [`<lasso-page>`](#lasso-page)
- [`<lasso-head>`](#lasso-head)
- [`<lasso-body>`](#lasso-body)
- [`<lasso-img>`](#lasso-img)
- [`<lasso-resource>`](#lasso-resource)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Installation

In order to automatically detect and compile required `*.marko` templates we
will need to install the [lasso-marko](https://github.com/lasso-js/lasso-marko)
plugin and [lasso-marko-taglib](https://github.com/lasso-js/lasso-marko-taglib)
taglib using the following commands:

```bash
npm install lasso-marko
npm install @lasso/marko-taglib
```

# Example Template

```html
<lasso-page name="my-page" package-path="./browser.json"/>

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test Page</title>
<lasso-head/>
</head>
<body>
<h1>Test Page</h1>
<lasso-body/>
</body>
</html>
```

Output HTML will be similar to the following:

```html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test Page</title>
<link rel="stylesheet" type="text/css" href="/static/my-page-85e3288e.css">
</head>
<body>
<h1>Test Page</h1>
<script type="text/javascript" src="/static/bundle1-6df28666.js">