Hugo Cheat Sheet

May 17, 2018 1 min read
  • Content
    • Posting
      • hugo new blog/2018/my-first-post.md
      • hugo new notes/2020/how-to.md
    • Font Awesome
      • <i class="fas fa-lemon" aria-hidden="true"></i>
    • List all files in a directory in 1 column (bash only)
      • ls -1
  • Testing
    • hugo server
    • http://localhost:1313
  • Build

    1. Remove old files
      rmdir /S /Q public
    2. Build site
      hugo -b https://www.tehlemon.com
    3. Remove unused theme files

          rmdir /S /Q public\fonts  
          del public\images\avatar.png  
          del public\images\[email protected]  
      
    4. Push to production repo

      cd public  
      set /p commitmsg="Enter a commit message: "  
      git add --all .  
      git commit -m "%commitmsg%"  
      git push origin master  
      
  • Theming

    • Adding Pages
      1. Add to nav.html in /layouts/partials/
      2. Add to config.toml
      3. Add folder to /content/