GithubHelp home page GithubHelp logo

phothinmg / jsr Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 120 KB

Single page web application(SPA) template with HTML , CSS , Js and Markdown

Home Page: https://jsr.pages.dev/

License: MIT License

HTML 12.47% JavaScript 57.70% CSS 29.83%
html-css-javascript markdown spa vite

jsr's Introduction

JSR - SPA Template

License: MIT

jsr

Live Demo : https://jsr.pages.dev/


About

A beginners project for a Vite-Powered single page web application with HTML, CSS, Javascript (Routing, Template literals) and Markdown.


Getting Started

git clone https://github.com/phothinmg/jsr.git
cd jsr
npm install
npm run dev

Web app on :

http://localhost:5173/

Routing

src/router.js

import { home,about } from "../page-blog/pages";
import blog from "../page-blog/blog";
// import yours 

class Router {
//    ***Router code 
}

//  Add your pages and posts 
//  Point yours <a href="/*"></a>
const Pages = {
  "/": new Router(home),
  "/about": new Router(about),
  "/blog/posts": new Router(blog.posts),
  "/blog/postOne": new Router(blog.postOne),
  "/blog/postTwo": new Router(blog.postTwo),
  "/blog/md": new Router(blog.md),
};

Router code are originally from https://github.com/iMykhailychenko/simple-router, edited by me.

Template literals are used to write pages and blog posts.

Pages

page-blog/pages.js

const home = `
<h3>Home</h3>
<p> This is home page</p>
`;

const about = `
<h3>About</h3>
<p> This is about page</p>
`;

// Add more pages and export to router.js
export {home,about}
Blog Posts

page-blog/blog.js

const blog = {
    // Blog home
    posts: `
    <ol>
    <li><a href="/blog/postOne"  accesskey = "p1" >Post One</a></li>
    <li><a href="/blog/postTwo" accesskey = "p2" >Post Two</a></li>
    <li><a href="/blog/md" accesskey = "p3" >Markdown Example Post</a></li>
    </ol>
    
    `,
    // Add posts
    postOne: `
    <h3>Post One</h3>

   `,
    postTwo: `
    <h3>Post Two</h3>

   `,
//    Markdown between <md-block>
    
    md:`
    <md-block>

    Markdown syntax here 
    
    </md-block>
   `,

};
// Export to router.js
export default blog

More information about MD-Block , visit https://md-block.verou.me/

Resources

Deployment

Configuring Vite

https://vitejs.dev/config/ .

Hosting

  1. Cloudflare Pages . Documentation : https://developers.cloudflare.com/pages/get-started/guide/ .

  2. Vercel . Documentation : https://vercel.com/docs/getting-started-with-vercel

  3. Netlify . Documentation : https://docs.netlify.com/

LICENSE

MIT

jsr's People

Contributors

phothinmg avatar dependabot[bot] 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.