Git Product home page Git Product logo

mupjs.github.io's Introduction

mup.js

A simple JS library

What is MUP?

Mup is a simple solution to a simple problem. I wanted a light-JavaScript option for a components library to make better, more powerful websites in an easier, faster, and simple way. Mup - Multi-Page - works by rendering with JavaScript and adds minimal load times. I made Mup because I didn't need complex, powerful tools. Just something I can make a navigation bar and footer component with, and have everything else be customizable. It just makes life easier for smaller front-end websites.

Is Mup super simple? Yes, but I needed something simple and without too many unwanted features. Mup is specifically designed for GitHub Pages front-end only websites that have an ever-growing number of pages with components that need to exist on most if not all pages.

How to use Mup?

Start by defining a component file. For example /components/Hello.mup. The file exension MUST end in .mup for Mup to work properly. In that file, add your HTML:

<p>Hello</p>

Next in the config file (mup.conf.js), add your Mup file:

export let Components = [
    "/components/Hello.mup"
]

Since it's a simple array, you can add as many as you want and Mup will automagically run it. Now onto your HTML file. Import the module using <script src="/mup.js" type="module"></script> to the bottom of your <body>, and it will automatically grab your config file.

Now make a div with the ID of your component, for example <div id="Hello"></div>, and it Mup will display the HTML.

Your HTML should look like this:

<!DOCTYPE html>
<html>
    <head>
        <title>Mup Test</title>
    </head>
    <body>
        <div id="Hello"></div>

        <script src="/mup.js" type="module"></script>
    </body>
</html>

mupjs.github.io's People

Contributors

loralighte 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.