I have following global git configs:
git config commit.gpgsign # true for work, false for personal git config user.name # different for work(global) and personal git config user.email # different for work(global) and personal Assuming the default(global) git config is my work related configs, which I dont want to use for personal git repos
So I can switch to personal every time I work on a personal project. To change all the 3 with predetermined values, use following shell script....
Bash Script to create new page (MD File) in Hugo
Based on the way described in a previous article, following shell script can be run to create new md file (new blog post) based on archetype.
#!/bin/sh echo "Enter post title (.md will be automatically added)" echo "Post title: " read posttitle hugo new -k post posts/$posttitle.md running this will create a new md file in /content/posts based on the archetype in /archetype
Create a file called new.sh and place this ....
Hugo: Batch script to deploy to GitHub after cleaning the output public dir (static-site's root)
Following the “2 repo” approach of hugo site as described in previous post How to create Hugo Blog hosted on GitHub:
First repo for hugo-project Second repo for the static site (public dir in hugo project is created as git submodule I came across this approach first here.
When using this approach, I tried to do cleanup of public directory after some inital builds, because in previous builds they were many folders and files created which I no longer wanted to be present on root of generated site(these were things like multiple folders for images - later I wanted to put all images under single directory), but in subsequent builds using hugo command these files and directories were not getting removed....