diff options
author | David Luevano Alvarado <david@luevano.xyz> | 2021-02-27 03:32:13 -0700 |
---|---|---|
committer | David Luevano Alvarado <david@luevano.xyz> | 2021-02-27 03:32:13 -0700 |
commit | 3aea44014574efbb1fc7a2696ee1ee74c40fa95f (patch) | |
tree | a5507a04b8363d5e5a24b46d62a84dc7ea018d7b | |
parent | ce697763c56a613ec36521c76a952efb92add2fc (diff) |
Add script to get header and footer for ssg
-rw-r--r-- | .config/nvim/init.vim | 2 | ||||
-rwxr-xr-x | .local/bin/sshf | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 927329e..d0ab8e1 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -170,7 +170,7 @@ set showcmd \ set fileformat=unix " Some filetypes that require 2 spaces for tabs. (xml/html like) - au BufEnter,BufNewFile,BufRead *.xml,*.html,*.jsp,*.wsdl,*.xsd,*.yaml,*.yml + au BufEnter,BufNewFile,BufRead *.xml,*.html,*.jsp,*.wsdl,*.xsd,*.yaml,*.yml,*.css \ set tabstop=2 | \ set softtabstop=2 | \ set shiftwidth=2 | diff --git a/.local/bin/sshf b/.local/bin/sshf new file mode 100755 index 0000000..85a0055 --- /dev/null +++ b/.local/bin/sshf @@ -0,0 +1,13 @@ +#!/bin/sh + +# Get the _header.html and _footer.html required for ssg from an already defined html. +main() { + in_file="${1:-$HOME/dox/www/luevano.xyz/luevano/index.html}" + out_folder="${2:-$HOME/dow/www/blog/src/}" + + sed '/<\/header/q' $in_file > $out_folder/_header.html + # Not proud of this, lol. + tac $in_file | sed '/<footer/q' | tac > $out_folder/_footer.html +} + +main "$@" |