Skip to content

Instantly share code, notes, and snippets.

View hibuno's full-sized avatar
🌙
Working at Night

Muhibbudin Suretno hibuno

🌙
Working at Night
View GitHub Profile
@hibuno
hibuno / example-vuemeta.js
Created January 20, 2018 06:27
Example of vue meta
module.exports = {
/*
** Headers of the page
*/
head: {
title: 'example',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: 'Nuxt.js project' },
@hibuno
hibuno / nuxt.config.js
Created January 21, 2018 15:39
Add bootstrap 4 on NuxtJS
...
head: {
title: 'example',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: 'Nuxt.js project' },
// example vue-meta
{ hid: 'title', name: 'title', content: 'Nuxt.js project' }
@hibuno
hibuno / navigation.vue
Last active January 21, 2018 16:15
Example file of navigation.vue using navbar component from bootstrap 4
<template>
<div>
<nav class="navbar navbar-expand-lg">
<div class="container">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
@hibuno
hibuno / blog.vue
Created January 21, 2018 15:49
Next part of blog.vue file from creating page on Nuxt JS
<template>
<div>
<!-- Navigation -->
<Navigation/>
<!-- Content -->
<div class="container">
<div class="row">
<div class="col-md-9 col-lg-9">
<!-- Content -->
<nuxt/>
@hibuno
hibuno / nuxt.config.js
Created January 21, 2018 15:59
Add navigation.scss on nuxt config
...
{ hid: 'title', name: 'title', content: 'Nuxt.js project' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'stylesheet', type: 'text/css', href: 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta.3/css/bootstrap.min.css' }
]
},
/*
** Custom SCSS
@hibuno
hibuno / nuxt.config.js
Created January 21, 2018 16:04
Adding function vue loader
...
/*
** Run ESLint on save
*/
extend (config, ctx) {
if (ctx.isDev && ctx.client) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
@hibuno
hibuno / nuxt.config.js
Created January 21, 2018 16:05
Adding function custom loader options at nuxt config
...
function changeLoaderOptions (loaders) {
if (loaders) {
for (const loader of loaders) {
if (loader.loader === 'sass-loader') {
Object.assign(loader.options, {
includePaths: ['./assets'],
// data: '@import "_imports";'
})
}
@hibuno
hibuno / navigation.scss
Created January 21, 2018 23:59
Code for file navigation.scss
.navbar {
background-color: white;
box-shadow: 0px -9px 20px #000000;
.nav {
&-item {
padding: 0 .5rem;
}
&-link {
padding: 1rem;
@hibuno
hibuno / nuxt.config.js
Created January 22, 2018 00:10
Add new code
...
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'stylesheet', type: 'text/css', href: 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta.3/css/bootstrap.min.css' },
{ rel: 'stylesheet', type: 'text/css', href: 'https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.0.7/css/swiper.css' }
]
...a
@hibuno
hibuno / swiper.js
Created January 22, 2018 00:18
Create instance of swiper plugin
import Vue from 'vue'
import VueAwesomeSwiper from 'vue-awesome-swiper/dist/ssr'
Vue.use(VueAwesomeSwiper)