<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Naina Gurung on Medium]]></title>
        <description><![CDATA[Stories by Naina Gurung on Medium]]></description>
        <link>https://medium.com/@nainagurung?source=rss-6dcd4f22dbb6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*w4F71F1BWz1B8ktd</url>
            <title>Stories by Naina Gurung on Medium</title>
            <link>https://medium.com/@nainagurung?source=rss-6dcd4f22dbb6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 05:52:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nainagurung/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[SparkLens: A Profiling tool for Spark Optimization]]></title>
            <link>https://nainagurung.medium.com/sparklens-a-profiling-tool-for-spark-optimization-ad8a8df9530c?source=rss-6dcd4f22dbb6------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad8a8df9530c</guid>
            <category><![CDATA[report]]></category>
            <category><![CDATA[spark]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[tuning-tools]]></category>
            <category><![CDATA[performance]]></category>
            <dc:creator><![CDATA[Naina Gurung]]></dc:creator>
            <pubDate>Fri, 09 Jul 2021 11:25:46 GMT</pubDate>
            <atom:updated>2021-07-09T15:35:25.736Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XdwuH6HUPeLGXNwwRxYXZA.png" /></figure><p>SparkLens is an open source Spark profiling tool from Qubole which helps in tuning spark applications. It provides a whole report on the compute resources, wastage, data skewness, number of tasks and helps in identifying opportunities in performance optimization.</p><p>It also has a built-in scheduler simulator which can predict how a given spark application will run on any number of executors in a single run.</p><p>After referring a number of documentations, blogs, GitHub and videos, I was able to understand the SparkLens metrics which helped in reducing the Application run time.</p><p>In this blog, I will talk about how I went about configuring SparkLens, the issues I faced, how to generate insights from the measurement metrics of the report, and the configurations to be added to tune your code.</p><h3><strong>How To Configure SparkLens ?</strong></h3><ol><li>Add below conf to spark-submit or spark-shell</li></ol><p>You can clone the project <a href="https://github.com/qubole/sparklens">SparkLens</a> and generate the jar. You will find the SparkLens jar in the target/scala-2.11 directory</p><pre>--jars sparklens-assembly-0.3.2.jar \<br>--conf spark.extraListeners=com.qubole.sparklens.QuboleJobListener \</pre><p>2. SparkLens generate a console based report and a UI based report.</p><p>A spark JSON file is also generated as a part of running the job which can be found in /tmp/sparklens in HDFS location .</p><p>This JSON file can be manually uploaded to <a href="http://sparklens.qubole.com/">SparkLens</a> to view the UI based report.</p><p>3. To get the UI based report through email, use the below conf in spark-submit</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*65ZgMdJ5xUaQMqKB1VrO_A.png" /></figure><h3>Issues faced-</h3><ol><li>When the <a href="http://sparklens.qubole.com/">SparkLens</a> was down, reports could not be generated.</li></ol><p>Issue had been raised in <a href="https://github.com/qubole/sparklens">Sparklens GitHub</a> —</p><blockquote>Currently the website is working</blockquote><p><a href="https://github.com/qubole/sparklens/issues/66">sparkles.qubole.com gets timed out and does not open. Not able to upload sparklers JSON file · Issue #66 · qubole/sparklens</a></p><p>2. Email generation feature does not work with the SparkLens jar present in maven — <a href="https://mvnrepository.com/artifact/qubole/sparklens/0.3.2-s_2.11">https://mvnrepository.com/artifact/qubole/sparklens/0.3.2-s_2.11</a></p><p>The jar can be locally generated through <a href="https://github.com/qubole/sparklens">Sparklens GitHub</a>.</p><p>3. Email feature is added in the jar — sparklens-assembly-0.3.2.jar , but the method is internally calling the <a href="http://sparklens.qubole.com/">SparkLens</a> for generating the report. So, if the website is down, then Email could not be generated.</p><p>Issue had been raised on this —</p><blockquote>Currently the website is working, so Email Generation is working.</blockquote><p><a href="https://github.com/qubole/sparklens/issues/67">Emailing report feature Not Working - Unresponsive post · Issue #67 · qubole/sparklens</a></p><p>4. SparkLens GitHub also has a Resolver Exception which is caused when trying to build the sbt in local. This is due to “ <a href="https://dl.bintray.com/spark-packages/maven">https://dl.bintray.com/spark-packages/maven</a>” been sunset and this repository service is forbidden.</p><p>To fix this issue, I have raised a <a href="https://github.com/qubole/sparklens/pull/69">PR</a> with the correct repository service .</p><p><a href="https://github.com/qubole/sparklens/pull/69">plugins.sbt updated with new resolver by Naina-Gurung · Pull Request #69 · qubole/sparklens</a></p><h3>How to Generate Insights from SparkLens Report ?</h3><p>Be it a console based report or a UI based report, below are the terminologies definition to better understand the SparkLens metrics-</p><pre>1. Driver WallClock Time    - Total time taken by driver to complete<br>                              the execution.<br>2. Executors WallClock Time - Total time taken by all the executors                   <br>                              to complete their execution.<br>3. Total Wall Clock Time    - Total time taken by driver &amp; executors  <br>                              for the execution.<br>4. Critical Path Time       - Minimum possible time for the app  <br>                              assuming unlimited resources.<br>5. Ideal Application Time   - Minimum possible time for the app <br>                              assuming perfect parallelism and no   <br>                              data skews.<br>6. Model Error              - Gap between estimated model time Vs <br>                              Real app time. Lower the model error,  <br>                              reliable the estimate.<br>7. WallClock Stage %        - Time taken by current stage over Total <br>                              time across all the stages<br>8. PRatio                   - Degree of parallelism = number of <br>                              tasks in the stage / number of cores.</pre><pre>                              PRatio &gt; 1 =&gt; Too many tasks<br>                              PRatio &lt; 1 =&gt; Too many cores<br>9. TaskSkew                 - Degree of skew = largest task duration   <br>                              or median task duration.<br>10. TaskStageSkew           - Largest task duration / total stage <br>                              duration<br>11. OIRatio                 - Total output of the stage (results +  <br>                              shuffle write) / total input (input  <br>                              data + shuffle read)</pre><p>While SparkLens generate a whole list of reports with all the measurement metrics, below are the bullet points I followed to get started with the performance tuning-</p><ol><li>Total Wall Clock Time Vs Critical Path Time</li><li>Compute wastage</li><li>Model Error</li><li>Lack of tasks</li><li>Skewness among the tasks</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gnh4adxbtDDIKBemLRQgog.png" /></figure><p><strong>Driver Run Time</strong> : In a spark application when driver runs, executors remain idle at that time. So, that time when the executor is waiting for the driver to complete is a total wastage of time for the executor. This indicates us to reduce load on driver.</p><p><strong>Critical Path</strong> <strong>Time</strong>: The time taken when run with infinite number of resources.<br>It is a false notion to think that given infinite number of resources to an application, it will give the best results.</p><p>The minimum run time that an application needs to complete always depends on the Driver time and Stage time.</p><p>The total time taken by each stage depends on the longest running task (refer the pic above). This means that —</p><pre>Total time of job execution = Total time taken by driver + All   <br>                              longest running tasks</pre><p>This Total time, however, is minimum possible run time that an application would take to run despite given infinite resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4SCXE_EtC8zZKMLebKtRWg.png" /></figure><p><em>If Critical Path Time is less than the Actual Run Time/Total Wall Clock Time, then there is an opportunity of optimization.</em></p><p>Here, the Total Run Time is 49m 38s, whereas the Critical Path Time is 4m 50s. This indicates that the run time can be further reduced by revisiting the code and identifying places of improvement.</p><p>To reduce the Total application run time (Total Wall Clock Time), follow the below points-</p><ol><li>Look for places where there is huge shuffling. Avoid it if you can.</li><li>Use persist if the same dataframe is called in multiple methods.</li><li>Avoid using collect(), show() in code.</li><li>Avoid using repeated task such as for/while Loop which does the same thing in sequence.</li><li>Avoid using repartition/ coalesce if not needed, it reduces independent task which reduces parallelism.</li></ol><h3>Increase performance using Spark Configurations -</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HXaNQhr63s9EvNXWvXsbHQ.png" /></figure><p>Given a scenario, where there are same number of task, but the WallClock Stage % is more compared to the other, look in the code where this is happening.</p><p>In this above scenario, there was repartition(10) being used in the code, which was resulting to 10 tasks taking 85% of time (WallClock Stage %).</p><p>Now, coming to the Compute Wastage and Model Error-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DsWC4nedIpa_yCGn4ltXew.png" /></figure><p>&gt; 60.45% of compute is wasted on executor side.</p><p>&gt; The model error is 53% which is also very high.</p><p>The report also shows the number of executors allocated for the job run and the simulation of number of executors used.</p><p>From the configuration point of view, we can add the below confs in the spark submit job-</p><ol><li>Ensure the shuffle partitions and the dynamic allocation is enabled as true</li><li>Tweak the minimum / maximum executors range / initial executors</li><li>Set the executorIdleTimeout in seconds</li><li>Increase number of shuffle partitions to maximum which can be total number of cores available.</li></ol><pre>--conf &quot;spark.shuffle.service.enabled=true&quot;<br>--conf spark.sql.shuffle.partitions=&quot;500&quot; <br>--conf &quot;spark.dynamicAllocation.enabled=true&quot;<br>--conf &quot;spark.dynamicAllocation.minExecutors=100&quot;<br>--conf &quot;spark.dynamicAllocation.maxExecutors=300&quot;<br>--conf &quot;spark.dynamicAllocation.initialExecutors=60&quot;<br>--conf &quot;spark.dynamicAllocation.executorIdleTimeout=400&quot;</pre><p>Adding these above spark configurations helped in further reducing the Total WallClock Time, the Model Error and the Compute Wastage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cKLESn4x2Qm9jusQil2i-A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hbwGGir22t7GwhFeHMH_3g.png" /></figure><p>The Final result yielded a much better performance compared to what was running earlier.</p><p>The Code changes and spark configurations helped in reducing-</p><ol><li>The Total WallClock time by 36mins</li><li>Compute Wastage from 60.45% to 33.71%</li><li>Model Error from 53% to 17%</li></ol><h3>Summary -</h3><p>SparkLens report won’t tell you — which part of the code needs changes to make a difference in the performance.</p><p>Rather it provides enough metrics which helps in gaining insights on increasing the performance by making changes in the code wherever possible.</p><p>It predicts how a given spark application will run on any number of executors in a single run using its simulator. This gives an idea on setting the minimum and maximum number of executors to ensure faster run time.</p><p>Adding other Spark configurations like executor idleTimeout, setting spark shuffle partitions, further helped in reducing the time.</p><p>There are still many other metrics that can be further explored and gained insights on, which can tell you how your application is running.</p><p>I hope this blog gives you some idea on how to get started, generate insights about scalability limits of spark applications from a single run of the application and use various spark configurations to improve the spark performance.</p><p>Keep Exploring and Happy Learning !!</p><h3>References -</h3><p>Source code : <a href="https://github.com/qubole/sparklens">GitLink</a></p><p><a href="https://docs.qubole.com/en/latest/user-guide/engines/spark/sparklens.html">SparkLensDoc</a></p><p><a href="https://www.youtube.com/watch?v=KS5vRZPLo6c">SparkAISubmitSparkLens</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad8a8df9530c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Static Site Generator — Jekyll Vs Hugo]]></title>
            <link>https://nainagurung.medium.com/static-site-generator-jekyll-vs-hugo-f89352b331de?source=rss-6dcd4f22dbb6------2</link>
            <guid isPermaLink="false">https://medium.com/p/f89352b331de</guid>
            <category><![CDATA[static-site-generator]]></category>
            <category><![CDATA[hugo]]></category>
            <category><![CDATA[ssg]]></category>
            <category><![CDATA[jekyll-themes]]></category>
            <category><![CDATA[github-pages]]></category>
            <dc:creator><![CDATA[Naina Gurung]]></dc:creator>
            <pubDate>Fri, 02 Jul 2021 20:51:08 GMT</pubDate>
            <atom:updated>2021-07-03T17:02:43.333Z</atom:updated>
            <content:encoded><![CDATA[<h3>Static Site Generator — Jekyll Vs Hugo</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LacSiIIf-dSDDQKLj6f3ww.png" /></figure><p>Static Site Generators are tools that allow you to build a powerful, server-based website locally on your computer by taking a set of input files templates, pre-builds the site into static files for deployment and generates a full static HTML website.</p><p>There are many popular SSGs used nowadays. I recently used both Jekyll and Hugo and here’s my experience so far.</p><p>Although, there are a lot of docs that tells about the differences, this article pertains to the similarities and differences I observed using <strong>Jekyll</strong> and <strong>Hugo</strong>.</p><h3><strong>Similarities</strong></h3><p>The similarity lies in the steps how they are installed, edited, executed and published.</p><ol><li>Both are installed using-</li></ol><p>Jekyll -</p><pre>gem install jekyll</pre><p>Hugo -</p><pre>brew install hugo</pre><p>2. Jekyll new site is created using</p><pre>jekyll new . (if you want to create contents in the same dir)<br>OR<br>jekyll new &lt;siteName&gt;</pre><p>Hugo new site is created using</p><pre>hugo new site . (in the same dir)<br>OR<br>hugo new site &lt;siteName&gt;</pre><p>3. BaseUrls and other config details are mentioned in the config files in both Jekyll and Hugo.</p><p>In Jekyll, the config file name is <em>_config.yml</em></p><p>In Hugo, the config file name is <em>config.toml</em></p><p>4. Test your site locally by running -</p><p><strong>Jekyll</strong>-</p><pre>bundle exec jekyll serve</pre><p><strong>Hugo</strong>-</p><pre>hugo server</pre><p>5. Content for your site in both Jekyll and Hugo are written using markdown syntax</p><p>6. Publish the content to GitHub pages.</p><p>Jekyll builds the site and outputs a static site to a directory called _site.</p><pre>jekyll build</pre><p>Hugo builds the site using below command, and outputs to a public directory.</p><pre>hugo</pre><h3><strong>Differences</strong></h3><p>The difference lies in the command execution, template , themes, contents and language.</p><ol><li>Jekyll uses gem based file using Ruby.Hugo uses Go language.</li><li>Jekyll comes with a default minima theme that gets installed when creating a new site. So, it is easier for the beginner to learn with rendering a template website.</li></ol><p>Hugo doesn’t have any template theme but the skeleton of the project without any theme.</p><p>3. Use <a href="http://jekyllthemes.org/"><em>jekyllthemes.org</em></a> for Jekyll and <a href="https://themes.gohugo.io/"><em>themes.gohugo.io</em></a> for Hugo.</p><p>Unlike Jekyll, in Hugo, the details on how to use the theme is mentioned quiet in detail and the look and feel of Hugo themes are better.</p><p>4. In Jekyll, if there is any change in the <em>_config.yml</em>, run below command, which is not required in case of Hugo.</p><pre>bundle update</pre><p>5. Publishing the content of site in GitHub page.</p><p>In <strong>Jekyll</strong>, it is quite easy to add the url in <em>_config.yml</em> and the GitHub pages can be rendered in any ways — from main branch or gh-pages branch.</p><p>In <strong>Hugo</strong>, the content doesn’t appear easily in the git page just by providing the url in the config.toml file.</p><p>Instead there is a set of commands to be run to push the content to gh-pages separately so that the GitHub pages gets rendered from gh-pages branch .</p><p><strong>Hugo-</strong></p><p>a) After pushing the project to the main branch of the repo, come back to your local machine and execute these commands-</p><pre>echo &quot;public&quot; &gt;&gt; .gitignore<br>git checkout --orphan gh-pages <br>git reset --hard <br>git commit --allow-empty -m &quot;Initializing gh-pages branch&quot; <br>git push origin gh-pages <br>git checkout master</pre><p>building the content to public and publishing to gh-pages branch-</p><p>in your root directory-</p><pre>rm -rf public <br>git worktree add -B gh-pages public origin/gh-pages<br>hugo <br>cd public &amp;&amp; git add --all &amp;&amp; git commit -m &quot;publish site&quot;<br>git push origin gh-pages</pre><p>6. The contents can be easily added under content folder in Hugo. It is pretty well organised unlike Jekyll.</p><p>7. In terms of extensibility, Jekyll currently leads in a big way because of its plugin API unlike Hugo.</p><p>8. When it comes to development speed, Hugo is faster than Jekyll. But, if the project deals with pages in terms of hundreds, then the difference isn’t going to be a problem. The difference is probably seen when it comes to building thousands of pages.</p><h4><strong>Summary-</strong></h4><p>Both Jekyll and Hugo has its pros and cons. Choosing the right SSG depends on how comfortable you are working with it, and the requirements of your site. Personally, I felt Jekyll is easier to use when getting started, and Hugo has more organisational capabilities and ease of content management.</p><p>I would suggest to start off with anyone, and switch whenever you want, either ways both are great SSGs.</p><p>I hope this article gives some idea on how and where to get started.</p><p>Happy Learning !!</p><blockquote>Refer my post on <a href="https://nainagurung.medium.com/publish-github-pages-using-jekyll-369a8e2800b7">Jekyll</a> to publish in GitHub pages using Jekyll.</blockquote><blockquote>Want to try out Hugo with theme — Refer the README.md for steps to try out Hugo <a href="https://github.com/Naina-Gurung/hugo-site">Hugo-Page</a> .</blockquote><h4>References -</h4><p><a href="https://gohugo.io/getting-started/">Get Started</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f89352b331de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Publish Github Pages Using Jekyll]]></title>
            <link>https://nainagurung.medium.com/publish-github-pages-using-jekyll-369a8e2800b7?source=rss-6dcd4f22dbb6------2</link>
            <guid isPermaLink="false">https://medium.com/p/369a8e2800b7</guid>
            <category><![CDATA[cms]]></category>
            <category><![CDATA[gem]]></category>
            <category><![CDATA[github-pages]]></category>
            <category><![CDATA[jekyll]]></category>
            <category><![CDATA[issues]]></category>
            <dc:creator><![CDATA[Naina Gurung]]></dc:creator>
            <pubDate>Sat, 29 May 2021 13:37:55 GMT</pubDate>
            <atom:updated>2021-05-29T13:49:26.440Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever thought of how to build a website without having to write an application code, or having to access databases. To solve this problem, we use Jekyll.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*nuQcBWwvNfswQZkGZ0ry7g.png" /></figure><p>Jekyll is a simple, free, easy-to-use static site generator. You can use Jekyll to create simple websites/blogs/GitHub pages. It takes your content, renders markdown and liquid templates and convert to HTML that can be hosted on a web server. You can place your content in the form of text, markdown or HTML in the root directory of your project, or /docs folder and it processes these files in build time and generates HTML files from the layouts in your theme.</p><p>It is a static site generator as it isn’t actually running the live website, but hosting a static website by using the static site files which you have placed in your project. It is simple, static and has an easy GitHub Pages Integration which makes it a top reason why developers prefer it.</p><p>In this blog, I am going to show you how I learnt and created a simple, easy-to-use static GitHub Page, the issues I faced, and how I resolved it.</p><p>I hope this helps you!!</p><p>Let’s Get Started</p><blockquote>PS: I’m using a mac.</blockquote><h3>Jekyll Set Up</h3><ol><li>Open terminal, and check if ruby is installed.</li></ol><pre>ruby -v</pre><p>2. If ruby is installed, then install Jekyll</p><pre>gem install jekyll</pre><h3>Create a GitHub repo</h3><ol><li>To create a repository , first login to GitHub, Click on the “New” icon in the GitHub page.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/214/1*NM95gMIf6NrHFSY1bQD34g.png" /></figure><p>2. You can provide any name you want. I have created the repo with the name <em>jekyll-poc as below.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nWDxPcBS7e9Wim89hjQhWg.png" /></figure><p>3. Once created, clone the repo to your local machine by clicking on the “Code” icon -&gt; Copy the link -&gt; run the command in terminal in your local machine as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nc0n90BSnolHDEAVpy12Tg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CmzkconMPgyTmUz3zRTBbg.png" /></figure><pre>git clone <a href="https://github.com/Naina-Gurung/jekyll-poc.git">https://github.com/Naina-Gurung/jekyll-poc.git</a></pre><h3>Create a Jekyll site in local</h3><ol><li>You will see a folder named <em>jekyll-poc</em> appear in your terminal. Go to the folder and run the command-</li></ol><pre>jekyll new .</pre><blockquote>Note: Don’t miss the dot(.) in the command.</blockquote><p>If you have cloned the repo with a <em>README.md</em> file, the command will show conflict like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cucy03DAbKzV9We-NXGeTA.png" /></figure><p>To resolve this conflict, run this command instead.</p><pre>jekyll new . --force</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PShZGI3BnFkjrY9fhtL5qw.png" /></figure><p>This creates all gem based theme in the root path. You can confirm this by running an <strong><em>ls</em></strong> command in the same path. You can see files like Gemfile, _config.yml, index.markdown, about.markdown and other files being auto created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ECK1QAs_8S-PYbbit8JGIg.png" /></figure><p>2. Now let’s test if the site is working and publishing the content, run the command.</p><pre>bundle exec jekyll serve</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*TEUdTVieccV5UP4qUaQo4w.png" /></figure><p>This will show a server address. Copy the url to address bar and hit ENTER.<br>You will see this webpage-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hb3rWJVfZ1pDns7EJbmhNw.png" /></figure><p>Press Ctrl+C to stop it.</p><h3>Publish a GitHub Page</h3><p>1. Add these changes to git by running the following commands-</p><pre>git status<br>git add .<br>git commit -m &quot;comment your changes done&quot;<br>git push</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aQ3vftwaGiMK9rvoDvqF5g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7lX5jUSPVaRmElVwhUptjQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*W7GmnVY5Qidfvpig86Mhtw.png" /></figure><p>2. Refresh your git repo in GitHub to see the files reflecting . Go to settings and click <em>“Pages”</em> , you will see something like this -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mtd-ZK2rfnwOoI33Zg6M8g.png" /></figure><p>3. At first you will not see any GitHub pages link under <em>“GitHub Pages”</em> section , but once you select the branch from the dropdown option, it refreshes and you can see the GitHub link finally.</p><p>Open this GitHub link shown-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sd66XRCyMzEjrCTOSSH5IQ.png" /></figure><p>4. Oops!! the format of the content doesn’t look the same way as it reflected in the local host url.</p><blockquote>What can we do to resolve it?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DlBdCCH1krY_4FwIkWSEBg.png" /></figure><p>5. Now go back to your local machine to your repo project, and open your <em>“_config.yml”</em> file. You can see there are title ,email , description and other keys mentioned in the file.</p><p>Also notice there is a “<em>baseurl”</em> and “<em>url”</em> key with no values.</p><p>6. Copy your GitHub page url in this file as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m9QbKXa4QvTEnlAfX_dwNg.png" /></figure><p>7. Since the change was made to config file, we first update it by running the command to reflect the changes.</p><pre>bundle update</pre><p>8. Once the bundle gets updated, we can test it locally by running the command.</p><pre>bundle exec jekyll serve</pre><p>The page looks the same as before.</p><p>9. Push these changes to GitHub using git commands shown earlier.</p><p>10. Now refresh the page and voilà!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cYqtW75848TkYJZIG5VvkQ.png" /></figure><p>Here you go!! You have now the same format of the page as your local host url.</p><p>You can even confirm by clicking on the <em>“About”</em> or <em>“Welcome to Jekyll”</em> hyperlink , it opens another page with contents .</p><p>Hmmm!!! We did not add any content yet, how did those appear ?</p><p>Well here is how -</p><blockquote>When you created a new jekyll site, it created a <em>default gem based theme </em>at the path specified . Since we used “.” (dot) and not any name , so you saw those files and folders appear in the root path.</blockquote><blockquote>Take a look at the about.markdown page , you can find the same content which is published on the website .</blockquote><blockquote>Yes, this is where you have to write your content specific to <strong>“About your page”</strong></blockquote><blockquote>There is another hyperlink with the name <strong>“Welcome to Jekyll”</strong>. Notice that it is appearing below <strong>“Posts”</strong> section in the webpage.</blockquote><blockquote>Go back to your local repo and open the “_posts” folder , you see a markdown file with a date and welcome-to-jekyll. Open the file, and there is the content written for that page.</blockquote><p>Notice in both <em>“about.markdown”</em> and <em>“welcome-to-jekyll.markdown”</em>, you see a block of lines with triple dash at the beginning and at the end of the block.</p><p>That’s called the <a href="https://jekyllrb.com/docs/step-by-step/03-front-matter/"><strong>Front Matter</strong></a>. Here, you can set predefined variables for the page and call them in liquid using page variables. Whatever value mentioned in the <em>title</em> in that block, is what appears in the webpage.</p><p>11. let’s try adding another page to the “<em>_posts”</em>.</p><blockquote>📝 : the name of folder _posts should end with an “s” like _posts , and not _post. While, the value of the layout in the Front Matter should be “post” (without an “s”)</blockquote><pre>---<br>layout: post<br>---</pre><p>Let’s add a file name <em>“2021–05–29-how-jekyll-works.markdown”</em> , and add some content in it.</p><p>Also let’s add a title of the Page in the “_<em>config.yml</em>” file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lk9nLoW1P9uygLBZ7wMuEQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M0VRIO1AxEm4RfJma-Duog.png" /></figure><p>Run “<strong><em>bundle update”</em></strong> and push the changes to GitHub.</p><p>Refresh the webpage to see the changes. If you can’t see immediately , wait for sometime and refresh it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rZcax1qiWOpXNcIO62zqdg.png" /></figure><p>Awesome job!! Now we can see both posts appear in the webpage and can view the contents of the posts.</p><h3>Convert Gem based theme to Regular based theme</h3><p>I have used a gem based minima theme , which is internally referring to the minima-2.5.1 when you install <a href="https://jekyllrb.com/"><strong>Jekyll</strong></a> at the beginning.</p><p>Let’s check that out-</p><p>Run the below command to view the path of the minima installed.</p><pre>bundle show minima</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*6qXbmk3_0R3TWiBoNStkOA.png" /></figure><p>Navigate to this path , and you can see folders like <em>_includes , _sass, _layouts, assets</em></p><p>Now let’s try not to point to gem based minima theme, and create a regular based minima theme.</p><ol><li>Go to your repo project , open “<em>_config.yml</em>”, and search for the line <br><em>“theme: minima”</em></li></ol><pre># comment this line by adding hash at the beginning<br># theme: minima</pre><p>Open Gemfile , and comment these lines</p><pre>gem “minima”, “~&gt; 2.5”<br>gem “github-pages”, group: :jekyll_plugins</pre><p>2. Copy all the below directories in the minima-2.5.1/ to your repo location in local. <strong><em>( _includes, _layouts, _sass, assets directories)</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TvKPgR1hNuqnGSl1JzNREQ.png" /></figure><p>You should be able to see those folders reflecting in your repo project in local.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*KEMTw0pYFJ1sNOFSCub3Sg.png" /></figure><p>3. Run “<strong><em>bundle update</em></strong>” for the changes to reflect.</p><p>4. Then run“<strong><em>bundle exec jekyll serve</em></strong>”</p><p>You might counter this error below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B7GeVme7Ho5wR4xRmRUEnQ.png" /></figure><p>In such case, add this in your Gemfile -</p><pre>gem &quot;jekyll-seo-tag&quot;, &quot;~&gt; 2.6&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*kJWPeBzUjGrVcVS7aIwi-A.png" /></figure><p>After this change, run the command again and you will see a new local server address. This is because of the “<strong><em>url</em></strong>” value you provided in the “<strong><em>_config.yml</em></strong>” file earlier.</p><pre>bundle exec jekyll serve</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*MwkEswrp_8zC5wAng2nxqQ.png" /></figure><p>Open the server address url and view the page.<br>It shows the same page as we have seen earlier. The difference being- this time it is not referring from the gem based minima theme, but the regular based minima.<br>Let’s push this to GitHub and view the same.</p><blockquote>Refer <a href="https://jekyllrb.com/docs/themes/#converting-gem-based-themes-to-regular-themes"><strong><em>convert-gem-based-to-regular-based-theme</em></strong></a> for more info.</blockquote><h3>GitHub Pages Themes</h3><p>You can also use other themes provided by GitHub from the GitHub Pages directly.</p><p>For that, navigate to <strong><em>Settings</em></strong> after creating an <strong><em>empty repo</em></strong> (<em>as done earlier</em>).</p><p>Go to Pages → GitHub Pages section → Theme Chooser subsection → Click on “Choose a Theme”.</p><p>You will see a page like this -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BqUbBvLlAHXXo7qWPIFIOA.png" /></figure><p>Select the theme of your choice and commit the changes.</p><p>View the page by clicking on the GitHub link created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JSUtaa52ACGTLCYQrAjXaA.png" /></figure><p>“<strong><em>git pull</em></strong>” these new commit to your local, add contents and push to GitHub to see your contents reflecting.</p><p>I hope this blog helped in someway for you to get started on setting up and creating your own website for your project.</p><p>I would encourage you to read <a href="https://jekyllrb.com/"><strong>Jekyll</strong></a> and <a href="https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll"><strong>GitHubPageWithJekyll</strong></a><strong> .</strong></p><p>Happy Learning!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=369a8e2800b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>