reado to impl merge

master
Bel LaPointe 2021-11-29 14:20:04 -07:00
parent 17f71427e7
commit 348b95df0f
7 changed files with 159 additions and 10 deletions

View File

@ -0,0 +1 @@
<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><style type="text/css">ol{margin:0;padding:0}table td,table th{padding:0}.c1{color:#000000;font-weight:400;text-decoration:none;vertical-align:baseline;font-size:11pt;font-family:"Arial";font-style:normal}.c0{padding-top:0pt;padding-bottom:0pt;line-height:1.15;orphans:2;widows:2;text-align:left}.c2{background-color:#ffffff;max-width:468pt;padding:72pt 72pt 72pt 72pt}.title{padding-top:0pt;color:#000000;font-size:26pt;padding-bottom:3pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}.subtitle{padding-top:0pt;color:#666666;font-size:15pt;padding-bottom:16pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}li{color:#000000;font-size:11pt;font-family:"Arial"}p{margin:0;color:#000000;font-size:11pt;font-family:"Arial"}h1{padding-top:20pt;color:#000000;font-size:20pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h2{padding-top:18pt;color:#000000;font-size:16pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h3{padding-top:16pt;color:#434343;font-size:14pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h4{padding-top:14pt;color:#666666;font-size:12pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h5{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h6{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;font-style:italic;orphans:2;widows:2;text-align:left}</style></head><body class="c2"><p class="c0"><span class="c1">Welcome :)</span></p></body></html>

View File

@ -0,0 +1,8 @@
title: the title of my blog
theme: anubis
params:
author: bel
email: bel@bel.bel
social:
- id: email
name: bel@bel.bel

View File

@ -0,0 +1 @@
<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><style type="text/css">ol{margin:0;padding:0}table td,table th{padding:0}.c0{color:#000000;font-weight:400;text-decoration:none;vertical-align:baseline;font-size:11pt;font-family:"Arial";font-style:normal}.c1{padding-top:0pt;padding-bottom:0pt;line-height:1.15;orphans:2;widows:2;text-align:left}.c2{background-color:#ffffff;max-width:468pt;padding:72pt 72pt 72pt 72pt}.title{padding-top:0pt;color:#000000;font-size:26pt;padding-bottom:3pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}.subtitle{padding-top:0pt;color:#666666;font-size:15pt;padding-bottom:16pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}li{color:#000000;font-size:11pt;font-family:"Arial"}p{margin:0;color:#000000;font-size:11pt;font-family:"Arial"}h1{padding-top:20pt;color:#000000;font-size:20pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h2{padding-top:18pt;color:#000000;font-size:16pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h3{padding-top:16pt;color:#434343;font-size:14pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h4{padding-top:14pt;color:#666666;font-size:12pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h5{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h6{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;font-style:italic;orphans:2;widows:2;text-align:left}</style></head><body class="c2"><p class="c1"><span class="c0">title: the title of my blog</span></p><p class="c1"><span class="c0">theme: anubis</span></p><p class="c1"><span class="c0">params:</span></p><p class="c1"><span class="c0">&nbsp; author: bel</span></p><p class="c1"><span class="c0">&nbsp; email: bel@bel.bel</span></p><p class="c1"><span class="c0">&nbsp; social:</span></p><p class="c1"><span class="c0">&nbsp; - id: email</span></p><p class="c1"><span class="c0">&nbsp; &nbsp; name: bel@bel.bel</span></p></body></html>

View File

@ -1 +0,0 @@
.default/about.md

31
meta/about.md Normal file
View File

@ -0,0 +1,31 @@
---
title: "About"
description: "Hugo, the worlds fastest framework for building websites"
date: "2019-02-28"
aliases:
- "about-us"
- "about-hugo"
- "contact"
author: "Hugo Authors"
---
Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows.
Hugo makes use of a variety of open source projects including:
* https://github.com/yuin/goldmark
* https://github.com/alecthomas/chroma
* https://github.com/muesli/smartcrop
* https://github.com/spf13/cobra
* https://github.com/spf13/viper
Hugo is ideal for blogs, corporate websites, creative portfolios, online magazines, single page applications or even a website with thousands of pages.
Hugo is for people who want to hand code their own website without worrying about setting up complicated runtimes, dependencies and databases.
Websites built with Hugo are extremelly fast, secure and can be deployed anywhere including, AWS, GitHub Pages, Heroku, Netlify and any other hosting provider.
Learn more and contribute on [GitHub](https://github.com/gohugoio).

View File

@ -1 +0,0 @@
.default/config.yaml

76
meta/config.yaml Normal file
View File

@ -0,0 +1,76 @@
baseURL: ''
languageCode: 'en-us'
title: 'Site Title'
theme: "anubis"
paginate: 5
paginatePath: "posts/-/pages"
enableRobotsTXT: true
disableLiveReload: true
minify: true
noHTTPCache: true
disableFastRender: true
rssLimit: 5
canonifyurls: true
relativeurls: false
params:
toc: true
author: "me"
email: ""
avatar: ""
description: ""
#customJS: [ "js/main.js" ] # relative to ./assets/
dateFormat: "2006-01-02"
paginationSinglePost: false
style: light
#style: auto-without-switcher
#style: light-without-switcher
readMore: true
disableSummary: false
social:
- id: email
name: contact
#- id: linkedin
# name: lapoba16
#- id: rss
# name: rss
# url: '/index.xml'
menu:
main:
- identifier: archive
name: Archive
title: Archive
url: /posts/
weight: 0
- identifier: about
name: About
title: About
url: /about/
weight: 1
markup:
defaultMarkdownHandler: goldmark
goldmark:
extensions:
linkify: true
strikethrough: true
table: true
taskList: true
parser:
autoHeadingID: true
autoHeadingIDType: github
renderer:
unsafe: true # raw HTML OK
highlight:
anchorLineNos: true
guessSyntax: true
lineNos: true
tabWidth: 3
tableOfContents:
endLevel: 3
ordered: false
startLevel: 2
permalinks:
posts: /posts/:year-:month-:day-:filename

View File

@ -11,7 +11,7 @@ TMPDIR="${TMPDIR:-"/tmp"}"
main() {
flags "$@"
posts
#posts
meta
}
@ -66,10 +66,7 @@ posts() (
mkdir -p "$extracted_dir"
7z x -o"$extracted_dir" "$pulled_file"
cat "$extracted_dir"/*.html \
| sed 's/.*<body/<body/' \
| sed 's/<\/body>.*/<\/body>/' \
> "$index_html"
cat "$extracted_dir"/*.html | html_only_body > "$index_html"
local tags=($(cat "$index_html" | html_to_plaintext | grep -o '#[a-zA-Z0-9]*' | grep '[a-zA-Z]' | sed 's/^#//' | sort -u))
local tags_csv="$(first=false; for tag in "${tags[@]}"; do true; if $first; then echo -n ", "; fi; first=true; echo -n "$tag"; done)"
@ -171,6 +168,35 @@ meta() {
test -f "$(meta_file "$1")" && test "$1" == "$(cat "$(meta_file "$1")")"
}
extracted_dir() {
echo "./meta/.overrides/$(echo "$1" | jq -r .Name)"
}
extracted() {
echo "./meta/.overrides/$(echo "$1" | jq -r .Name | sed 's/.zip$//')"
}
extract() {
local extracted_dir="$(extracted_dir "$1")"
rm -rf "$extracted_dir" "${extracted_dir%.zip}"
mkdir -p "$extracted_dir"
7z x -o"$extracted_dir" "$(pulled "$1")"
local extracted_file="$(ls "$extracted_dir"/*.html)"
if [ $(ls "$extracted_dir" | wc -l) == 1 ]; then
cp "$extracted_file" "$(extracted "$1")"
extracted_file="$(extracted "$1")"
else
mv "$extracted_file" "$(dirname "$extracted_file")"/index.md
mv "$extracted_dir" "$(extracted "$1")"
fi
local extracted="$(extracted "$1")"
case "${extracted##*.}" in
yaml ) true ;;
* ) return ;;
esac
cat "$extracted" | html_to_plaintext > "$extracted.2"; mv "$extracted.2" "$extracted"
}
for b64_json in $(list); do
local json="$(echo "$b64_json" | base64 --decode | jq .)"
local filename="$(echo "$json" | jq -r .Name)"
@ -178,8 +204,11 @@ meta() {
log "$filename: up to date"
continue
fi
log json=$json
log "$filename: pulling"
pull "$json"
log "$filename: extracting"
extract "$json"
merge "$json"
# todo: echo "$json" > "$(meta_file $json)"
done
false
@ -213,7 +242,6 @@ gd() (
pull "$RCLONE_FOLDER_POSTS/$1"
}
pull_meta() {
set -x
pull "$RCLONE_FOLDER_META/$1"
}
pull() {
@ -231,7 +259,13 @@ gd() (
)
html_to_plaintext() {
sed 's/<[^>]*>//g'
sed 's/<style.*<\/style>//' | sed 's/&nbsp;/ /g' | sed -e 's/<[^>]*>/\n/g' | grep .
#sed 's/<[^>]*>//g'
}
html_only_body() {
sed 's/.*<body/<body/' \
| sed 's/<\/body>.*/<\/body>/'
}
if [ "$0" == "$BASH_SOURCE" ]; then