<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mastering &#8211; Best DevOps</title>
	<atom:link href="https://www.bestdevops.com/tag/mastering/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.bestdevops.com</link>
	<description>Lets Learn, Do it &#38; Share! Thats a Best DevOps!!!</description>
	<lastBuildDate>Fri, 06 Jun 2025 05:53:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.2</generator>
	<item>
		<title>Mastering mod_rewrite: A Complete Guide to URL Rewriting in Apache</title>
		<link>https://www.bestdevops.com/mastering-mod_rewrite-a-complete-guide-to-url-rewriting-in-apache/</link>
					<comments>https://www.bestdevops.com/mastering-mod_rewrite-a-complete-guide-to-url-rewriting-in-apache/#respond</comments>
		
		<dc:creator><![CDATA[vijay1 vijay1]]></dc:creator>
		<pubDate>Mon, 02 Jun 2025 17:52:00 +0000</pubDate>
				<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Complete]]></category>
		<category><![CDATA[Guide]]></category>
		<category><![CDATA[Mastering]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[URLRewriting]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=31525</guid>

					<description><![CDATA[What is mod_rewrite? mod_rewrite is a powerful and flexible URL rewriting module used in the Apache HTTP Server. It allows [&#8230;]]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="683" src="https://www.bestdevops.com/wp-content/uploads/2025/06/image-25-1024x683.png" alt="" class="wp-image-31532" srcset="https://www.bestdevops.com/wp-content/uploads/2025/06/image-25-1024x683.png 1024w, https://www.bestdevops.com/wp-content/uploads/2025/06/image-25-300x200.png 300w, https://www.bestdevops.com/wp-content/uploads/2025/06/image-25-768x512.png 768w, https://www.bestdevops.com/wp-content/uploads/2025/06/image-25.png 1536w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><strong>What is mod_rewrite?</strong></h3>



<p class="wp-block-paragraph"><code>mod_rewrite</code> is a powerful and flexible URL rewriting module used in the <strong>Apache HTTP Server</strong>. It allows web administrators and developers to rewrite URLs in a dynamic and configurable way, either for SEO (Search Engine Optimization) purposes, to improve user experience, or to provide enhanced security. The module works by intercepting HTTP requests and modifying the URL before passing the request to the appropriate handler.</p>



<p class="wp-block-paragraph">In essence, <code>mod_rewrite</code> provides a means of changing the way URLs are processed, allowing developers to map different URLs to different files on the server. For example, it can help to rewrite complex URLs into simpler, more readable formats, or it can be used to perform redirects from old URLs to new ones.</p>



<p class="wp-block-paragraph">A typical use case of <code>mod_rewrite</code> is when a website structure changes, and old URLs need to be redirected to new ones to avoid broken links or 404 errors. It can also be used to implement friendly URLs that are more readable and more likely to rank well in search engines.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><strong>What are the Major Use Cases of mod_rewrite?</strong></h3>



<ol class="wp-block-list">
<li><strong>URL Redirection</strong>:
<ul class="wp-block-list">
<li>One of the most common use cases of <code>mod_rewrite</code> is redirecting old URLs to new ones. When website structures change, or content is moved to a different location, <code>mod_rewrite</code> can be used to ensure that users are automatically redirected to the correct page without encountering a 404 error.</li>



<li>For example, if a page URL changes from <code>/old-page</code> to <code>/new-page</code>, a simple redirect rule can be applied: <code>RewriteEngine On RewriteRule ^old-page$ /new-page [R=301,L]</code> This rule ensures that anyone visiting <code>/old-page</code> will be redirected to <code>/new-page</code> with a 301 (permanent) redirect.</li>
</ul>
</li>



<li><strong>SEO-Friendly URLs</strong>:
<ul class="wp-block-list">
<li>SEO-friendly URLs are easier for both search engines and users to understand. <code>mod_rewrite</code> is often used to convert long or complex URLs into shorter, more meaningful ones that include relevant keywords.</li>



<li>For example, a dynamic URL like <code>example.com/products.php?id=123</code> can be rewritten to <code>example.com/products/123</code>, making it cleaner and more user-friendly: <code>RewriteEngine On RewriteRule ^products/([0-9]+)$ /products.php?id=$1 [L]</code></li>
</ul>
</li>



<li><strong>Security Measures</strong>:
<ul class="wp-block-list">
<li><code>mod_rewrite</code> can also be used to enhance security by blocking access to certain parts of a website or server. For example, you can prevent access to sensitive files by checking for certain conditions, such as whether the request is coming from a specific IP address or whether the user is authenticated.</li>



<li>A common security measure is to block access to hidden files or directories (those starting with a dot, like <code>.htaccess</code> or <code>.git</code>): <code>RewriteEngine On RewriteRule ^\.git - [F]</code></li>
</ul>
</li>



<li><strong>Redirect HTTP to HTTPS</strong>:
<ul class="wp-block-list">
<li>Another popular use case for <code>mod_rewrite</code> is ensuring that all traffic to a website is served over HTTPS. This is important for security, as HTTPS encrypts the communication between the user&#8217;s browser and the server.</li>



<li>A common rewrite rule for redirecting all HTTP traffic to HTTPS is: <code>RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]</code></li>
</ul>
</li>



<li><strong>Prevent Hotlinking</strong>:
<ul class="wp-block-list">
<li><code>mod_rewrite</code> can be used to prevent hotlinking, which occurs when other websites link directly to your images or media files, using up your bandwidth.</li>



<li>To prevent hotlinking, you can create a rewrite rule that only allows images to be served from your domain: <code>RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain\.com [NC] RewriteRule \.(jpg|jpeg|png|gif)$ - [F]</code></li>
</ul>
</li>
</ol>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><strong>How mod_rewrite Works Along with Architecture?</strong></h3>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="683" src="https://www.bestdevops.com/wp-content/uploads/2025/06/image-26-1024x683.png" alt="" class="wp-image-31533" srcset="https://www.bestdevops.com/wp-content/uploads/2025/06/image-26-1024x683.png 1024w, https://www.bestdevops.com/wp-content/uploads/2025/06/image-26-300x200.png 300w, https://www.bestdevops.com/wp-content/uploads/2025/06/image-26-768x512.png 768w, https://www.bestdevops.com/wp-content/uploads/2025/06/image-26.png 1536w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"><code>mod_rewrite</code> works within the Apache HTTP Server as a module that hooks into the request handling process. When a request is received by Apache, <code>mod_rewrite</code> intercepts the request and evaluates any applicable rules defined in <code>.htaccess</code> files or in the main server configuration.</p>



<p class="wp-block-paragraph">Here’s a breakdown of how <code>mod_rewrite</code> fits into the architecture of Apache:</p>



<ol class="wp-block-list">
<li><strong>Rewrite Engine Activation</strong>:
<ul class="wp-block-list">
<li>The <code>RewriteEngine On</code> directive activates the rewrite engine. Without this directive, no rules will be processed.</li>



<li>The rewrite engine runs before Apache serves the content, giving it the opportunity to modify the URL as needed.</li>
</ul>
</li>



<li><strong>Rewrite Conditions (RewriteCond)</strong>:
<ul class="wp-block-list">
<li>Rewrite conditions are used to define prerequisites that must be met before a <code>RewriteRule</code> is applied. Conditions can be based on various server variables, including the HTTP request, headers, or environment variables.</li>



<li>For example, you can use <code>RewriteCond</code> to check whether the request is made over HTTP or HTTPS and apply a rule accordingly: <code>RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]</code></li>
</ul>
</li>



<li><strong>Rewrite Rules (RewriteRule)</strong>:
<ul class="wp-block-list">
<li><code>RewriteRule</code> is the directive that defines how a URL is rewritten. A typical rule consists of a pattern (which can include regular expressions) and a substitution (the new URL or path).</li>



<li>The <code>[L]</code> flag indicates that no further rules should be processed if this rule matches, while the <code>[R]</code> flag is used for redirection. You can also use <code>[NC]</code> for case-insensitive matching.</li>
</ul>
</li>



<li><strong>Processing Flow</strong>:
<ul class="wp-block-list">
<li>When a request is made, the server first checks the URL against all defined <code>RewriteCond</code> conditions. If any of the conditions are met, the server then applies the corresponding <code>RewriteRule</code>.</li>



<li>If the rule results in a redirection, the server sends the appropriate HTTP status code (e.g., 301 for permanent redirects). If a rule modifies the URL without redirecting, the server proceeds with the request as if the new URL was originally requested.</li>
</ul>
</li>
</ol>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><strong>What are the Basic Workflows of mod_rewrite?</strong></h3>



<p class="wp-block-paragraph">The basic workflow of <code>mod_rewrite</code> involves several steps in the request handling process. Here’s a simplified flow of how <code>mod_rewrite</code> operates:</p>



<ol class="wp-block-list">
<li><strong>Request Received</strong>:
<ul class="wp-block-list">
<li>Apache receives an HTTP request for a specific URL.</li>
</ul>
</li>



<li><strong>Rewrite Engine Activation</strong>:
<ul class="wp-block-list">
<li>If <code>RewriteEngine On</code> is set, <code>mod_rewrite</code> is activated and begins processing the request.</li>
</ul>
</li>



<li><strong>Check Rewrite Conditions</strong>:
<ul class="wp-block-list">
<li>The server evaluates the conditions defined in <code>RewriteCond</code>. These conditions can be based on the HTTP request, the user&#8217;s IP address, or other criteria.</li>



<li>If no conditions are specified, the rule is applied immediately.</li>
</ul>
</li>



<li><strong>Apply Rewrite Rules</strong>:
<ul class="wp-block-list">
<li>The server processes the <code>RewriteRule</code> directives and checks if the request URL matches any defined patterns (using regular expressions).</li>



<li>If a match is found, the rule is applied, either rewriting the URL or redirecting the request to a new URL.</li>
</ul>
</li>



<li><strong>Redirect or Internal Rewriting</strong>:
<ul class="wp-block-list">
<li>If a rule causes a redirect (using the <code>[R]</code> flag), Apache sends the appropriate HTTP status code (e.g., 301 for permanent redirects).</li>



<li>If the rule performs internal URL rewriting (using the <code>[L]</code> flag), Apache processes the request as though the rewritten URL was the original request.</li>
</ul>
</li>



<li><strong>Final Processing</strong>:
<ul class="wp-block-list">
<li>Once all applicable rules are processed, the request continues to be handled by Apache, which serves the requested content or invokes the appropriate application or handler.</li>
</ul>
</li>
</ol>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><strong>Step-by-Step Getting Started Guide for mod_rewrite</strong></h3>



<p class="wp-block-paragraph">Here’s a step-by-step guide to get started with <code>mod_rewrite</code> in Apache.</p>



<h4 class="wp-block-heading"><strong>Step 1: Enable mod_rewrite Module</strong></h4>



<p class="wp-block-paragraph">The <code>mod_rewrite</code> module is usually enabled by default in Apache. However, if it’s not enabled, you can enable it by running the following command (on Ubuntu/Debian systems):</p>


<pre class="wp-block-code"><span><code class="hljs">sudo a2enmod rewrite
sudo systemctl restart apache2
</code></span></pre>


<h4 class="wp-block-heading"><strong>Step 2: Enable <code>.htaccess</code> File Usage</strong></h4>



<p class="wp-block-paragraph">If you want to use <code>.htaccess</code> files for URL rewriting, you need to ensure that Apache is configured to allow overrides. Open your Apache configuration file (<code>httpd.conf</code> or <code>apache2.conf</code>), and ensure the following is set:</p>


<pre class="wp-block-code"><span><code class="hljs language-xml"><span class="hljs-tag">&lt;<span class="hljs-name">Directory</span> /<span class="hljs-attr">var</span>/<span class="hljs-attr">www</span>/<span class="hljs-attr">html</span>&gt;</span>
    AllowOverride All
<span class="hljs-tag">&lt;/<span class="hljs-name">Directory</span>&gt;</span>
</code></span></pre>


<p class="wp-block-paragraph">Restart Apache:</p>


<pre class="wp-block-code"><span><code class="hljs">sudo systemctl restart apache2
</code></span></pre>


<h4 class="wp-block-heading"><strong>Step 3: Create or Edit <code>.htaccess</code> File</strong></h4>



<p class="wp-block-paragraph">Create or edit the <code>.htaccess</code> file in the root directory of your website. Here’s an example of how to enable <code>mod_rewrite</code> and create basic URL rewriting rules:</p>


<pre class="wp-block-code"><span><code class="hljs">RewriteEngine On
RewriteRule ^about$ /about-us &#91;R=301,L]
</code></span></pre>


<p class="wp-block-paragraph">This rule redirects <code>/about</code> to <code>/about-us</code> with a 301 permanent redirect.</p>



<h4 class="wp-block-heading"><strong>Step 4: Test Your Rewrite Rules</strong></h4>



<p class="wp-block-paragraph">Once you’ve added or modified rules in your <code>.htaccess</code> file, test the website to ensure that the rewriting works as expected. Try visiting the old URLs or the rewritten URLs to see if the redirects or rewrites are functioning properly.</p>



<h4 class="wp-block-heading"><strong>Step 5: Troubleshooting</strong></h4>



<p class="wp-block-paragraph">If the rewrite rules aren’t working, check the following:</p>



<ul class="wp-block-list">
<li>Ensure that the <code>.htaccess</code> file is located in the correct directory (typically the root of your website).</li>



<li>Verify that <code>mod_rewrite</code> is enabled.</li>



<li>Check Apache’s error logs for any issues related to URL rewriting.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.bestdevops.com/mastering-mod_rewrite-a-complete-guide-to-url-rewriting-in-apache/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Mastering GLightbox: A Complete Beginner-to-Advanced Guide</title>
		<link>https://www.bestdevops.com/mastering-glightbox-a-complete-beginner-to-advanced-guide/</link>
					<comments>https://www.bestdevops.com/mastering-glightbox-a-complete-beginner-to-advanced-guide/#respond</comments>
		
		<dc:creator><![CDATA[vijay1 vijay1]]></dc:creator>
		<pubDate>Tue, 22 Apr 2025 05:46:32 +0000</pubDate>
				<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Advanced]]></category>
		<category><![CDATA[Beginners]]></category>
		<category><![CDATA[Complete]]></category>
		<category><![CDATA[Guide]]></category>
		<category><![CDATA[Mastering]]></category>
		<guid isPermaLink="false">https://www.bestdevops.com/?p=30930</guid>

					<description><![CDATA[GLightbox is one of the most elegant, lightweight, and powerful JavaScript lightbox libraries used by modern developers. Whether you&#8217;re a [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">GLightbox is one of the most elegant, lightweight, and powerful JavaScript lightbox libraries used by modern developers. Whether you&#8217;re a complete beginner looking to add image modals to your project or an advanced developer aiming for deep customization, this guide walks you through everything — <strong>from getting started to mastering advanced features.</strong></p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><strong>1. What is GLightbox?</strong></h2>



<p class="wp-block-paragraph">GLightbox is a powerful, dependency-free JavaScript lightbox library designed to enhance the way media content—such as images, videos, iframes, and inline HTML—is presented on the web. It provides a lightweight and elegant modal overlay interface that is both touch-friendly and responsive, adapting beautifully to desktop and mobile screens.</p>



<p class="wp-block-paragraph">Unlike older lightbox solutions which relied heavily on jQuery or large third-party libraries, GLightbox is modern, efficient, and built with ES6 JavaScript and CSS3 transitions. It supports image galleries, video players (including YouTube, Vimeo, and self-hosted videos), inline HTML content, and more.</p>



<p class="wp-block-paragraph">GLightbox aims to create a smooth and engaging user experience through animated transitions, fullscreen support, and rich media rendering—all while being easy to integrate and customize.</p>



<p class="wp-block-paragraph"><strong>Key Features:</strong></p>



<ul class="wp-block-list">
<li>No jQuery dependency</li>



<li>Touch navigation &amp; mobile responsiveness</li>



<li>Supports multiple media types</li>



<li>Captions, descriptions, and titles</li>



<li>Deep linking &amp; fullscreen support</li>



<li>Fully customizable with APIs</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><strong>2. Major Use Cases of GLightbox</strong></h2>



<p class="wp-block-paragraph">GLightbox finds application in various website types and industries, thanks to its adaptability and simplicity. Here are some common and impactful use cases:</p>



<h3 class="wp-block-heading"><strong>A. Photography Portfolios &amp; Galleries</strong></h3>



<p class="wp-block-paragraph">Professional photographers and artists use GLightbox to present their work elegantly. Users can navigate through photo collections with smooth transitions and responsive layouts.</p>



<h3 class="wp-block-heading"><strong>B. Product Image Viewers in E-Commerce</strong></h3>



<p class="wp-block-paragraph">Online retailers utilize GLightbox to allow users to view product images in detail, zoom in, and toggle through variations (colors, angles) within a modal window.</p>



<h3 class="wp-block-heading"><strong>C. Video Demonstrations &amp; Walkthroughs</strong></h3>



<p class="wp-block-paragraph">Whether it&#8217;s a SaaS platform showing off product features or an e-learning platform presenting tutorials, GLightbox helps embed YouTube/Vimeo/MP4 videos beautifully in a popup modal.</p>



<h3 class="wp-block-heading"><strong>D. Blog Content Enhancers</strong></h3>



<p class="wp-block-paragraph">Content-heavy websites and blogs can embed inline HTML content or display high-resolution images without taking users away from the article.</p>



<h3 class="wp-block-heading"><strong>E. Marketing &amp; Landing Pages</strong></h3>



<p class="wp-block-paragraph">On marketing websites, a well-placed call-to-action can trigger a video popup or testimonial slider via GLightbox, improving user engagement and conversions.</p>



<h3 class="wp-block-heading"><strong>F. Documentation &amp; Tech Portals</strong></h3>



<p class="wp-block-paragraph">When showcasing screenshots, charts, or UI/UX mockups in documentation, GLightbox allows these elements to be displayed cleanly, enhancing readability and focus.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><strong>3. How GLightbox Works – Architecture Overview</strong></h2>



<p class="wp-block-paragraph">GLightbox is structured with modular components that work in harmony to load and display different types of content dynamically. Below is a breakdown of its architecture and internal working.</p>



<h3 class="wp-block-heading"><strong>A. Component Architecture</strong></h3>



<h4 class="wp-block-heading"><strong>i. Core Controller</strong></h4>



<p class="wp-block-paragraph">The controller initializes the lightbox, handles global configurations, and manages lifecycle events like <code>open</code>, <code>close</code>, <code>next</code>, and <code>prev</code>. It’s responsible for binding elements with the <code>.glightbox</code> class and initializing gallery groups.</p>



<h4 class="wp-block-heading"><strong>ii. Media Parser &amp; Adapter</strong></h4>



<p class="wp-block-paragraph">The media adapter is responsible for detecting the content type (e.g., <code>image</code>, <code>video</code>, <code>iframe</code>) from the <code>href</code> or <code>data-type</code> attribute. Based on the type, it loads and renders the correct player or display module.</p>



<h4 class="wp-block-heading"><strong>iii. Slide Renderer</strong></h4>



<p class="wp-block-paragraph">Each media file is treated as a “slide.” The renderer creates slides with appropriate wrappers, captions, buttons, and interactive controls like navigation arrows.</p>



<h4 class="wp-block-heading"><strong>iv. UI Layer &amp; Event Manager</strong></h4>



<p class="wp-block-paragraph">Handles the overlay, animations, close button, fullscreen toggle, keyboard bindings (ESC to close, arrow keys to navigate), and swipe gestures on mobile devices.</p>



<h4 class="wp-block-heading"><strong>v. Plugins (Optional)</strong></h4>



<p class="wp-block-paragraph">GLightbox supports Plyr.js integration for advanced video playback controls and allows developers to hook into its lifecycle with callbacks.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><strong>4. Basic Workflow of GLightbox</strong></h2>



<p class="wp-block-paragraph">Below is a step-by-step logical workflow showing how GLightbox operates once initialized:</p>



<h3 class="wp-block-heading"><strong>Step 1: Initialization</strong></h3>



<p class="wp-block-paragraph">You include the GLightbox CSS and JS in your HTML file, and instantiate it using:</p>


<pre class="wp-block-code"><span><code class="hljs language-javascript"><span class="hljs-keyword">const</span> lightbox = GLightbox();
</code></span></pre>


<h3 class="wp-block-heading"><strong>Step 2: Event Binding</strong></h3>



<p class="wp-block-paragraph">GLightbox scans the DOM for elements with the <code>glightbox</code> class and attaches click events to them.</p>



<h3 class="wp-block-heading"><strong>Step 3: Trigger &amp; Content Loading</strong></h3>



<p class="wp-block-paragraph">When a bound element is clicked, the content is fetched. GLightbox determines the type (image, video, iframe) and loads it in a structured overlay modal.</p>



<h3 class="wp-block-heading"><strong>Step 4: Slide Rendering</strong></h3>



<p class="wp-block-paragraph">The lightbox modal is generated dynamically. Captions, navigation buttons, and loaders are rendered based on configuration.</p>



<h3 class="wp-block-heading"><strong>Step 5: Navigation &amp; Interaction</strong></h3>



<p class="wp-block-paragraph">Users can navigate between grouped items using arrows, swipes, or keyboard. The library preloads adjacent slides for performance.</p>



<h3 class="wp-block-heading"><strong>Step 6: Cleanup</strong></h3>



<p class="wp-block-paragraph">On closing, the modal is removed from the DOM and memory is cleared. Developers can trigger custom logic on close using callback events.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><strong>5. Step-by-Step Getting Started Guide for GLightbox</strong></h2>



<h3 class="wp-block-heading"><strong>Step 1: Include Required Assets</strong></h3>



<p class="wp-block-paragraph">Use a CDN for ease or host files locally.</p>


<pre class="wp-block-code"><span><code class="hljs language-xml"><span class="hljs-comment">&lt;!-- GLightbox CSS --&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/glightbox/dist/css/glightbox.min.css"</span> /&gt;</span>

<span class="hljs-comment">&lt;!-- GLightbox JS --&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/glightbox/dist/js/glightbox.min.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
</code></span></pre>


<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><strong>Step 2: Add Markup to Your HTML</strong></h3>



<p class="wp-block-paragraph">Create anchor elements or buttons with the class <code>glightbox</code> and a valid media URL.</p>


<pre class="wp-block-code"><span><code class="hljs language-xml"><span class="hljs-comment">&lt;!-- Image Example --&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"images/photo.jpg"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"glightbox"</span> <span class="hljs-attr">data-title</span>=<span class="hljs-string">"Beautiful View"</span> <span class="hljs-attr">data-description</span>=<span class="hljs-string">"Taken from the Alps."</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"images/thumb.jpg"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">"Thumbnail"</span> /&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>

<span class="hljs-comment">&lt;!-- YouTube Video --&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"https://www.youtube.com/watch?v=XYZ"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"glightbox"</span>&gt;</span>Watch Video<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
</code></span></pre>


<p class="wp-block-paragraph">You can also use <code>data-gallery="group1"</code> for grouping multiple items.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><strong>Step 3: Initialize the Lightbox in JavaScript</strong></h3>


<pre class="wp-block-code"><span><code class="hljs language-javascript"><span class="hljs-keyword">const</span> lightbox = GLightbox({
  <span class="hljs-attr">selector</span>: <span class="hljs-string">'.glightbox'</span>,
  <span class="hljs-attr">touchNavigation</span>: <span class="hljs-literal">true</span>,
  <span class="hljs-attr">loop</span>: <span class="hljs-literal">true</span>,
  <span class="hljs-attr">zoomable</span>: <span class="hljs-literal">true</span>,
  <span class="hljs-attr">autoplayVideos</span>: <span class="hljs-literal">true</span>
});
</code></span></pre>


<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><strong>Step 4: Advanced Customization</strong></h3>



<p class="wp-block-paragraph">Customize your GLightbox instance for better branding and behavior.</p>


<pre class="wp-block-code"><span><code class="hljs language-javascript"><span class="hljs-keyword">const</span> lightbox = GLightbox({
  <span class="hljs-attr">openEffect</span>: <span class="hljs-string">'fade'</span>,
  <span class="hljs-attr">closeEffect</span>: <span class="hljs-string">'zoom'</span>,
  <span class="hljs-attr">slideEffect</span>: <span class="hljs-string">'slide'</span>,
  <span class="hljs-attr">skin</span>: <span class="hljs-string">'clean'</span>,
  <span class="hljs-attr">plyr</span>: {
    <span class="hljs-attr">css</span>: <span class="hljs-string">'https://cdn.plyr.io/3.6.2/plyr.css'</span>,
    <span class="hljs-attr">js</span>: <span class="hljs-string">'https://cdn.plyr.io/3.6.2/plyr.js'</span>,
    <span class="hljs-attr">config</span>: {
      <span class="hljs-attr">ratio</span>: <span class="hljs-string">'16:9'</span>,
      <span class="hljs-attr">autoplay</span>: <span class="hljs-literal">true</span>
    }
  }
});
</code></span></pre>


<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><strong>Step 5: Event Listeners and API Use</strong></h3>



<p class="wp-block-paragraph">You can access methods like:</p>


<pre class="wp-block-code"><span><code class="hljs language-css"><span class="hljs-selector-tag">lightbox</span><span class="hljs-selector-class">.nextSlide</span>();
<span class="hljs-selector-tag">lightbox</span><span class="hljs-selector-class">.prevSlide</span>();
<span class="hljs-selector-tag">lightbox</span><span class="hljs-selector-class">.close</span>();
</code></span></pre>


<p class="wp-block-paragraph">And listen for events:</p>


<pre class="wp-block-code"><span><code class="hljs language-javascript">lightbox.on(<span class="hljs-string">'open'</span>, () =&gt; <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'Lightbox opened!'</span>));</code></span></pre>

<pre class="wp-block-code"><span><code class="hljs language-javascript">lightbox.on(<span class="hljs-string">'open'</span>, () =&gt; <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'Lightbox opened!'</span>));

</code></span></pre>


<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.bestdevops.com/mastering-glightbox-a-complete-beginner-to-advanced-guide/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Start a Developer Career By Mastering Git And GitHub</title>
		<link>https://www.bestdevops.com/start-a-developer-career-by-mastering-git-and-github/</link>
					<comments>https://www.bestdevops.com/start-a-developer-career-by-mastering-git-and-github/#respond</comments>
		
		<dc:creator><![CDATA[anil]]></dc:creator>
		<pubDate>Fri, 02 Apr 2021 05:52:29 +0000</pubDate>
				<category><![CDATA[GitHub]]></category>
		<category><![CDATA[Career]]></category>
		<category><![CDATA[Developer]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Mastering]]></category>
		<guid isPermaLink="false">http://www.bestdevops.com/?p=16105</guid>

					<description><![CDATA[Source:-https://www.extremetech.com/ Ready to start a brand new career path? Whether you lost your job during the COVID-19 pandemic or you’re [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Source:-https://www.extremetech.com/</p>
<p>Ready to start a brand new career path? Whether you lost your job during the COVID-19 pandemic or you’re just hoping to make a big change in 2021, if you’ve been thinking about transitioning into a developer career The Complete Git and GitHub for Beginners Bootcamp Bundle can help. The three courses included would typically set you back $600, but they’re available now in this bundle for 95 percent off at just $24.99.</p>
<p>You can master the essentials and tricky parts of Git and GitHub from the comfort of your couch with The Complete Git and GitHub for Beginners Bootcamp Bundle. Web developer and coding instructor Kalob Taulien, an instructor with a 4.6 out of 5 star rating who has over two decades of experience developing websites and working with startups, will walk you through the first course that’s included, Git Essentials: The Step-by-Step Guide to Git and GitHub Mastery. This 4.6 out of 5 star course will school you on the daily git workflow that all big developers use, teaching you how to create and use a remote repository, learn staging, committing and pushing files and resolve rebase conflicts and learn how to rebase on GitHub.</p>
<p>Shubham Sarda, a developer and digital marketer with a 4.3 out of 5 star rating, is the next instructor included in the bundle, teaching you the course Git and Github for Beginners: Practical Bootcamp. Learn hands-on, practical ways to work with Git and GitHub with Git Commands, Collaboration, Cheat-Sheet and more within this hour of instruction in this 4.2 out of 5 star course. And finally, the 4.4 out of 5 star rated Zenva Academy will walk you through the last course, Git and GitHub Version Control and Collaboration. This class will teach you about the uses of version control and how to use Git commands to change a project’s ecosystem.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.bestdevops.com/start-a-developer-career-by-mastering-git-and-github/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
