<?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>GitHub &#8211; Sibeesh Passion</title>
	<atom:link href="https://www.sibeeshpassion.com/tag/github/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Wed, 19 Aug 2020 10:34:43 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>GitHub &#8211; Sibeesh Passion</title>
	<link>https://www.sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Show Recent Blog Posts in GitHub ReadMe using Azure Function</title>
		<link>https://www.sibeeshpassion.com/show-recent-blog-posts-in-github-readme-using-azure-function/</link>
					<comments>https://www.sibeeshpassion.com/show-recent-blog-posts-in-github-readme-using-azure-function/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 20 Jul 2020 18:30:34 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Azure Function]]></category>
		<category><![CDATA[azure function to get latest blog feed]]></category>
		<category><![CDATA[custom github home page]]></category>
		<category><![CDATA[dynamic image with dynamic text writing c#]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[Github readme]]></category>
		<category><![CDATA[SixLabors.ImageSharp]]></category>
		<category><![CDATA[write text on image programatically]]></category>
		<guid isPermaLink="false">http://sibeeshpassion.com/?p=14165</guid>

					<description><![CDATA[I am showing the image of the titles of my recent 5 blog posts on my GitHub home page automatically. I did it using the Azure Function, Azure is Love, right?]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Introduction</h2>



<p>GitHub recently introduced an option to customize our profile by giving a separate magical repository. This repository name should be the same as your username, for example, https://github.com/SibeeshVenu/sibeeshvenu. This is how you can find this secret repository. </p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="650" height="177" src="/wp-content/uploads/2020/07/Secret-repository.png" alt="" class="wp-image-14167" srcset="/wp-content/uploads/2020/07/Secret-repository.png 650w, /wp-content/uploads/2020/07/Secret-repository-300x82.png 300w, /wp-content/uploads/2020/07/Secret-repository-425x116.png 425w" sizes="(max-width: 650px) 100vw, 650px" /><figcaption>GitHub secret repository</figcaption></figure>



<p>Now opens an endless opportunity that you can do to your GitHub home page, for example, I am showing the image of the titles of my recent 5 blog posts on my home page automatically. I did it using the Azure Function which will return the image and all I had to do in this repository, was to use it. Overall it was fun. </p>



<figure class="wp-block-image size-large"><img decoding="async" width="650" height="302" src="/wp-content/uploads/2020/07/Custom-github-home-page.png" alt="" class="wp-image-14168" srcset="/wp-content/uploads/2020/07/Custom-github-home-page.png 650w, /wp-content/uploads/2020/07/Custom-github-home-page-300x139.png 300w, /wp-content/uploads/2020/07/Custom-github-home-page-425x197.png 425w" sizes="(max-width: 650px) 100vw, 650px" /><figcaption>Custom GitHub home page</figcaption></figure>



<p>Here in this post, we will see how we can develop an Azure Function solution that returns the above-mentioned image.</p>



<h2 class="wp-block-heading">Develop an Azure function</h2>



<p>The first thing that you need to do, is to create a new Azure Function. Go to your Azure portal, and search for Azure Function, the creation process is the same and easy as we create any other Azure resources. If you are interested, you can check out my articles related to <a href="https://sibeeshpassion.com/tag/azure-function/" target="_blank" rel="noreferrer noopener">Azure Function here</a>.</p>



<p>Once you create the Azure function, you are good to go and develop an Azure function application in Visual Studio. Here I am using Visual Studio 2019. </p>



<figure class="wp-block-image size-large"><img decoding="async" width="650" height="702" src="/wp-content/uploads/2020/07/Create-Azure-function-using-visual-studio.jpg" alt="" class="wp-image-14169" srcset="/wp-content/uploads/2020/07/Create-Azure-function-using-visual-studio.jpg 650w, /wp-content/uploads/2020/07/Create-Azure-function-using-visual-studio-278x300.jpg 278w, /wp-content/uploads/2020/07/Create-Azure-function-using-visual-studio-425x459.jpg 425w" sizes="(max-width: 650px) 100vw, 650px" /><figcaption>Create Azure function using visual studio</figcaption></figure>



<p>We are going to create an HttpTrigger Azure function, so make sure you select that option on the next screen. If you need a basic introduction about the HttpTrigger Azure function, you can read this post <a href="https://sibeeshpassion.com/azure-function-as-output-job-topology-of-an-azure-stream-analytics-job/#play-with-azure-function" target="_blank" rel="noreferrer noopener">here</a>. I named my function as GetLatestPosts, and feel free to give any name you wish. This Azure function has the preceding jobs to do.</p>



<ol class="wp-block-list"><li>Get the latest posts details from the feed of my blog</li><li>Create an image with the feed data</li><li>Send back the image as a stream</li></ol>



<h3 class="wp-block-heading">Get the latest posts details from the feed</h3>



<p>You can usually get the feed data by going to {yoursitelink}/feed. For example, I can get my feed data by going to <a href="https://sibeeshpassion.com/feed/">https://sibeeshpassion.com/feed/</a>. So in our function, we will get this data using an XmlReader and Deserialize the same using SyndicationFeed. Please be noted that the Syndication namespace is part of the System.ServiceModel and you should install the Nuget package System.ServiceModel.Syndication. Preceding is the function to retrieve the latest 5 blog posts details.</p>



<script src="https://gist.github.com/SibeeshVenu/d994dd2c5b013333943dae3b52f1e961.js"></script>



<h3 class="wp-block-heading">Create an image with titles </h3>



<p>Now we need a function to generate an image and write the blog posts title to that image dynamically. To do this, we are using the Nuget package called  SixLabors.ImageSharp. Feel free to use any packages you like, the only thing that matters is that we need an image with the blog posts titles. The SixLabors.ImageSharp is indeed an amazing library, I can recommend you to give it a try. This is how your Nuget package installed window should look like now.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="536" src="/wp-content/uploads/2020/07/Required-Nuget-packages-1024x536.jpg" alt="" class="wp-image-14170" srcset="/wp-content/uploads/2020/07/Required-Nuget-packages-1024x536.jpg 1024w, /wp-content/uploads/2020/07/Required-Nuget-packages-300x157.jpg 300w, /wp-content/uploads/2020/07/Required-Nuget-packages-768x402.jpg 768w, /wp-content/uploads/2020/07/Required-Nuget-packages-425x222.jpg 425w, /wp-content/uploads/2020/07/Required-Nuget-packages.jpg 1495w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Required Nuget packages</figcaption></figure>



<p>Now we cna write the function as preceding.</p>



<script src="https://gist.github.com/SibeeshVenu/33b6e46ead886df91d533d9fe9c10ca2.js"></script>



<p>As you can see that there is a Configuration class, from where we take all the configurations. Let&#8217; write that now. You can also use Environment variables here, I may update my repository in the coming days.</p>



<script src="https://gist.github.com/SibeeshVenu/a5cbc95db906783e8b8319cb5f2d0f80.js"></script>



<p>The SixLabors.ImageSharp has an inbuilt extension function called ToBase64String, which will return the image as base64 string. Did you notice that we are using another extension method here, &#8220;ApplyScalingWaterMark&#8221;? Let&#8217;s create a class for our Extension methods so that it will be handy in the future. </p>



<script src="https://gist.github.com/SibeeshVenu/44f2c33e3294be08ba28b8c975712ad5.js"></script>



<h3 class="wp-block-heading">Azure function to return a stream</h3>



<p>As all the supporting methods are ready, let us write our main function, the ultimate job of this function is to convert the base64 string to a stream and return the stream. As simple as that. </p>



<script src="https://gist.github.com/SibeeshVenu/895d90a8d624d2ff663e8147e44a6b99.js"></script>



<p>Once your Azure function is ready, please remember to publish the same to Azure. To publish your Azure Function app, just right click on your project and click Publish and then set up your publish target by choosing the existing Azure Function App, remember we have created one earlier?&nbsp;</p>



<h2 class="wp-block-heading">Develop secret GitHub readme repository</h2>



<p>Here I am assuming that you already created your secret repository. And if yes, you can update the &#8220;readme&#8221; content as follows. Please remember this is just a sample, you can update as you wish.</p>



<script src="https://gist.github.com/SibeeshVenu/cab2f65acc9feb46ce991788118b4c31.js"></script>



<p>Boom!. We did it. Now go to your GitHub home page, and I am sure that you will love your new beautiful, detailed home page.</p>



<h2 class="wp-block-heading">Update</h2>



<p>As GitHub has a very low timeout, sometimes the image created was not showing in my profile. Thus, I had to change the mechanism. I changed my Azure function to a time trigger function that runs every hour and the main functionality of this function now is to generate the image and upload to the Azure blob storage. Now I can directly get the blob image URL in the Readme file. No more timeout issues. Preceding is the codes of the new Azure function. You can also see this in the Dev branch of the repository.</p>



<script src="https://gist.github.com/SibeeshVenu/026e07fe611f82c568658c1cfbbb1e08.js"></script>



<h2 class="wp-block-heading">Source Code</h2>



<p>Please feel free to check out the repositories here.</p>



<ul class="wp-block-list"><li><a href="https://github.com/SibeeshVenu/GitHubFuncs">https://github.com/SibeeshVenu/GitHubFuncs</a></li><li><a href="https://github.com/SibeeshVenu/sibeeshvenu">https://github.com/SibeeshVenu/sibeeshvenu</a></li></ul>



<h2 class="wp-block-heading">About the Author</h2>



<p>I am yet another developer who is passionate about writing and video creation. I have written close to 500 blogs on my&nbsp;<a href="https://sibeeshpassion.com/" target="_blank" rel="noreferrer noopener">blog</a>. And I upload videos on my YouTube channels&nbsp;<a href="https://www.youtube.com/njanorumalayali" target="_blank" rel="noreferrer noopener">Njan Oru Malayali</a>&nbsp;and&nbsp;<a href="https://www.youtube.com/SibeeshPassion" target="_blank" rel="noreferrer noopener">Sibeesh Passion</a>. Please feel free to follow me.</p>



<ul class="wp-block-list"><li><a href="https://github.com/SibeeshVenu">GitHub</a></li><li><a href="https://medium.com/@sibeeshvenu">medium</a></li><li><a href="https://twitter.com/sibeeshvenu">Twitter</a></li></ul>



<h2 class="wp-block-heading">Your turn. What do you think?</h2>



<p>Thanks a lot for reading. Did I miss anything that you may think which is needed in this article? Could you find this post useful? Kindly do not forget to share your feedback.</p>



<p>Kindest Regards<br>Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/show-recent-blog-posts-in-github-readme-using-azure-function/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Publish Your Angular GitHub Repository as a GitHub Page</title>
		<link>https://www.sibeeshpassion.com/publish-your-angular-github-repository-as-a-github-page/</link>
					<comments>https://www.sibeeshpassion.com/publish-your-angular-github-repository-as-a-github-page/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 22 Apr 2019 12:55:38 +0000</pubDate>
				<category><![CDATA[Angular]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[GitHub Pages]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=13642</guid>

					<description><![CDATA[[toc] Introduction In this article, we will see how we can publish one of our GitHub repository as a GitHub page. We will be discussing the problems I have faced while doing so, with screenshots. If you are ready, let&#8217;s just go ahead and create the page. Background I am sure that there are many related articles available on internet, but some of them are only explaining the steps to achieve this, but not the problems faced, so I thought I could write about the problems I faced while creating a page for my GitHub repository. Prerequisites A User/Organization GitHub [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>[toc]</p>



<h2 class="wp-block-heading">Introduction </h2>



<p>In this article, we will see how we can publish one of our GitHub repository as a GitHub page. We will be discussing the problems I have faced while doing so, with screenshots. If you are ready, let&#8217;s just go ahead and create the page. </p>



<h2 class="wp-block-heading">Background</h2>



<p>I am sure that there are many related articles available on internet, but some of them are only explaining the steps to achieve this, but not the problems faced, so I thought I could write about the problems I faced while creating a page for my GitHub repository.</p>



<h2 class="wp-block-heading">Prerequisites </h2>



<ol class="wp-block-list"><li>A User/Organization GitHub account</li><li>An Angular repository</li></ol>



<h2 class="wp-block-heading">Publish GitHub Page</h2>



<h3 class="wp-block-heading">Selecting the repository</h3>



<p>In this phase, you can select any Angular repository you have in your profile. I am going to select my repository <a href="https://github.com/SibeeshVenu/Azure-AI-Image-Text-Reader">Azure-AI-Image-Text-Reader</a>.</p>



<h3 class="wp-block-heading">Creating the GitHub page</h3>



<p>Now let&#8217;s build our repository. Please make sure to change the base href property of your index.html file. Usually the value of the base href is &#8220;/&#8221;, now we are going to change the same with the argument  <br><em>&#8211;base-href</em> in our build command. </p>



<pre class="wp-block-code"><code>ng build --prod --base-href "https://sibeeshvenu.com/Azure-AI-Image-Text-Reader/"</code></pre>



<p>I am already using GitHub page for my user account and I have also enabled the custom domain for the same, that is the reason why I had given the custom URL in the base href. In your case, you should provide the URL as https://&lt;username&gt;.github.io/&lt;repositoryName&gt;/</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p> <br>Please do not remove the slash (/) at the last of the URL and also remember that the repository name is case sensitive.  </p><cite>Case sensitive repository URL</cite></blockquote>



<p>The above command will create a new folder if you are using angular cli 6 or the above, the folder name will be the project name specified in the angular.json file.</p>



<pre class="wp-block-code"><code>{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "azure-ai-image-text-reader": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "prefix": "app",
      "schematics": {
        "@schematics/angular:component": {
          "styleext": "scss"
        }
      }
}</code></pre>



<p>With the help of the npm package  angular-cli-ghpages, we can easily upload the build contents to our repository. </p>



<pre class="wp-block-code"><code>npm i angular-cli-ghpages --save-dev</code></pre>



<p>And then use the command below.</p>



<pre class="wp-block-code"><code>npx ngh --dir=dist/Azure-AI-Image-Text-Reader</code></pre>



<p>

If you are not sure about the difference between npm and npx, I recommend you to read my article <a href="https://medium.com/@sibeeshvenu/npm-vs-npx-f737dea2fb4">here</a>.

</p>



<p>Here the &#8211;dir property is used to specify the folder where the build contents are generated. Please be noted that by default the directory name is dist, so if your angular cli version is below 6, you don&#8217;t need to specify the folder name.</p>



<p>If you are getting an error as preceding, while you run the ngh command, please make sure that you had installed the package </p>



<pre class="wp-block-code"><code>PS C:\Users\SibeeshVenu\source\repos\Azure-AI-Image-Text-Reader> npx ngh --dir='dist/azure-ai-image-text-reader' --branch=page
npx: installed 87 in 8.588s
Path must be a string. Received undefined
(node:16984) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.</code></pre>



<p>Once the task is done, we can go to our repository settings and activate the GitHub page for our repository. Click on the settings and go to the section GitHub Pages.</p>



<figure class="wp-block-image"><img decoding="async" width="650" height="530" src="https://sibeeshpassion.com/wp-content/uploads/2019/04/GitHub-Page-Settings.png" alt="" class="wp-image-13644" srcset="/wp-content/uploads/2019/04/GitHub-Page-Settings.png 650w, /wp-content/uploads/2019/04/GitHub-Page-Settings-300x245.png 300w, /wp-content/uploads/2019/04/GitHub-Page-Settings-400x326.png 400w" sizes="(max-width: 650px) 100vw, 650px" /><figcaption>GitHub Pages Settings</figcaption></figure>



<p>Now you can go to the page URL and check whether you angular application is loading correctly or not. In my case, I can go to the URL  <br><a href="https://sibeeshvenu.github.io/Azure-AI-Image-Text-Reader/">https://sibeeshvenu.github.io/Azure-AI-Image-Text-Reader/</a>  or  <br><a href="https://sibeeshvenu.github.io/Azure-AI-Image-Text-Reader/">https://sibeeshvenu.com/Azure-AI-Image-Text-Reader/</a> </p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>Wow!. Now we have learned, how we can publish a GitHub page of our GitHub repository. We have also covered possible small mistakes and the remedies for the same.</p>



<h2 class="wp-block-heading">Your turn. What do you think?</h2>



<p>Thanks a lot for reading. Did I miss anything that you may think which is needed in this article? Could you find this post as useful? Kindly do not forget to share me your feedback.</p>



<p>Kindest Regards<br>Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sibeeshpassion.com/publish-your-angular-github-repository-as-a-github-page/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
