Skip to content

Instantly share code, notes, and snippets.

View fauzanmy's full-sized avatar
🏠
Working from home

Fauzan My fauzanmy

🏠
Working from home
View GitHub Profile
@fauzanmy
fauzanmy / Hugo respond version in Terminal
Last active September 9, 2022 09:17
Hugo respond version in Terminal
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended darwin/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
@fauzanmy
fauzanmy / hugo version
Last active September 9, 2022 09:18
Checking hugo version
// Check hugo version
hugo version
<?php
/**
* The template for displaying page pagination.
*
* @package WordPress
* @subpackage Pehthemepress
*
*/
?>
@fauzanmy
fauzanmy / hugo-simple-meta-og.html
Last active September 9, 2022 09:17
Hugo create meta opengraph,
<!--Meta:OG-->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@{{.Site.Params.twitter}}" />
<meta property="og:url" content="{{ .Permalink }}" />
<meta property="og:title" content="{{ .Title }}" />
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Params.description }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
<meta property="og:image" content="{{ if .IsPage }}{{ with .Params.images }}{{ . | absURL }}{{ end }}{{ else }}{{ with .Site.Params.cover }}{{ . | absURL }}{{ end }}{{ end }}" />
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
@fauzanmy
fauzanmy / vanilla-js-toggle-sidebar-body-overlay.js
Created January 17, 2021 08:41
Vanilla javascript toggle sidebar body overlay.
<script>
let burger = document.querySelector('.burger');
let close = document.querySelector('.close');
let sidenav = document.querySelector('#sidenav');
let overlay = document.querySelector('#overlay');
let classOpen = [sidenav, overlay];
burger.addEventListener('click', function(e){
classOpen.forEach(e => e.classList.add('active'));
@fauzanmy
fauzanmy / vanilla-js-toggle-sidebar-body-overlay-style.css
Last active January 17, 2021 08:38
CSS Style vanilla javascript toggle sidebar menu with body overlay.
<style>
/*Addtional Style */
#sidenav {
max-height: 100vh;
height: 100vh;
max-width: 70vw;
min-width: 300px;
overflow-x: hidden;
overflow-y: auto;
@fauzanmy
fauzanmy / toggle-vanilla-javascript-style.css
Created January 17, 2021 08:24
Toggle vanilla javascript style
<style>
#sidenav {
max-height: 100vh;
height: 100vh;
max-width: 70vw;
min-width: 300px;
overflow-x: hidden;
overflow-y: auto;
transition: all .3s ease-in-out;
@fauzanmy
fauzanmy / toggle-vanilla-javascript.js
Last active January 17, 2021 08:20
Simple JS toggle sidebar menu
<script>
let burger = document.querySelector('.burger');
let close = document.querySelector('.close');
let sidenav = document.querySelector('#sidenav');
// Burger click function
burger.addEventListener('click', function () {
sidenav.classList.add('active');