<?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 Pages &#8211; Sibeesh Passion</title>
	<atom:link href="https://www.sibeeshpassion.com/tag/github-pages/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Mon, 22 Apr 2019 13:00:25 +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 Pages &#8211; Sibeesh Passion</title>
	<link>https://www.sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<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 fetchpriority="high" 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>
