Giter Club home page Giter Club logo

ham's Introduction

HAM: Html As Modules

HAM makes modular HTML development possible. HAM provides a framework and compilier for developing static HTML web pages

HAM CONCEPTS

Layouts

A Layout defines the structure of a web page

<html lang="en">
<head>
     <meta charset="UTF-8">
     <title>HAM</title>
     <link type="ham/layout-css"/>
</head>
<body>

<div id="app-info"></div>
<div class="container">
     <div class="row">
          <embed type="ham/page"/>
     </div>
</div>
<embed type="ham/layout-js"/>
</body>
</html>

Pages

A Page must have a layout. A page gives a layout content

<div class="page"
     data-ham-layout='../layouts/default.html'
     data-ham-layout-css='[
     "../assets/css/base.css",
     "../assets/css/page.css"
     ]'
     data-ham-layout-js='[
     "../assets/js/base.js",
     "../assets/js/page.js"
     ]'
>
  <embed type="ham/partial" src="../partials/header.html"/>
</div>

Partials

Partials are reusable html modules that can be included on a page or layout

<h1>Welcome to HAM</h1>

Final Result

<html lang="en">
<head>
  <meta charset="UTF-8"/>
  <title>HAM</title>
  <link rel="stylesheet" href="../assets/css/base.css?v=202102082042"/>
  <link rel="stylesheet" href="../assets/css/page.css?v=202102082042"/>
</head>
<body>
<div id="app-info"></div>
<div class="container">
  <div class="row">
    <div class="page">
      <h1>Welcome to HAM</h1>
    </div>
  </div>
</div>
<script src="../assets/js/base.js?v=202102082042"></script>
<script src="../assets/js/page.js?v=202102082042"></script>
</body>
</html>

INSTALLING HAM

go install github.com/fobilow/ham/cmd/ham@latest

For specific version, replace @latest with version number

USING HAM

  • ham new [sitename]
  • ham build -w [working dir] -out [output directory]
  • ham serve -w [working dir]
  • ham version
  • ham help

ham's People

Contributors

fobilow avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.