Remove downloading posts as files because broken
This commit is contained in:
		
							parent
							
								
									67e1ad61aa
								
							
						
					
					
						commit
						70bcddf210
					
				
							
								
								
									
										97
									
								
								justfile
								
								
								
								
							
							
						
						
									
										97
									
								
								justfile
								
								
								
								
							| 
						 | 
					@ -1,5 +1,6 @@
 | 
				
			||||||
# Build everything then deploy
 | 
					# 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 website
 | 
				
			||||||
deploy:
 | 
					deploy:
 | 
				
			||||||
| 
						 | 
					@ -12,53 +13,53 @@ site:
 | 
				
			||||||
    # Building website ...
 | 
					    # Building website ...
 | 
				
			||||||
    hugo --quiet
 | 
					    hugo --quiet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Build documents of filetype ext
 | 
					## Build documents of filetype ext
 | 
				
			||||||
docs ext:
 | 
					#docs ext:
 | 
				
			||||||
    #!/usr/bin/env bash
 | 
					#    #!/usr/bin/env bash
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
    echo -e '\033[1m# Checking whether there are new {{uppercase(ext)}}s to generate ...\033[0m'
 | 
					#    echo -e '\033[1m# Checking whether there are new {{uppercase(ext)}}s to generate ...\033[0m'
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
    export WEBROOT=public
 | 
					#    export WEBROOT=public
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
    published=$(grep -ilr --include \*.md "draft: false" content)
 | 
					#    published=$(grep -ilr --include \*.md "draft: false" content)
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
    todo=""
 | 
					#    todo=""
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
    # Iterate through all non-drafts
 | 
					#    # Iterate through all non-drafts
 | 
				
			||||||
    for path in $published
 | 
					#    for path in $published
 | 
				
			||||||
    do
 | 
					#    do
 | 
				
			||||||
        filename=$(basename "$path")
 | 
					#        filename=$(basename "$path")
 | 
				
			||||||
        name=$(echo "${filename%.*}")
 | 
					#        name=$(echo "${filename%.*}")
 | 
				
			||||||
        # Check whether target doc is newer than Markdown file
 | 
					#        # Check whether target doc is newer than Markdown file
 | 
				
			||||||
        if [ "$path" -nt "public/$name/$name.{{ext}}" ]
 | 
					#        if [ "$path" -nt "public/$name/$name.{{ext}}" ]
 | 
				
			||||||
        then
 | 
					#        then
 | 
				
			||||||
            todo+="$path "
 | 
					#            todo+="$path "
 | 
				
			||||||
        fi
 | 
					#        fi
 | 
				
			||||||
    done
 | 
					#    done
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
    if [ -z "$todo" ]
 | 
					#    if [ -z "$todo" ]
 | 
				
			||||||
    then
 | 
					#    then
 | 
				
			||||||
        echo "No {{uppercase(ext)}}s to generate"
 | 
					#        echo "No {{uppercase(ext)}}s to generate"
 | 
				
			||||||
        exit 0
 | 
					#        exit 0
 | 
				
			||||||
    else
 | 
					#    else
 | 
				
			||||||
        for path in $todo
 | 
					#        for path in $todo
 | 
				
			||||||
        do
 | 
					#        do
 | 
				
			||||||
            filename=$(basename "$path")
 | 
					#            filename=$(basename "$path")
 | 
				
			||||||
            name=$(echo "${filename%.*}")
 | 
					#            name=$(echo "${filename%.*}")
 | 
				
			||||||
            echo "Generating $name.{{ext}}"
 | 
					#            echo "Generating $name.{{ext}}"
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
            if [ "{{ext}}" == "pdf" ]
 | 
					#            if [ "{{ext}}" == "pdf" ]
 | 
				
			||||||
            then
 | 
					#            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
 | 
					#                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" ]
 | 
					#            elif [ "{{ext}}" == "epub" ]
 | 
				
			||||||
            then
 | 
					#            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
 | 
					#                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" ]
 | 
					#            elif [ "{{ext}}" == "txt" ]
 | 
				
			||||||
            then
 | 
					#            then
 | 
				
			||||||
                pandoc --quiet -f markdown -t plain --lua-filter=pandoc_config/images.lua $path -o public/$name/$name.txt
 | 
					#                pandoc --quiet -f markdown -t plain --lua-filter=pandoc_config/images.lua $path -o public/$name/$name.txt
 | 
				
			||||||
            fi
 | 
					#            fi
 | 
				
			||||||
        done
 | 
					#        done
 | 
				
			||||||
    fi
 | 
					#    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Generate cover images
 | 
					# Generate cover images
 | 
				
			||||||
images:
 | 
					images:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,7 +4,6 @@
 | 
				
			||||||
        <div class="frontmatter">
 | 
					        <div class="frontmatter">
 | 
				
			||||||
            <h1 class="post-title" style="view-transition-name: post-title-{{ .Title | urlize }}"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
 | 
					            <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 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 }}
 | 
					            {{- if .Params.tags }}
 | 
				
			||||||
            <p class="tags">
 | 
					            <p class="tags">
 | 
				
			||||||
                {{ $title := .Title }}
 | 
					                {{ $title := .Title }}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue