npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

astley.js

v0.0.58

Published

Construct a website from a JSON-LD AST

Downloads

238

Readme

astley.js

Library for rendering a website AST into semantic aware template. Separate the content structure from the template structure to easily transform your website.

Of course building a semantic template is hard but it is much easier to give your site a new look once there is a library of templates. Astley.js comes with a default semantic template, fork to create your own.

AST Definition

The AST is implemented in JSON-LD format. The semantic pug template annotates the compiled template using microdata so any microdata parser can retrieve the AST.

@context for the topmost element is

'@context': 'hanzo.ai/schema'

Website

{
  '@type': 'Website'
  # head - website head, title, description, opengraph
  head: WebsiteHead
  # header - website header, navigation, top menus
  header: WebsiteHeader
  # main - website body, content, etc
  main: [ WebsiteSection ]
  # footer - website footer, navigation
  footer: WebsiteFooter
}

Website root node


WebsiteHeader

{
  '@type': 'WebsiteHeader'
  # type - rendering mode, default template supports 'complex' and 'simple' header menus
  type: string
  # logos - logos to display in the headers
  logos: [ WebsiteLogo ]
  # menuCollections - grouped menus to render in the header, default templates
  # supports 2, the first for the centered menu group, and second for the right
  # menu group
  menuCollections: [ WebsiteMenuCollection ]
}

WebsiteHeader is the top header menu of a webpage


WebsiteLogo

{
  '@type': 'WebsiteLogo'
  # image - logo image url
  image: string
  # alt - logo image alt
  alt: string
  # name - logo text if any
  name: string
  # url - logo url
  url: string
}

WebsiteLogo is an image + text logo


WebSiteMenuCollection

{
  '@type': 'WebsiteMenuCollection'
  // menus - list of WebsiteMenus in group/collection
  menus: [ WebsiteMenu ]
}

WebsiteMenuCollection is a grouped collection of WebsiteMenus for the purposes of organizing related menus


WebSiteMenu

{
  '@type': 'WebsiteMenu'
  # name - menu display name
  name: string
  # description - link description
  type: basic | button
  # url - menu may be a link itself (usually if no child links)
  url: string
  links: [ WebsiteMenuLink ]
}

WebsiteMenu is a menu which may be a link itself or a menu containing links


WebsiteMenuLink

{
  '@type': 'WebsiteMenuLink'
  # name - link display name
  name: string
  # description - link description
  description: string
  # type - type of link supports specific types
  type: basic | button
  # image - link image
  image: string
  # image - link url
  url: string
}

WebsiteMenuLink is a url link with associated image and description


WebsiteSection

{
  '@type': 'WebsiteSection'
  # name - section name
  name: string
  # type - type of section, supports specific types
  type: hero | block | cta
  # class - class names like html tag class
  class: string
  # id - id
  id: string
  # content - list of content
  content: [ WebsiteText | WebsiteImage | WebsiteButton | WebsiteContent ]
}

WebsiteSection containes website primatives


WebsiteContent

{
  '@type': 'WebsiteContent'
  # class - class names like html tag class
  class: string
  # id - id
  id: string
  # content - list of content
  content: [ WebsiteText | WebsiteImage | WebsiteButton | WebsiteContent ]
}

WebsiteContent allows tree-like structuring of data, not necessarily rendered, just organizational. Usually inferred by the content-annotator


WebsiteText

{
  '@type': 'WebsiteText'
  # class - class names like html tag class
  class: string
  # id - id
  id: string
  # text - text
  text: string
  # level - level (h1, h2, h3, h4, p, small)
  level: string
}

WebsiteText primative


WebsiteImage

{
  '@type': 'WebsiteImage'
  # class - class names like html tag class
  class: string
  # id - id
  id: string
  # src - source
  src: string
  # alt - alt text
  alt: string
}

WebsiteImage primative


WebsiteLink

{
  '@type': 'WebsiteLink'
  # class - class names like html tag class
  class: string
  # id - id
  id: string
  # text - link text
  text: string
  # url - link url
  url: string
}

WebsiteLink primative


WebsiteHeader

{
  '@type': 'WebsiteFooter'
  # logos - logos to display in the footers
  logos: [ WebsiteLogo ]
  # menuCollections - grouped menus to render in the footer
  menuCollections: [ WebsiteMenuCollection ]
}

WebsiteFooter is the bottom footer menu of a webpage