Giter Site home page Giter Site logo

pw-us / pw-us.github.io Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mzaini30/mzaini30.github.io

0.0 0.0 0.0 41.9 MB

Website ini berisi dengan berbagai proyek yang telah aku kerjakan.

Home Page: https://pw-us.github.io

HTML 6.29% JavaScript 27.86% Svelte 65.85%

pw-us.github.io's Introduction

Instalasi

npx degit mzaini30/svelte my-project
cd my-project
npm i

Struktur folder

Keterangan Folder
File Svelte src/pages
Static files public/dist
Output public

Fitur

CSS

Menggunakan Bootstrap

Code splitting

Cukup jalankan

npm run build

Router berbasis file

Kita menggunakan Routify.

Hot module reload

Dia nggak mereset state saat kita development. Cukup jalankan:

npm run dev

SEO

Ini isi dari public/index.html:

<!-- 

	Website ini dibuat oleh Zen
	duniazen.com

-->
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset='utf-8'>
	<meta name='viewport' content='width=device-width,initial-scale=1'>

	<title>Svelte Template</title>
	<meta name="description" content="Template Svelte yang diolah oleh Zen">
	<meta property="og:image" content="/dist/jean.jpg">
	<link rel='icon' type='image/png' href='/dist/ungu.png'>

	<link rel='stylesheet' href='/dist/bootstrap/css/bootstrap.min.css'>
	<link rel='stylesheet' href='/bundle.css'>
	<link rel='stylesheet' href='/dist/global.css'>
	<script defer src='/main.js' type="module"></script>
</head>
<body>
</body>
</html>

Nanti tinggal disesuaikan aja tag title, meta description, dan og image.

Loader

Cara menggunakan:

import {isLoading} from '@/store'
$isLoading = true // untuk mengaktifkan loader
$isLoading = false // untuk mematikan loader

Itu harus diletakkan di dalam folder halaman.

Absolute path

Contoh:

import {nama} from '@/data/nama'

Tapi, bisa juga relative path seperti:

import {nama} from '../../../nama'

Tanggal

Mendapatkan tanggal terkini dengan format 2020-08-17 00:19:45

Caranya:

<script>
	import {tanggal} from '@/tools'
</script>
<p>{tanggal()}</p>

Slug

Mendapatkan slug dari string

Caranya:

<script>
	import {slug} from '@/tools'
</script>
<p>{slug('hello world')}</p>
<!-- jadinya: hello-world -->

Acak

Digunakan untuk mengacak array

Caranya:

import {acak} from "@/tools"
let angka = [1, 2, 3, 4, 5]
angka = acak(angka)

Terjemahan?

Boleh. Misalnya aja mau nerjemahkan ke bahasa Jepang, maka buat file README-jp.md yang berisi terjemahan README ini dalam bahasa Jepang.

pw-us.github.io's People

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.