<?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 Sharvesh. S on Medium]]></title>
        <description><![CDATA[Stories by Sharvesh. S on Medium]]></description>
        <link>https://medium.com/@sharveshs?source=rss-edb420b2d90------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Gz6ZtlR65gKXxhLVlUX2IQ.jpeg</url>
            <title>Stories by Sharvesh. S on Medium</title>
            <link>https://medium.com/@sharveshs?source=rss-edb420b2d90------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 23:56:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sharveshs/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[Build Smarter Node Apps with GitHub Copilot SDK and GitHub Auth — Part 2]]></title>
            <link>https://sharveshs.medium.com/build-smarter-node-apps-with-github-copilot-sdk-and-github-auth-part-2-564d53d31489?source=rss-edb420b2d90------2</link>
            <guid isPermaLink="false">https://medium.com/p/564d53d31489</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[github-copilot]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Sharvesh. S]]></dc:creator>
            <pubDate>Fri, 17 Apr 2026 15:48:27 GMT</pubDate>
            <atom:updated>2026-04-17T15:49:54.367Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*osAJZ75Rpzgd-x-uryN2sA.png" /></figure><p>In <a href="https://sharveshs.medium.com/build-smarter-node-apps-with-github-copilot-sdk-and-github-auth-part-1-6abee5828b15">Part 1</a>, we covered the GitHub Copilot SDK and why passing an individual user token is the right architecture for a multi-user Node.js application. Now it is time to actually get that token. This part builds the GitHub OAuth login flow in Express, stores the user session securely, and wires it into the SDK.</p><h3>What You Will Need</h3><p>Before writing any server code, register a GitHub OAuth App at github.com/settings/developers. Set the authorization callback URL to your Express backend, for example http://localhost:3001/api/auth/callback. Then add these values to your environment:</p><pre>GITHUB_CLIENT_ID=your_oauth_app_client_id<br>GITHUB_CLIENT_SECRET=your_oauth_app_client_secret<br>JWT_SECRET=a_long_random_signing_secret</pre><p>Install the additional Express dependencies:</p><pre>npm install express cookie-parser jsonwebtoken dotenv cors<br>npm install -D @types/express @types/cookie-parser @types/jsonwebtoken</pre><h3>The OAuth Flow in Four Steps</h3><p>The login flow is straightforward. Your Express server redirects the browser to GitHub’s consent screen. After the user approves, GitHub sends the browser back to your callback route with a short-lived code. You exchange that code for a gho_-prefixed access token, fetch the user&#39;s GitHub profile, and create a secure server-side session.</p><p>The key constraint throughout: the GitHub access token must never leave the server. The browser gets a signed HttpOnly cookie and nothing else.</p><p><strong>Step 1 — Redirect to GitHub:</strong></p><pre>router.get(&quot;/github&quot;, (_req, res) =&gt; {<br>  const params = new URLSearchParams({<br>    client_id: process.env.GITHUB_CLIENT_ID!,<br>    redirect_uri: &quot;http://localhost:3001/api/auth/callback&quot;,<br>    scope: &quot;read:user&quot;,<br>  });<br>  res.redirect(`https://github.com/login/oauth/authorize?${params}`);<br>});</pre><p><strong>Step 2 — Handle the callback, create the session:</strong></p><p>After exchanging the code for a token and fetching the GitHub user profile, wrap both inside a signed JWT and set it as an HttpOnly cookie.</p><p><strong>Step 3 — Expose a safe </strong><strong>/me endpoint:</strong></p><p>Return only the profile fields the frontend needs. Never return the raw session or the access token:</p><pre>res.json({ id: user.id, login: user.login, avatar_url: user.avatar_url });</pre><h3>Auth Middleware</h3><p>Implement a single middleware function recovers the authenticated user from the session cookie before any protected route runs. If the cookie is missing or invalid, the request stops here with a 401.</p><p>Apply it to every route that needs Copilot access. Leave auth routes public.</p><h3>Wiring the SDK with the User’s Token</h3><p>With the session in place, the user’s GitHub token is available on every authenticated request. Pass it straight into the Copilot SDK client:</p><pre>import { CopilotClient, approveAll } from &quot;@github/copilot-sdk&quot;;<br><br>router.post(&quot;/chat&quot;, requireAuth, async (req, res) =&gt; {<br>  const client = new CopilotClient({<br>    githubToken: req.user.accessToken,<br>    useLoggedInUser: false,<br>  });<br><br>  const session = await client.createSession({<br>    model: &quot;gpt-5.4&quot;,<br>    onPermissionRequest: approveAll,<br>  });<br><br>  const response = await session.sendAndWait({ prompt: req.body.prompt }, 120_000);<br>  res.json({ output: response?.data?.content ?? &quot;&quot; });<br><br>  await session.disconnect();<br>  await client.stop();<br>});</pre><p>onPermissionRequest is required by the SDK. approveAll is the built-in helper that approves all tool operations. Swap it for a custom handler if you need finer control over what the model can do.</p><h3>Before You Ship</h3><p>A few things worth locking down before this goes to production:</p><ul><li>Enable secure: true on the cookie behind HTTPS</li><li>Never log or expose the raw GitHub access token</li><li>Validate all required environment variables at startup</li><li>If you need admin session revocation or multi-device logout, move from JWT cookies to a Redis or database-backed session store — the Copilot integration stays the same</li></ul><h3>The Bigger Picture</h3><p>What you have built across both parts is not just a Copilot integration. It is an architecture where GitHub handles identity and entitlement, OAuth captures a user-scoped token, Express stores it securely, and the SDK uses it at request time. The application does not own the AI layer. Each user brings their own access.</p><p>That changes how the product scales. It changes who bears access control responsibility. And it avoids the quiet cost problem that catches most AI applications off guard.</p><p><a href="https://github.com/github/copilot-sdk">https://github.com/github/copilot-sdk</a> — Official documentation</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=564d53d31489" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build Smarter Node Apps with GitHub Copilot SDK and GitHub Auth — Part 1]]></title>
            <link>https://sharveshs.medium.com/build-smarter-node-apps-with-github-copilot-sdk-and-github-auth-part-1-6abee5828b15?source=rss-edb420b2d90------2</link>
            <guid isPermaLink="false">https://medium.com/p/6abee5828b15</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[github-copilot]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <dc:creator><![CDATA[Sharvesh. S]]></dc:creator>
            <pubDate>Fri, 17 Apr 2026 15:46:14 GMT</pubDate>
            <atom:updated>2026-04-17T15:49:06.753Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*osAJZ75Rpzgd-x-uryN2sA.png" /></figure><p>Every AI application starts the same way. You pick a model, wire up an API key, ship fast, and feel great about it. Then the usage bill arrives. Then you realise that every user, every retry, and every background task goes through a single shared key that your application owns. What started as a clean integration quietly becomes a cost and access control problem.</p><p><strong>GitHub Copilot</strong> offers a better path. If your users already have Copilot access, your Node.js application does not need to own the AI layer. It can borrow it. <strong>This first part covers what the SDK is, how to install it, and how authentication works before any Express routes get involved.</strong></p><h3>What Is the GitHub Copilot SDK?</h3><p>The @github/copilot-sdk is a Node.js and TypeScript library that gives you programmatic access to GitHub Copilot&#39;s agent runtime. It is the same engine behind the Copilot CLI, exposed as an SDK you can embed directly into your own applications. <strong>The CLI is bundled automatically with the Node.js package, so there is nothing extra to install or manage.</strong></p><p>The SDK is currently in public preview at v0.2.2. It is functional and useful for real work, but the API surface may evolve.</p><p>Before writing any code, make sure you have:</p><ul><li>Node.js 18 or later</li><li>A GitHub account with an active GitHub Copilot subscription</li><li>A GitHub OAuth App registered at github.com/settings/developers</li></ul><h3>Installation</h3><pre>npm install @github/copilot-sdk<br>npm install -D tsx typescript @types/node</pre><p>Add a quick run script to your package.json:</p><pre>&quot;scripts&quot;: {<br>  &quot;dev&quot;: &quot;tsx watch index.ts&quot;<br>}</pre><p>That is everything you need to start making Copilot requests from Node.js.</p><h3>Your First Request</h3><p>The simplest possible usage is about five lines:</p><pre>import { CopilotClient } from &quot;@github/copilot-sdk&quot;;<br><br>const client = new CopilotClient();<br>const session = await client.createSession({ model: &quot;gpt-5.4&quot; });<br>const response = await session.sendAndWait({ prompt: &quot;What is 2 + 2?&quot; });<br>console.log(response?.data.content); // 4<br>await client.stop();</pre><p>The createSession call sets up a conversation context. sendAndWait sends a prompt and blocks until the model responds. The session can be reused for multi-turn conversations, or disconnected, and a new one created per request.</p><h3>How Authentication Works</h3><p>This is where the SDK gets interesting for server-side applications. Authentication resolves in priority order — highest wins:</p><ol><li>Explicit githubToken passed directly to the constructor</li><li>Environment variables: COPILOT_GITHUB_TOKEN, GH_TOKEN, or GITHUB_TOKEN</li><li>Stored OAuth credentials from a previous copilot CLI login</li><li>GitHub CLI credentials from gh auth</li></ol><p>For a local tool or quick prototype, option 3 or 4 is convenient. You log into the CLI once, and it just works. For a multi-user server application, only option 1 is correct.</p><p><strong>The SDK accepts a </strong><strong>gho_-prefixed OAuth user token through the githubToken constructor option:</strong></p><pre>const client = new CopilotClient({<br>  githubToken: userAccessToken,<br>  useLoggedInUser: false,<br>});</pre><p>useLoggedInUser: false tells the SDK not to fall back to stored CLI credentials if a user token is missing. Without it, a missing token silently falls through to whoever is logged into the machine running the server, which is never what you want in a multi-user application.</p><h3>What This Makes Possible</h3><p>That one option, githubToken, is the architectural pivot. Instead of the application owning all AI requests through a shared server credential, each request runs through the identity of the user who triggered it. Their Copilot entitlement, their access, their usage.</p><p>For teams building internal tools or user-facing products on top of Copilot, this is the model that ages well. It scales naturally, it respects access boundaries, and it does not require the application to hold a high-value shared credential.</p><p>In <a href="https://sharveshs.medium.com/build-smarter-node-apps-with-github-copilot-sdk-and-github-auth-part-2-564d53d31489">Part 2</a>, we will set up a GitHub OAuth login flow in Express to get that gho_ user token, store it securely on the server, and wire it into the Copilot SDK at request time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6abee5828b15" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Add and Delete from Solr immediately when a page or asset is published/unpublished in AEM as a…]]></title>
            <link>https://sharveshs.medium.com/add-and-delete-from-solr-immediately-when-a-page-or-asset-is-published-unpublished-in-aem-as-a-f28d2aff22d2?source=rss-edb420b2d90------2</link>
            <guid isPermaLink="false">https://medium.com/p/f28d2aff22d2</guid>
            <category><![CDATA[aemasacloudservice]]></category>
            <category><![CDATA[solrj]]></category>
            <category><![CDATA[aem]]></category>
            <category><![CDATA[adobe-experience-manager]]></category>
            <category><![CDATA[solr]]></category>
            <dc:creator><![CDATA[Sharvesh. S]]></dc:creator>
            <pubDate>Mon, 22 Jul 2024 07:38:02 GMT</pubDate>
            <atom:updated>2024-07-22T07:40:58.018Z</atom:updated>
            <content:encoded><![CDATA[<h3>Add and Delete from Solr immediately when a page or asset is published/unpublished in AEM as a cloud service using SolrJ — Part-2</h3><p>Do read Part -1 of this before diving into Part-2 for better understanding of the solution — <a href="https://medium.com/@sharveshs/add-and-delete-from-solr-immediately-when-a-page-or-asset-is-published-unpublished-in-aem-as-a-9981cb9a58ac">https://medium.com/@sharveshs/add-and-delete-from-solr-immediately-when-a-page-or-asset-is-published-unpublished-in-aem-as-a-9981cb9a58ac</a></p><h3>Part — 2 — How to Index/Delete a page/asset from Solr using SolrJ client.</h3><p>SolrJ is the Java client for Apache Solr, enabling you to interact with Solr from a Java application. It provides a programmatic interface to perform operations like adding, deleting, and querying documents within a Solr index.</p><p>We need to create a service with functionalities to connect to our Solr instance and Index or Delete documents from Solr.</p><p>For a Service in AEM, we need a config file in <strong>ui.config</strong> module.</p><p>sample.sharvesh.core.services.SolrIndexService.cfg.json</p><pre>{<br>    &quot;solrHost&quot;: &quot;$[env:SOLR_HOST;default=&lt;Your Solr Public Url here&gt;]&quot;,<br>    &quot;collection&quot;: &quot;$[env:COLLECTION;default=&lt;Your Solr Collection here&gt;]&quot;,<br>}</pre><p>Here we have Solr Host Url and Collection name as environment variables in the config.</p><p>Then let&#39;s add SolrJ dependency to our AEM project.</p><p>First in projects <strong>pom.xml</strong> we need to add</p><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;org.apache.servicemix.bundles&lt;/groupId&gt;<br>    &lt;artifactId&gt;org.apache.servicemix.bundles.zookeeper&lt;/artifactId&gt;<br>    &lt;version&gt;3.8.0_1&lt;/version&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;org.apache.servicemix.bundles&lt;/groupId&gt;<br>    &lt;artifactId&gt;org.apache.servicemix.bundles.solr-solrj&lt;/artifactId&gt;<br>    &lt;version&gt;8.11.0_1&lt;/version&gt;<br>&lt;/dependency&gt;</pre><p>Then in the <strong>core</strong> module <strong>pom.xml</strong> add these dependencies.</p><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;org.apache.servicemix.bundles&lt;/groupId&gt;<br>    &lt;artifactId&gt;org.apache.servicemix.bundles.zookeeper&lt;/artifactId&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;org.apache.servicemix.bundles&lt;/groupId&gt;<br>    &lt;artifactId&gt;org.apache.servicemix.bundles.solr-solrj&lt;/artifactId&gt;<br>&lt;/dependency&gt;</pre><p>Then in <strong>all</strong> module <strong>pom.xml</strong> we need to embed them.</p><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;org.apache.servicemix.bundles&lt;/groupId&gt;<br>    &lt;artifactId&gt;org.apache.servicemix.bundles.solr-solrj&lt;/artifactId&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;org.apache.servicemix.bundles&lt;/groupId&gt;<br>    &lt;artifactId&gt;org.apache.servicemix.bundles.zookeeper&lt;/artifactId&gt;  <br>&lt;/dependency&gt;</pre><pre>&lt;embedded&gt;<br>    &lt;groupId&gt;org.apache.servicemix.bundles&lt;/groupId&gt;<br>    &lt;artifactId&gt;org.apache.servicemix.bundles.solr-solrj&lt;/artifactId&gt;<br>    &lt;filter&gt;true&lt;/filter&gt;<br>    &lt;target&gt;/apps/Solr/application/install&lt;/target&gt;<br>&lt;/embedded&gt;<br>&lt;embedded&gt;<br>    &lt;groupId&gt;org.apache.servicemix.bundles&lt;/groupId&gt;<br>    &lt;artifactId&gt;org.apache.servicemix.bundles.zookeeper&lt;/artifactId&gt;<br>    &lt;filter&gt;true&lt;/filter&gt;<br>    &lt;target&gt;/apps/Solr/application/install&lt;/target&gt;<br>&lt;/embedded&gt;</pre><p>Now we have to create a Config java file to read the config</p><p><strong>SolrIndexServiceConfig.java</strong></p><pre>import org.osgi.service.metatype.annotations.AttributeDefinition;<br>import org.osgi.service.metatype.annotations.ObjectClassDefinition;<br><br>@ObjectClassDefinition(name = &quot;Solr Index Service Config&quot;)<br>public @interface SolrIndexServiceConfig {<br><br>    @AttributeDefinition(name = &quot;Solr Host&quot;)<br>    public String solrHost() default &quot;DEFAULT VALUE HERE&quot;;<br><br>    @AttributeDefinition(name=&quot;Collection Name&quot;)<br>    public String collection() default &quot;DEFAULT COLLLECTION HERE&quot;;<br>}</pre><p>Next, we need to create the Service Class <strong>SolrIndexService.java with methods to connect to Solr, Add documents to Solr and Delete from Solr.</strong></p><pre>private HttpSolrClient solr;<br>private SolrIndexServiceConfig solrConfig;<br><br>@Activate<br>@Modified<br>protected void activate(SolrIndexServiceConfig config) {<br>    solrConfig = config;<br>    connectToSolr();<br>}<br><br>private void connectToSolr() {<br>    try {<br>        solr = new HttpSolrClient.Builder(&lt;HOST_URL&gt;)).withConnectionTimeout(5000).withSocketTimeout(5000).build();<br>        solr.setParser(new XMLResponseParser());<br>    } catch (SolrException e) {<br>        log.error(&quot;Unable to connect to Solr&quot;, e);<br>    }<br>}<br><br>// Here resourcePath is the path to your file along with public domain.<br>// Eg: https://www.sample.com/&lt;YOUR_CONTENT_PATH_FROM_EVENT_LISTENER&gt;<br>// In my usecase I am having the full path as ID in Solr<br>public void deleteFromSolr(String resourcePath) throws SolrException, SolrServerException, IOException {<br>    try {<br>        solr.deleteById(&lt;COLLECTION_NAME&gt;, resourcePath, 500);<br>    } catch (SolrException | SolrServerException | IOException e) {<br>        // Add your logs here<br>        throw e;<br>    }<br>}<br><br>// Here resourcePath is the path to your file along with public domain.<br>// Eg: https://www.sample.com/&lt;YOUR_CONTENT_PATH_FROM_EVENT_LISTENER&gt;<br>// In my usecase I am having the full path as ID in Solr<br>public void updateSolr(String resourcePath) throws SolrException, SolrServerException, IOException {<br>    try {<br>        ContentStreamUpdateRequest req = new ContentStreamUpdateRequest(&quot;/update/extract&quot;);<br>        URL url = new URL(resourcepath);<br>        ContentStream stream = new ContentStreamBase.URLStream(url);<br>        request.addContentStream(stream)<br>        request.setParam(&quot;literal.id&quot;,resourcePath);<br>        request.setAction(AbstractUpdateRequest.ACTION.COMMIT, true, true);<br>        solr.request(req,&lt;COLLECTION_NAME_FROM_CONFIG&gt;); <br>    }<br>    catch (SolrException | SolrServerException | IOException e) {<br>        // Add your logs here<br>        throw e;<br>    }<br>}</pre><p>In the above code, I am using HttpSolrClient and connecting to Solr with Connection and Socket timeout as the best practice. You can get the Solr Host Url from config in the AEM Service class.</p><p>In <strong>“updateSolr”</strong> method we need to create a ContentStreamUpdateRequest with <strong>/update/extract</strong> endpoint in Solr. Then we should make an Url connection with the Url we created by using the <strong>Domain name </strong>and the resource path from the event listener. Then we can get the content stream and add it to Solr.</p><p>In <strong>“deleteFromSolr” </strong>method we can delete from Solr using the same ID using which we indexed the document while adding and collection name.</p><p>Handle all the exceptions accordingly and this is just a gist of the solution, we can make it more efficient by using Sling Jobs to call the service accordingly. We can add Sling Jobs from the event listener with the paths that we receive.</p><p><strong>References:-</strong></p><ol><li><a href="https://solr.apache.org/guide/solr/latest/indexing-guide/indexing-with-tika.html#using-solr-cell-with-solrj">https://solr.apache.org/guide/solr/latest/indexing-guide/indexing-with-tika.html#using-solr-cell-with-solrj</a></li><li><a href="https://solr.apache.org/__root/docs.solr.apache.org/docs/9_0_0/solrj/org/apache/solr/common/util/ContentStreamBase.URLStream.html">https://solr.apache.org/__root/docs.solr.apache.org/docs/9_0_0/solrj/org/apache/solr/common/util/ContentStreamBase.URLStream.html</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f28d2aff22d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Add and Delete from Solr immediately when a page or asset is published/unpublished in AEM as a…]]></title>
            <link>https://sharveshs.medium.com/add-and-delete-from-solr-immediately-when-a-page-or-asset-is-published-unpublished-in-aem-as-a-9981cb9a58ac?source=rss-edb420b2d90------2</link>
            <guid isPermaLink="false">https://medium.com/p/9981cb9a58ac</guid>
            <category><![CDATA[solr-cloud]]></category>
            <category><![CDATA[aem]]></category>
            <category><![CDATA[aemasacloudservice]]></category>
            <category><![CDATA[adobe-experience-manager]]></category>
            <category><![CDATA[solr]]></category>
            <dc:creator><![CDATA[Sharvesh. S]]></dc:creator>
            <pubDate>Sat, 20 Jul 2024 17:23:53 GMT</pubDate>
            <atom:updated>2024-07-22T07:38:51.993Z</atom:updated>
            <content:encoded><![CDATA[<h3>Add and Delete from Solr immediately when a page or asset is published/unpublished in AEM as a cloud service using SolrJ — Part-1</h3><h3>Part — 1- Listening to Publish/Unpublish event of pages and assets in AEM Cloud</h3><p>In order to listen to publish and unpublish events of pages and assets in AEM as a cloud service, we need first to understand the publishing process in the cloud.</p><p>In AEMaaCS sling Content Distribution (org.apache.sling.distribution) is done across the publish instances, unlike replication events in On-premise instances where content is replicated to publish instances. You can find more details about content distribution in the official Apache Sling Documentation — <a href="https://sling.apache.org/documentation/bundles/content-distribution.html">https://sling.apache.org/documentation/bundles/content-distribution.html</a></p><p>Whenever a page or an asset is published/unpublished in AEM Cloud forward distribution will happen and the following events will occur in the source and target instance</p><p>org/apache/sling/distribution/agent/package/created -- Source</p><p>org/apache/sling/distribution/agent/package/queued -- Source</p><p>org/apache/sling/distribution/agent/package/distributed -- Source</p><p>org/apache/sling/distribution/agent/package/dropped -- Source</p><p>org/apache/sling/distribution/importer/package/imported -- Target</p><p>We need to listen to org/apache/sling/distribution/agent/package/distributed event. For that, we need to have an Event Handler which listens to this event and we can also provide paths where we should listen as well if needed.</p><p>DistributionEventHandler.java</p><pre>import org.apache.sling.distribution.event.DistributionEventTopics;<br>import org.osgi.service.component.annotations.Component;<br>import org.osgi.service.component.annotations.Reference;<br>import org.osgi.service.event.Event;<br>import org.osgi.service.event.EventConstants;<br>import org.osgi.service.event.EventHandler;<br><br>import java.util.*;<br>import java.util.stream.Collectors;<br><br>@Component(service = EventHandler.class, immediate = true,<br>        property = {<br>                EventConstants.EVENT_TOPIC + &quot;=&quot; + DistributionEventTopics.AGENT_PACKAGE_DISTRIBUTED,<br>                EventConstants.EVENT_FILTER + &quot;=&quot; + &lt;YOUR PATHS HERE&gt;<br>        })<br>public class DistributionEventHandler implements EventHandler {<br><br>    public static final String DISTRIBUTION_PATHS = &quot;distribution.paths&quot;;<br>    public static final String EVENT_TYPE = &quot;distribution.type&quot;;<br><br>    @Override<br>    public void handleEvent(Event event) {<br>        String[] distributedPaths = (String[]) event.getProperty(DISTRIBUTION_PATHS);<br>        String eventType = event.getProperty(EVENT_TYPE).toString();<br>        List&lt;String&gt; path = Arrays.stream(distributedPaths).filter((val) -&gt; val.startsWith(&quot;/content/&quot;)).collect(Collectors.toList());   <br>    }<br>}</pre><p>Here in the Distribution Event Handler, we must give the EVENT_TOPIC as per the requirements, I am taking AGENT_PACKAGE_DISTRIBUTED and we can also mention the paths to be listened to if required.</p><p>In the handleEvent() method we can access the event object and using that we must get the property <strong>“distribution.paths” </strong>which gives us a String Array with all the paths that are distributed.</p><h4>Why a String Array and not a String?</h4><p>When we publish or unpublish a page, asset or content tree the policies of the components used in that page, template policies etc… will get distributed as well and those paths also will be there in the event so only it is a String array and not a String of the page/asset path alone.</p><p>We can get the event type from the property <strong>“distribution.type” </strong>which is a String to determine if a page is published or unpublished. If the event type is <strong>“ADD,</strong> &quot; a page/asset is published; if the event type is <strong>“DELETE,</strong> &quot; a page/asset is deleted.</p><p>From the Array of paths, we must filter the page/assets paths alone only then we can process further to index them to Solr.</p><p>Thanks for reading this and I hope this article has helped you to learn something new about AEM as a Cloud Service.</p><p>In Part -2 we will see how to add SolrJ to AEM, connect to Solr using SolrJ, and other things in detail.</p><p>Please do visit Part-2 — <a href="https://sharveshs.medium.com/add-and-delete-from-solr-immediately-when-a-page-or-asset-is-published-unpublished-in-aem-as-a-f28d2aff22d2">https://sharveshs.medium.com/add-and-delete-from-solr-immediately-when-a-page-or-asset-is-published-unpublished-in-aem-as-a-f28d2aff22d2</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9981cb9a58ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to focus on studies or placements during this corona pandemic holidays?]]></title>
            <link>https://sharveshs.medium.com/how-to-focus-on-studies-or-placements-during-this-corona-pandemic-holidays-ea4f606e14b7?source=rss-edb420b2d90------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea4f606e14b7</guid>
            <category><![CDATA[achievement]]></category>
            <category><![CDATA[focus]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[coronavirus]]></category>
            <dc:creator><![CDATA[Sharvesh. S]]></dc:creator>
            <pubDate>Sat, 21 Nov 2020 11:04:23 GMT</pubDate>
            <atom:updated>2020-11-21T11:04:23.169Z</atom:updated>
            <content:encoded><![CDATA[<p>Students around the world, especially 2021 pass-out batch got an golden opportunity, even in this worse situation they got something to cheer about, guess what?..<strong>Time </strong>which we don’t get during normal situation. On busy day from morning bus to college, then reaching home in the evening by 6, and after exhausting all our energy, we hardly focus on our additional talents apart from studies.</p><p>But in last six months and even in the upcoming months, we have almost 4–5 hours a day apart from online classes. In these 4–5 hrs we can learn a new frame work, programming language or any domain related skills easily, the resources on the internet, various websites like Coursera, Udemy, Codecamp etc… provide lots of free courses as well as paid courses at an affordable price.</p><p>It lies in one’s hands to develop and upgrade his knowledge by focusing and planning the time he gets. One has to ignore the outside world, his own feelings, personal problems and sometimes unwanted overthinking. The previously mentioned factors will take a student or a person to miserable situations in life.</p><p>But once he or she avoids those factors and most importantly <strong>Mobile games and Web Series which eats lots of time. </strong>These days many students waste time in these games. I am not against these entertainment, but it should be in a limited amount. 1–2 hrs a day can be given for entertainment and relaxing.</p><h3>FOCUS</h3><p>It doesn’t matter whether it is 5 hrs or 1 hr. Its the concentration and effort we invest to achieve the daily target we set by planning.</p><blockquote>We can define focus as center of interest</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/283/0*GLe9cqIymhwjzRQx.jpg" /></figure><p>No matter what the age 17–21 decides a person’s future. If one focuses on the necessary and important things, he or she will succeed in life. One may ask its the age where one undergoes many changes and face many problems but I would say, we can control ourselves, if we think wisely and make wise decisions.</p><p>Now I’ll say the main and core concept to achieve in studies and placements.</p><p><strong>The next big question is as a teenager who is pursuing bachelor degree, how can I focus by avoiding all the distractions and problems? So lets see how to focus.</strong></p><h3>How to focus?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*U2YTnEBfC_05b3_e.png" /></figure><p>I’ll explain this topic in point by point manner.</p><ol><li>Choose a best, silent place to study. The room must not have television or gadgets like PlayStation, Xbox and more importantly mobile phone.</li><li>Put your mobile phone in silent mode, because its the main distraction we have in today’s world. Use laptop or computer for browsing.</li><li>Always have the habit of planning. But its in your hands to complete it.</li><li>If you are planning to study some core subjects of your respected streams, first find some useful and good YouTube Channels. So that we can learn concepts easily and save time.</li><li>Don’t get bored. Switch topics.</li><li>Listen to music while relaxing so your eyes wont get tired by straining.</li><li>Keep yourself engaged with something useful, so one can avoid unwanted thoughts.</li></ol><p>All the above tips will be useful only if you control your mind. It can be done by meditation or by sitting alone and thinking about the important things we need to do in order to achieve.</p><blockquote>A wavering mind cannot achieve anything.</blockquote><p>With this I conclude this article and in my next article I’ll say about many resources and things we can do as an undergraduate student.</p><p>Thanks for reading this article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea4f606e14b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to find Minimum product triplet in an array?]]></title>
            <link>https://sharveshs.medium.com/how-to-find-minimum-product-triplet-in-an-array-e905589a22e2?source=rss-edb420b2d90------2</link>
            <guid isPermaLink="false">https://medium.com/p/e905589a22e2</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[sorting-algorithms]]></category>
            <category><![CDATA[c]]></category>
            <dc:creator><![CDATA[Sharvesh. S]]></dc:creator>
            <pubDate>Thu, 06 Aug 2020 14:19:05 GMT</pubDate>
            <atom:updated>2020-08-06T14:20:43.683Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Question: </strong>Given an integer array, find a minimum product of a triplet in array.</h3><h4>Sample Input:</h4><p>5</p><p>4 -1 3 5 9</p><h4>ANSWER: -45 (-1,9,5)</h4><p>The first line of input contains <strong>N </strong>the number of integers in an array. The second line contains N integers.</p><p>We must print the minimum product alone.</p><h3>C Solution:</h3><pre>#include &lt;stdlib.h&gt;<br>#include &lt;stdio.h&gt;<br>#define MIN(a,b) ((a&lt;b)?a:b)<br>int cmp(const void *x,const void *y){<br>    return *(int*)x - *(int*)y;<br>}<br>int main()<br>{<br>    int N;<br>    scanf(&quot;%d&quot;,&amp;N);<br>    int array[N];<br>    for(int i=0;i&lt;N;i++)<br>        scanf(&quot;%d&quot;,&amp;array[i]);<br>    qsort(array,N,sizeof(int),cmp);<br>    if(array[0]&lt;0){<br>        printf(&quot;%d&quot;,MIN(array[0]*array[1]*array[2],array[0]*array[N-2]*array[N-1]));<br>    }<br>    else{<br>        printf(&quot;%d&quot;,array[0]*array[1]*array[2]);<br>    }<br>    return 0;<br>}</pre><h3>Python Solution:</h3><pre>n = int(input())<br>l = list(map(int,input().split()))<br>l.sort()<br>if(l[0]&lt;0): print(min(l[1]*l[0]*l[2],l[0]*l[n-1]*l[n-2]))<br>else: print(l[0]*l[1]*l[2])</pre><p>In both the above languages we have implemented same algorithm, we sort the array to minimize the complexity for finding the triplet.</p><p>In C <strong><em>qsort</em></strong><em> </em>is a builtin function available in <strong>stdlib.h</strong> header file which sorts 1 Million integers is 0.247883 sec so its much efficient than standard sorting algorithms.</p><p>In Python sort function’s time complexity is O(n log n) which is better.</p><p>After sorting the elements we have only three possibility of minimum product triplet, which is separated using if else condition. So its simple how large may be the array we can find the triplet easily.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e905589a22e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to host a static website easily in Github]]></title>
            <link>https://sharveshs.medium.com/how-to-host-a-static-website-easily-in-github-f80b371648fd?source=rss-edb420b2d90------2</link>
            <guid isPermaLink="false">https://medium.com/p/f80b371648fd</guid>
            <category><![CDATA[github-pages]]></category>
            <category><![CDATA[website-development]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[static-websites]]></category>
            <dc:creator><![CDATA[Sharvesh. S]]></dc:creator>
            <pubDate>Wed, 29 Jul 2020 15:18:45 GMT</pubDate>
            <atom:updated>2020-07-29T15:18:45.851Z</atom:updated>
            <content:encoded><![CDATA[<p>GitHub, Inc. is a United States-based global company that provides hosting for software development and version control using Git. It has been a subsidiary of Microsoft since 2018.</p><p>Its very simple , all you have to do is first create a <strong>GitHub account </strong>using your email id</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*mKlo70x__fdYzWHNDFqROg.png" /></figure><p>Next,we have to sign-in, fill our personal details and verify our email-id. After finishing setup we have to create a new repository to upload our project or website files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/222/1*abM_gi7jYyUNYtlGIrcGQg.png" /></figure><p>Now click on the drop-down arrow near <strong>plus symbol, </strong>a drop down menu will appear .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/198/1*IX6z-hM548mDf-UQejWYwg.png" /></figure><p>In the drop down menu click on <strong>New repository. </strong>It will take you to the page where a new repository is created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YqGk4qJslUxhbuAAb3jr_Q.png" /></figure><p>Here enter your website name and select Public. Your website URL will be in the format of</p><blockquote><a href="https://username.github.io/repository-name/">https://<strong>username</strong>.github.io/<strong>repository-name</strong>/</a></blockquote><p>Then click create repository, it will redirect to another page, here as of now we don’t have any work here, <strong>just click on</strong></p><blockquote>uploading an existing file</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FMT1i45l0tOy1FX-lebjjg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0nG5BRgUuzn1utXjnkRE5w.png" /></figure><p>Now drag and drop or upload your project files or website files.</p><p>Most importantly the websites first page or home page must be named as <strong>index.html.</strong></p><p>Then click on <strong>Commit changes</strong> button at the bottom. Now you have successfully uploaded your files into GitHub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DgLcBA5NElO52CsUfcijmA.png" /></figure><p>Now click on <strong>Settings</strong> tab. Scroll down to <strong>GitHub Pages </strong>section<strong>.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7sdp5TW4TC8PsPpwIcQ6fw.png" /></figure><p>In the Source section click on the dropdown (None).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/1*C_j_8BUQ8xn84B5C0MXJCg.png" /></figure><p>Select <strong>master branch </strong>and the page will refresh. Again go to <strong>GitHub Pages </strong>section.</p><p>You will see a link as I mentioned earlier in this article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*NTfU8ppNVXPx_os6FLEy0w.png" /></figure><p>Click on the link and view your website hosted on GitHub😊😊.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f80b371648fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Coding the post page and adding the styles]]></title>
            <link>https://sharveshs.medium.com/coding-the-post-page-and-adding-the-styles-df2ff67ecb9b?source=rss-edb420b2d90------2</link>
            <guid isPermaLink="false">https://medium.com/p/df2ff67ecb9b</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[w3schools]]></category>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[Sharvesh. S]]></dc:creator>
            <pubDate>Sat, 25 Jul 2020 15:23:28 GMT</pubDate>
            <atom:updated>2020-07-26T05:22:39.115Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome back!!!. If you want to understand this post please do refer my previous <a href="https://medium.com/@sharveshs/how-to-create-a-simple-blog-website-using-html-and-css-only-1e2b264cb13a"><strong>tutorial</strong></a>. Let’s start coding the blog post page . Our post page contains a image,video and description about the post.</p><p>You can name the post page as you want but keep the same name to link the post to main page.</p><pre>&lt;html&gt;</pre><pre>&lt;head&gt;</pre><pre>&lt;title&gt;Biryani&lt;/title&gt;</pre><pre>&lt;link rel=&quot;stylesheet&quot; href=&quot;post.css&quot; &gt;</pre><pre>&lt;/head&gt;</pre><pre>&lt;body&gt;</pre><pre>&lt;div class=&quot;posts&quot;&gt;</pre><pre>&lt;div class=&quot;image&quot;&gt;</pre><pre>&lt;img src=&quot;https://www.indianhealthyrecipes.com/wp-content/uploads/2019/02/chicken-biryani-recipe-500x500.jpg&quot; alt=&quot;img&quot; height=&quot;350&quot; width=&quot;350&quot;&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div class=&quot;video&quot;&gt;</pre><pre>&lt;iframe width=&quot;380&quot; height=&quot;250&quot; src=&quot;https://www.youtube.com/embed/OyxWVJQUC18?start=6&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div class=&quot;desc&quot;&gt;</pre><pre>&lt;center&gt;&lt;h1&gt;Title&lt;/h1&gt;&lt;/center&gt;</pre><pre>&lt;p&gt;Your content here&lt;/p&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/body&gt;</pre><pre>&lt;/html&gt;</pre><p>This is a very simple and basic template for a blog post, still we can add links to external sites and embed files.</p><figure><img alt="Blog post page" src="https://cdn-images-1.medium.com/max/797/1*bg7qAqmKJ1LDspr4KLTc7w.png" /></figure><h4><strong>Now coming to the most important part CSS styles for both main page and blog posts</strong></h4><p>We will first start with the main page styles <strong>main.css.</strong></p><pre>.intro{</pre><pre>height: 70%;</pre><pre>width: 100%;</pre><pre>background-image: url(https://medium.com/&quot;https://images.unsplash.com/photo-1490818387583-1baba5e638af?ixlib=rb-1.2.1&amp;w=1000&amp;q=80&quot;);</pre><pre>background-size: cover;</pre><pre>}</pre><pre>#name{</pre><pre>font-family: cursive;</pre><pre>padding-left:40%;</pre><pre>padding-top: 10%;</pre><pre>padding-bottom: 40%;</pre><pre>padding-right: 20%;</pre><pre>font-size:xx-large;</pre><pre>}</pre><pre>* {</pre><pre>box-sizing: border-box;</pre><pre>}</pre><pre>.column {</pre><pre>float: left;</pre><pre>width: 33%;</pre><pre>padding: 5px 5px;</pre><pre>}</pre><pre>.blog {margin: 0 -5px;}</pre><pre>.blog:after {</pre><pre>content: &quot;&quot;;</pre><pre>display: table;</pre><pre>clear: both;</pre><pre>}</pre><pre>.card {</pre><pre>box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); /* this adds the &quot;card&quot; effect */</pre><pre>padding: 16px;</pre><pre>text-align: center;</pre><pre>background-color: #f1f1f1;</pre><pre>}</pre><pre>@media screen and (max-width: 600px) {</pre><pre>.column {</pre><pre>width: 100%;</pre><pre>display: block;</pre><pre>margin-bottom: 20px;</pre><pre>}</pre><pre>img{</pre><pre>height:auto;</pre><pre>width: auto;</pre><pre>}</pre><pre>}</pre><pre>#about{</pre><pre>text-align: center;</pre><pre>font-size: x-large;</pre><pre>}</pre><pre>.aboutme{</pre><pre>padding-top: 5%;</pre><pre>padding-bottom: 5%;</pre><pre>}</pre><pre>#mypic{</pre><pre>border-radius: 50%;</pre><pre>}</pre><pre>.fa{</pre><pre>padding: 20px;</pre><pre>font-size: 30px;</pre><pre>width: 50px;</pre><pre>text-align: center;</pre><pre>text-decoration: none;</pre><pre>margin: 5px 2px;</pre><pre>border-radius: 50%</pre><pre>}</pre><pre>.fa:hover {</pre><pre>opacity: 0.7;</pre><pre>}</pre><pre>.fa-facebook {</pre><pre>background: #3B5998;</pre><pre>color: white;</pre><pre>}</pre><pre>.fa-instagram {</pre><pre>background: #125688;</pre><pre>color: white;</pre><pre>}</pre><p>Next I have added the styles for blog post template. <strong>post.css</strong></p><pre>.image{</pre><pre>position: absolute;</pre><pre>top: 5vh;</pre><pre>left: 3vw;</pre><pre>border-radius: 50%;</pre><pre>}</pre><pre>.video{</pre><pre>position: absolute;</pre><pre>left: 3vw;</pre><pre>bottom: 4vw;</pre><pre>}</pre><pre>.desc{</pre><pre>position: absolute;</pre><pre>margin-left: 12cm;</pre><pre>margin-top: 2cm;</pre><pre>margin-bottom: 2cm;</pre><pre>margin-right: 1cm;</pre><pre>box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.2); /* this adds the &quot;card&quot; effect */</pre><pre>text-align: center;</pre><pre>background-color: #f1f1f1;</pre><pre>}</pre><pre>.posts{</pre><pre>margin-top: 5px;</pre><pre>margin-bottom: 5px;</pre><pre>margin-left: 5px;</pre><pre>margin-right: 5px;</pre><pre>box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.2); /* this adds the &quot;card&quot; effect */</pre><pre>background-color: #f1f1f1;</pre><pre>}</pre><p>As of now I don’t want to confuse you with CSS explanation. If someone is more interested to learn about CSS selectors and styling attributes, you can visit <a href="https://www.w3schools.com/css/default.asp">www.w3schools.com</a></p><p>Now its very simple to add blog posts, after creating the blog post link it with the main page by adding the card component to the columns.</p><p>Thanks for reading my tutorial!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df2ff67ecb9b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create a simple Blog website using HTML and CSS only]]></title>
            <link>https://sharveshs.medium.com/how-to-create-a-simple-blog-website-using-html-and-css-only-1e2b264cb13a?source=rss-edb420b2d90------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e2b264cb13a</guid>
            <category><![CDATA[blog]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[novice-programmer]]></category>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[Sharvesh. S]]></dc:creator>
            <pubDate>Sat, 25 Jul 2020 15:05:09 GMT</pubDate>
            <atom:updated>2020-07-31T13:28:46.932Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is all about front end designing of a blog website using HTML and CSS. Here I’ll explain about creating the main page of the blog with blog posts preview, and how a blog page looks like. Then we will create a blog post page template, using which we can add our blog posts and link them with main page.<strong> This is for novice web developers and not for advanced web designers.</strong></p><p>Let’s start setting up the environment. We can use any editor like<strong> Notepad, Notepad++, Visual Studio Code, Sublime Text, Atom </strong>etc… and any browser of latest version is needed to view the output.</p><p>As a bonus I’ll also explain about hosting website using <strong><em>github.</em></strong></p><h4>Now we will start coding our index.html</h4><p>We will start with the header part of the website.</p><pre>&lt;html&gt;<br>   &lt;head&gt;<br>      &lt;title&gt;My-Blog&lt;/title&gt;<br>      &lt;link rel=&quot;icon&quot;     href=&quot;https://image.flaticon.com/icons/svg/13/13706.svg&quot; type=&quot;image/gif&quot; sizes=&quot;16x16&quot;&gt;<br>       &lt;link rel=&quot;stylesheet&quot; href=&quot;main.css&quot; &gt;</pre><pre>&lt;link rel=&quot;stylesheet&quot;  href=&quot;https://cdnjs.cloudflare.com/ajax/libs/font-  awesome/4.7.0/css/font-awesome.min.css&quot;&gt;</pre><pre>&lt;/head&gt;</pre><pre>&lt;body&gt;</pre><pre>&lt;div class=&quot;intro&quot;&gt;</pre><pre>&lt;p id=&quot;name&quot; name=&quot;intro&quot;&gt;Hello Friends Welcome to my Food Blog Site&lt;/p&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>Here we have just added a title, favicon for the browser tab and linked the css stylesheet and the favicon. Then we have added an image and a tag line or a welcome message which reperesents the theme of our blog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o-bQjLSK82tBKdsPMT0Pdg.png" /></figure><p>Next we will add the<strong> blog previews as a card component </strong>alligned in columns, which will have an image,title and a short description about the blog posts. Importantly this part will link the blog posts to our main page , the image here is the link to the main post.</p><pre>&lt;div&gt;<br>  &lt;br&gt;<br>    &lt;center&gt;<br>       &lt;h1&gt;My Blog Posts&lt;/h1&gt;<br>    &lt;/center&gt;<br>  &lt;br&gt;<br>&lt;/div&gt;<br>&lt;div class=&quot;blogs&quot;&gt;<br>  &lt;div class=&quot;column&quot;&gt;<br>    &lt;div class=&quot;card&quot;&gt;<br>       &lt;a href=&quot;post1.html&quot;&gt;<br>          &lt;img src=&quot;https://www.indianhealthyrecipes.com/wp-  content/uploads/2019/02/chicken-biryani-recipe-500x500.jpg&quot; alt=&quot;image&quot; height=&quot;300&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;<br>     &lt;h3&gt;Heading&lt;/h3&gt;<br>     &lt;p&gt;Some text&lt;/p&gt;<br>  &lt;/div&gt;<br> &lt;/div&gt;</pre><pre>&lt;div class=&quot;column&quot;&gt;</pre><pre>&lt;div class=&quot;card&quot;&gt;</pre><pre>&lt;img src=&quot;https://www.indianhealthyrecipes.com/wp-content/uploads/2019/02/chicken-biryani-recipe-500x500.jpg&quot; alt=&quot;image&quot; height=&quot;300&quot; width=&quot;400&quot;/&gt;</pre><pre>&lt;h3&gt;Heading&lt;/h3&gt;</pre><pre>&lt;p&gt;Some text&lt;/p&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div class=&quot;column&quot;&gt;</pre><pre>&lt;div class=&quot;card&quot;&gt;</pre><pre>&lt;img src=&quot;https://www.indianhealthyrecipes.com/wp-content/uploads/2019/02/chicken-biryani-recipe-500x500.jpg&quot; alt=&quot;image&quot; height=&quot;300&quot; width=&quot;400&quot;/&gt;</pre><pre>&lt;h3&gt;Heading&lt;/h3&gt;</pre><pre>&lt;p&gt;Some text&lt;/p&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div class=&quot;blogs&quot;&gt;</pre><pre>&lt;div class=&quot;column&quot;&gt;</pre><pre>&lt;div class=&quot;card&quot;&gt;</pre><pre>&lt;img src=&quot;&quot; height=&quot;300&quot; width=&quot;400&quot;/&gt;</pre><pre>&lt;h3&gt;Heading&lt;/h3&gt;</pre><pre>&lt;p&gt;Some text&lt;/p&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div class=&quot;column&quot;&gt;</pre><pre>&lt;div class=&quot;card&quot;&gt;</pre><pre>&lt;img src=&quot;&quot; height=&quot;300&quot; width=&quot;400&quot;/&gt;</pre><pre>&lt;h3&gt;Heading&lt;/h3&gt;</pre><pre>&lt;p&gt;Some text&lt;/p&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;div class=&quot;column&quot;&gt;</pre><pre>&lt;div class=&quot;card&quot;&gt;</pre><pre>&lt;img src=&quot;&quot; height=&quot;300&quot; width=&quot;400&quot;/&gt;</pre><pre>&lt;h3&gt;Heading&lt;/h3&gt;</pre><pre>&lt;p&gt;Some text&lt;/p&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SGr8WqG1k7qhAWRSyTbSmg.png" /></figure><p>Next we will add the <strong>About</strong> part, which will explain about author (You). We will add an image and some description about the author.</p><pre>&lt;div&gt;</pre><pre>&lt;center&gt;</pre><pre>&lt;h1&gt;About Me&lt;/h1&gt;</pre><pre>&lt;div&gt;</pre><pre>&lt;img src=&quot;https://images.unsplash.com/photo-1577219491135-ce391730fb2c?ixlib=rb-1.2.1&amp;ixid=eyJhcHBfaWQiOjEyMDd9&amp;w=1000&amp;q=80&quot; alt=&quot;MY pic&quot; height=&quot;400&quot; width=&quot;400&quot; id=&quot;mypic&quot;&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/center&gt;</pre><pre>&lt;br&gt;</pre><pre>&lt;p id=&quot;about&quot;&gt;I am a Foodie...&lt;/p&gt;</pre><pre>&lt;br&gt;</pre><pre>&lt;/div&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6fUbbvJqfTmKcvvdNqw0EQ.png" /></figure><p>We have reached the end of the main page and finally we are going to code the footer part which contains copyrights details and contact information</p><pre>&lt;footer&gt;</pre><pre>&lt;center&gt;</pre><pre>&lt;div&gt;</pre><pre>&lt;p&gt;Copyright &amp;copy; 2020 All Rights Reserved by Your Name &lt;/p&gt;</pre><pre>&lt;p&gt;Contact me by&lt;/p&gt;</pre><pre>&lt;a href=&quot;#&quot; class=&quot;fa fa-facebook&quot;&gt;&lt;/a&gt;</pre><pre>&lt;a href=&quot;#&quot; class=&quot;fa fa-instagram&quot;&gt;&lt;/a&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/center&gt;</pre><pre>&lt;/footer&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gk_PC5RfTaF5mtSLxs-ZJA.png" /></figure><p>Don’t worry about the CSS styles, in my next post I have given the styles and the template for the blog posts. Hope all who read this , understood the code. Will see in my next <a href="https://medium.com/@sharveshs/coding-the-post-page-and-adding-the-styles-df2ff67ecb9b"><strong>post</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e2b264cb13a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>