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

almost-static-site

v0.1.8

Published

Single page app generator for quick and dirty sites that are almost static. I.e. (M)EAN sites that use static YAML/Markdown files instead of MongoDB as a database.

Downloads

6

Readme

Almost Static Site

Almost Static Site is a static site generator for quick and dirty (M)EAN sites that use static YAML/Markdown files instead of MongoDB as a database. Gulp build converts the YAML files into JSON that are served with Express for the web application. Foundation (SCSS version) is used as the UI framework.

Main Ingredients

  • Node
  • Express
  • Gulp
  • Browserify
  • Angular
  • Foundation
  • SASS
  • YAML
  • Markdown w/ front matter YAML
  • LiveReload

Demo

almost-static-site.khz.fi

Usage

npm install -g gulp
npm install

Build and server are run with default gulp task. The only thing you have to define is the site module to be built. That is done with --site option.

gulp --site example/demo

The server port is configured in the configuration file of the specified site module e.g. example/demo/config.js.

open http://localhost:5000/

You may want to use another configuration. The build will first try to read the option as the path to the configuration file. If that does not work, it will default to using file config.js inside the folder.

gulp --site example/demo/config-production.js

Folder structure

    main            Sources for ASS Main module
    dist            Output directory for generated files and the server root folder
    examples        Sources for demo app modules, e.g. examples/demo

Modules

Main module

Main module takes care of building the page frame and menus and switching content based on user interaction with the menu.

Main module folder structure

    main            Sources
      index.html    Template file for building index.html
      index.js      JavaScript file that defines the main angular module
      css           SASS source files
      controllers   Angular controller source files
      directives    Angular directive source files
      services      Angular service source files
      views         Angular view source files
    dist            Generated files go here when Gulp build is run

Main module DOM Structure

    index.html      Main SPA HTML file. Head content is defined in the
                    site module configuration file.
      #app          App container
        #header     Contains a site specific page
        #menu       Navigation menus are automatically built based
                    on the site spacific pages.
        #content    Contains site specific pages depending on the
                    selected menu item.
        #footer     Contains a site specific page

Site module

Site module is the module that will be written by you, the developer. You can freely decide the folder structure, but the DOM structure is locked except for the specific content areas that will be filled with site data. The visual style of the whole structure can be completely overridden in site module CSS.

All site module content is defined as individual pages. Header is a page, footer is a page and all of the includes in the example/demo are pages. Each YAML and Markdown file inside the site module's pages path (configurable) defines one of these pages. The following configuration parameters can be used.

Page Parameter | Description --------------- | ------------ id | The slug that is used in the url and as a general reference to this page parentId | This page will be a child of the defined page title | Display name of the page isFrontPage | If true, this page will be the front page i.e. displayed when path is empty isNotDisplayedInMenu | If true, this page will not be available in main menu or submenus ord | Numeric order priority of the page, smaller number means higher priority features | Features array contains all the enabled features for the current page content | Main content of the page, only relevant in YAML files, Markdown files define content outside front matter definition block. styles | Styles array contains dynamic styles that are defined in separate SASS files. The default place for those files is api/styles/*.scss. bastards | Bastards array contains extra pages that are added as child pages of this page without modifying their real parentId. This allows linking a page to a multiple container pages. contentFromFile | Load content from a separate file

Feature modules

All specific functionality, apart from the main DOM structure and menus is isolated into feature modules. The generator contains a few basic features, but the idea is that modules filling a site specific purpose can and should be written and used locally.

Feature | Description --------------- | ------------ content | Display page content in the content area, enabled by default toc | Display table of contents on top of the content area submenu | Display child pages of this page in a submenu below the main menu subpages | Include child pages with their own set of features includes | Include the contents of child pages in the content area below this page (with anchors) filter | Like includes, but with tag cloud filter selection menu filter.params | Params array defines the parameters to create tag cloud filters for *.initialLimit | Initial limit of includes, after which new includes are added based on scroll position