How to use environment variables in Github Page?

Edited June 2020 Reference @alicia-jasmine “React is purely a front-end framework. Everything accessible to React (even if you embed it through a build step) will later be visible in the front-end code and someone relatively basic to find. To really keep them secret you MUST have something server side!” The following answer will actually expose … Read more

React Router not working with Github Pages

If deploying to GitHub, ensure there is a “homepage” entry for where you are hosting it in Github. Example: “homepage”: “https://github.com/amodhakal/portfolio”, Switch to the HashRouter since GitHub pages doesn’t support the tech used by the BrowserRouter. index import React from ‘react’; import ReactDOM from ‘react-dom/client’; import { HashRouter } from ‘react-router-dom’ import App from ‘./App’; … Read more

Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g [duplicate]

You need to merge the remote branch into your current branch by running git pull. If your local branch is already up-to-date, you may also need to run git pull –rebase. A quick google search also turned up this same question asked by another SO user: Cannot push to GitHub – keeps saying need merge. … Read more

Showing C# tags in Jekyll Github pages using Highlight.js

Jekyll has highlight tag and css (_sass/_syntax-highlighting.scss) onboard. {% highlight csharp %} /// <summary> /// Main class of the project /// </summary> class Program { /// <summary> /// Main entry point of the program /// </summary> /// <param name=”args”>Command line args</param> static void Main(string[] args) { //Do stuff } } {% endhighlight %} This works … Read more

How to add color to GitHub’s README.md file

One way to add color to a README is by utilising a service that provides placeholder images. For example this Markdown can be used: – ![#f03c15](https://via.placeholder.com/15/f03c15/f03c15.png) `#f03c15` – ![#c5f015](https://via.placeholder.com/15/c5f015/c5f015.png) `#c5f015` – ![#1589F0](https://via.placeholder.com/15/1589F0/1589F0.png) `#1589F0` To create a list of any colors you like: #f03c15 #c5f015 #1589F0