My First Post


This website was created using the Hugo static site generator.

These are the steps I followed to create a GitHub repository and setup my website using Hugo:

  1. From a macOS terminal I installed Hugo using Homebrew and then setup a basic Hugo website with my fork of the beautifulhugo theme by running:

    brew install hugo
    
    hugo new site jvincent-website
    
    cd jvincent-website
    git init 
    git-secrets --install
    git submodule add https://github.com/jvincentnz/beautifulhugo.git themes/beautifulhugo
    
  2. Create a .gitignore file to have the following content:

     # macOS Internals
     .DS_Store
    
     # Website content generated by Hugo build
     /public
    
     # Hugo Build Lock file
     .hugo_build.lock
    
  3. Create a README.md file to describe the GitHub repository.

  4. Create a LICENSE.txt file for the GitHub repository.

  5. Edit the config.toml file to have the following content:

     baseURL = "https://jeremyvincent.com/"
     languageCode = "en"
     title = "Jeremy Vincent's Website"
     theme = "beautifulhugo"
    
     pygmentsUseClasses = true
     pygmentsCodeFences = true
     pygmentsCodefencesGuessSyntax = true
     #pygmentsStyle = "monokai"
     #pygmentsUseClassic = true
     #pygmentOptions = "linenos=inline"
     #disqusShortname = "XXX"
     #googleAnalytics = "XXX"
    
     enableGitInfo = true
     [Params]
       commit = "https://github.com/jvincentnz/jvincent-website/tree/"
       # homeTitle = "Beautiful Hugo Theme" # Set a different text for the header on the home page
       # subtitle = "Build a beautiful and simple website in minutes"
       mainSections = ["post","posts"]
       # logo = "img/avatar-icon.png" # Expecting square dimensions
       # favicon = "img/favicon.ico"
       # dateFormat = "January 1, 2020"
       # commit = false
       rss = true
       # comments = true
       readingTime = true
       wordCount = true
       useHLJS = false
       socialShare = true
       # delayDisqus = true
       showRelatedPosts = true
       # hideAuthor = true
       # gcse = "012345678901234567890:abcdefghijk" # Get your code from google.com/cse. Make sure to go to "Look and Feel" and change Layout to "Full Width" and Theme to "Classic"
    
     [Author]
       name = "Jeremy Vincent"
       website = "https://jeremyvincent.com/"
       email = "jeremy.vincent@gmail.com"
       facebook = "jeremy.vincent.129794"
       github = "jvincentnz"
       #gitlab = "username"
       #bitbucket = "username"
       twitter = "jvincentnz"
       linkedin = "vincentjeremy"
    
     [permalinks]
       posts = "/:year/:month/:title/"
    
  6. Run the following from a macOS terminal to Generate Syntax Highlighter CSS for Chroma using Hugo with the monokai style:

    mkdir static/css
    hugo gen chromastyles --style=monokai > static/css/syntax.css
    
  7. Create the first post by running the following from a macOS terminal:

    hugo new posts/my-first-post.md
    
  8. Edit posts/my-first-post.md with your first post content using a Markdown editor!

  9. Test your new static website on your local computer by running the following from the macOS terminal to start the Hugo webserver with draft content enabled:

    hugo server -D
    
  10. And then browse to http://localhost:1313/ in your web browser.

  11. After you have finished testing your website, press Control-C to stop the Hugo webserver.

  12. Update the draft: true field in your first post posts/my-first-post.md file to be draft: false so it will be published when running hugo without the draft content enabled option:

     ---
     title: "My First Post"
     date: 2020-04-11T15:01:31+12:00
     draft: false
     ---
    
  13. Commit your website content to your GitHub repository by running the following from the macOS terminal:

    git add .
    git commit -m "Initial commit"
    git remote add origin https://github.com/jvincentnz/jvincent-website.git
    git push -u origin master
    
  14. Create the static website content in the public/ directory by running the following from the macOS terminal:
    NOTE: Only content marked non-draft will be generated.

    hugo
    
  15. Now you can publish your static website from the public/ directory to your S3 website enabled bucket.


See also