GithubHelp home page GithubHelp logo

nidhihemanth.github.io's Introduction

Nidhi's Personal Website

This repository contains the code of my personal blog, built using hugo-PaperMod and Github Pages.

Check out my website at nidhihemanth.github.io๐Ÿ‘‹

How to run this project locally?

1) Installing pre-requisites

Visit here for detailed instructions.

2) Set up the project locally

Clone the project on your local machine.

For example, using https git clone https://github.com/nidhihemanth/nidhihemanth.github.io.git

3) Run the hugo server

Open the command line in the cloned directory.

Run hugo server which will run the application locally on the default port http://localhost:1313/

Now you can view & test your changes locally before deploying it ๐Ÿœ

How to create your own website using Hugo & Github Pages?

Hugo is a fast and modern static site generator written in Go, and designed to make website creation fun again.

Hugo provides us a wide variety of themes which makes it easier to create & maintain simple websites. The theme used in this repository is called PaperMod.

1) Create a new site using Hugo

We assume all the prerequisites have already been installed.

  1. Create a new site using the command hugo new site <name of site> --format yaml in your command line.
  2. Change current directory to project directory using cd <name of site>. This creates the directory structure of our project.
  3. Add the desired theme to your project by executing the following commands
    git clone https://github.com/adityatelange/hugo-PaperMod themes/PaperMod --depth=1
    cd themes/PaperMod
    git pull
    
  4. From the root directory execute the following command to add the theme as a submodule to your repository.
    git submodule add --depth=1 https://github.com/adityatelange/hugo-PaperMod.git themes/PaperMod
    
    Replace the links in step 3 & 4 to the github repository of your desired theme.
  5. Update the theme in your hugo.yaml file by setting the theme as theme: "PaperMod"

2) Create & push code to a new repository

  1. Initialise the project as git repository executing git init from the root directory of the hugo site.
  2. Create a new repository on Github and name it as <username>.github.io. This will be the URL of your GitHub Pages website.
  3. In the hugo.yoml file update baseURL to point to your github page baseURL: "https://<username>.github.io"
  4. Push the hugo site to the empty Github repository
    git remote add origin https://github.com/<username>/<username>.github.io.git
    git branch -M main
    git commit -m "first commit"
    git push -u origin main
    

Additionally, create new pages using hugo new <filename> on your website, refer to your respective theme documentations for detailed instructions.

3) Configure Github Actions to Publish to the Github Pages

  1. Manually create a new branch in the Github repository named gh-pages. This is the branch github pages will fetch from.
  2. Allow Read and Write Permissions on the Workflow under Settings > Actions > General > Workflow permissions
  3. Set the GitHub Pages site to build from the gh-pages branch under Settings > Pages > Build and deployment
  4. Define custom github actions to fetch code from the main branch and create a static site in the gh-pages branch.
    • For that add the following file under with the same directory structure .github/workflows/deploy.yml under your project root directory.
    • (You might want to change the version of hugo being downloaded to the latest version in the curl command under "Setup Hugo")

Github automatically deploys the code at https://<username>.github.io

To deploy your website under a custom Domain Name refer to this article.

nidhihemanth.github.io's People

Contributors

nidhihemanth avatar

Watchers

 avatar

Forkers

sn99

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.