Compare commits
	
		
			2 Commits
		
	
	
		
			f25cb39b50
			...
			70bcddf210
		
	
	| Author | SHA1 | Date | 
|---|---|---|
|  | 70bcddf210 | |
|  | 67e1ad61aa | 
|  | @ -1,7 +1,7 @@ | |||
| --- | ||||
| title: "Crash Course to LXD" | ||||
| subtitle: "Quick instructions for installing LXD and setting up your first application." | ||||
| date: 2023-09-18T22:30:07-04:00 | ||||
| date: 2023-09-19T14:27:00-04:00 | ||||
| categories: | ||||
|   - Technology | ||||
| tags: | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| --- | ||||
| title: "LXD: Containers for Human Beings" | ||||
| subtitle: "Docker's great and all, but I prefer the workflow of interacting with VMs" | ||||
| date: 2023-09-17T18:04:00-04:00 | ||||
| date: 2023-09-19T14:26:00-04:00 | ||||
| categories: | ||||
|   - Technology | ||||
| tags: | ||||
|  |  | |||
							
								
								
									
										97
									
								
								justfile
								
								
								
								
							
							
						
						
									
										97
									
								
								justfile
								
								
								
								
							|  | @ -1,5 +1,6 @@ | |||
| # Build everything then deploy
 | ||||
| default: site (docs "pdf") (docs "epub") (docs "txt") images deploy | ||||
| # default: site (docs "pdf") (docs "epub") (docs "txt") images deploy
 | ||||
| default: site images deploy | ||||
| 
 | ||||
| # Deploy website
 | ||||
| deploy: | ||||
|  | @ -12,53 +13,53 @@ site: | |||
|     # Building website ... | ||||
|     hugo --quiet | ||||
| 
 | ||||
| # Build documents of filetype ext
 | ||||
| docs ext: | ||||
|     #!/usr/bin/env bash | ||||
| 
 | ||||
|     echo -e '\033[1m# Checking whether there are new {{uppercase(ext)}}s to generate ...\033[0m' | ||||
| 
 | ||||
|     export WEBROOT=public | ||||
| 
 | ||||
|     published=$(grep -ilr --include \*.md "draft: false" content) | ||||
| 
 | ||||
|     todo="" | ||||
| 
 | ||||
|     # Iterate through all non-drafts | ||||
|     for path in $published | ||||
|     do | ||||
|         filename=$(basename "$path") | ||||
|         name=$(echo "${filename%.*}") | ||||
|         # Check whether target doc is newer than Markdown file | ||||
|         if [ "$path" -nt "public/$name/$name.{{ext}}" ] | ||||
|         then | ||||
|             todo+="$path " | ||||
|         fi | ||||
|     done | ||||
| 
 | ||||
|     if [ -z "$todo" ] | ||||
|     then | ||||
|         echo "No {{uppercase(ext)}}s to generate" | ||||
|         exit 0 | ||||
|     else | ||||
|         for path in $todo | ||||
|         do | ||||
|             filename=$(basename "$path") | ||||
|             name=$(echo "${filename%.*}") | ||||
|             echo "Generating $name.{{ext}}" | ||||
| 
 | ||||
|             if [ "{{ext}}" == "pdf" ] | ||||
|             then | ||||
|                 pandoc --quiet -f markdown -t pdf --lua-filter=pandoc_config/images.lua --pdf-engine=xelatex -V 'linkcolor:blue' --listings -H pandoc_config/styles.tex $path -o public/$name/$name.pdf | ||||
|             elif [ "{{ext}}" == "epub" ] | ||||
|             then | ||||
|                 pandoc --quiet -f markdown -t epub3 --lua-filter=pandoc_config/images.lua --pdf-engine=xelatex -V 'linkcolor:blue' --listings -H pandoc_config/styles.tex $path -o public/$name/$name.epub | ||||
|             elif [ "{{ext}}" == "txt" ] | ||||
|             then | ||||
|                 pandoc --quiet -f markdown -t plain --lua-filter=pandoc_config/images.lua $path -o public/$name/$name.txt | ||||
|             fi | ||||
|         done | ||||
|     fi | ||||
| ## Build documents of filetype ext
 | ||||
| #docs ext:
 | ||||
| #    #!/usr/bin/env bash
 | ||||
| #
 | ||||
| #    echo -e '\033[1m# Checking whether there are new {{uppercase(ext)}}s to generate ...\033[0m'
 | ||||
| #
 | ||||
| #    export WEBROOT=public
 | ||||
| #
 | ||||
| #    published=$(grep -ilr --include \*.md "draft: false" content)
 | ||||
| #
 | ||||
| #    todo=""
 | ||||
| #
 | ||||
| #    # Iterate through all non-drafts
 | ||||
| #    for path in $published
 | ||||
| #    do
 | ||||
| #        filename=$(basename "$path")
 | ||||
| #        name=$(echo "${filename%.*}")
 | ||||
| #        # Check whether target doc is newer than Markdown file
 | ||||
| #        if [ "$path" -nt "public/$name/$name.{{ext}}" ]
 | ||||
| #        then
 | ||||
| #            todo+="$path "
 | ||||
| #        fi
 | ||||
| #    done
 | ||||
| #
 | ||||
| #    if [ -z "$todo" ]
 | ||||
| #    then
 | ||||
| #        echo "No {{uppercase(ext)}}s to generate"
 | ||||
| #        exit 0
 | ||||
| #    else
 | ||||
| #        for path in $todo
 | ||||
| #        do
 | ||||
| #            filename=$(basename "$path")
 | ||||
| #            name=$(echo "${filename%.*}")
 | ||||
| #            echo "Generating $name.{{ext}}"
 | ||||
| #
 | ||||
| #            if [ "{{ext}}" == "pdf" ]
 | ||||
| #            then
 | ||||
| #                pandoc --quiet -f markdown -t pdf --lua-filter=pandoc_config/images.lua --pdf-engine=xelatex -V 'linkcolor:blue' --listings -H pandoc_config/styles.tex $path -o public/$name/$name.pdf
 | ||||
| #            elif [ "{{ext}}" == "epub" ]
 | ||||
| #            then
 | ||||
| #                pandoc --quiet -f markdown -t epub3 --lua-filter=pandoc_config/images.lua --pdf-engine=xelatex -V 'linkcolor:blue' --listings -H pandoc_config/styles.tex $path -o public/$name/$name.epub
 | ||||
| #            elif [ "{{ext}}" == "txt" ]
 | ||||
| #            then
 | ||||
| #                pandoc --quiet -f markdown -t plain --lua-filter=pandoc_config/images.lua $path -o public/$name/$name.txt
 | ||||
| #            fi
 | ||||
| #        done
 | ||||
| #    fi
 | ||||
| 
 | ||||
| # Generate cover images
 | ||||
| images: | ||||
|  |  | |||
|  | @ -4,7 +4,6 @@ | |||
|         <div class="frontmatter"> | ||||
|             <h1 class="post-title" style="view-transition-name: post-title-{{ .Title | urlize }}"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1> | ||||
|             <p style="view-transition-name: post-meta-{{ .Title | urlize }}"><strong>Reading Time:</strong> {{ .ReadingTime }} minutes | <strong>Published:</strong> {{ dateFormat "2006-01-02" .Date }} | <strong>Last Edited:</strong> {{ dateFormat "2006-01-02" .Lastmod }}</a></p> | ||||
|             <p><strong>Download this post as:</strong> <a href="{{ .Permalink | replaceRE "^[^/]+://[^/]+/(.*)/$" "$1" }}.pdf">PDF,</a> <a href="{{ .Permalink | replaceRE "^[^/]+://[^/]+/(.*)/$" "$1" }}.epub">EPUB,</a> or <a href="{{ .Permalink | replaceRE "^[^/]+://[^/]+/(.*)/$" "$1" }}.txt">plaintext</a></p> | ||||
|             {{- if .Params.tags }} | ||||
|             <p class="tags"> | ||||
|                 {{ $title := .Title }} | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue