summaryrefslogblamecommitdiff
path: root/update.sh
blob: e7cb13960b026312f05ebe16ebcc42261996d6b2 (plain) (tree)
1
2
3
4
5
6
7
8
9
10


           
                                 
                                               
                                                      
                            
 

                             







                                                                 


                                                  
                                                                                     
        




                                                                                                                  
 


                                                             
                                         
                                                              
                                         



                                                                         
                                                                             
                                                                       

      
      
    
 

                                        
                           
#!/bin/bash

# RSS
RSS_TITLE='omeckman.net pub-docs'
RSS_TITLE_LINK='https://omeckman.net/pub-docs/'
RSS_TITLE_DESC='omeckman.net public documents / $blog'
RSS_MY_URL=${RSS_TITLE_LINK}

cp INDEX_template.md INDEX.md

cp template_rss_header.xml index.xml

#sed -i "s/\\\$TITLE</${RSS_TITLE}</g" index.xml
python3 pyreplace.py '$TITLE$' "${RSS_TITLE}" index.xml
python3 pyreplace.py '$TITLE_LINK$' "$RSS_TITLE_LINK" index.xml
python3 pyreplace.py '$TITLE_DESC$' "${RSS_TITLE_DESC}" index.xml
python3 pyreplace.py '$MY_URL$' "${RSS_MY_URL}" index.xml

for i in *.md
do
    filename_wo_ext=$(echo "$i" | cut -f 1 -d '.')
    if [ $filename_wo_ext != "template" ] && [ $filename_wo_ext != "INDEX_template" ]
    then
        pandoc $i -s --highlight-style pygments --css=style.css --self-contained -t html5 -o $filename_wo_ext.html

    if [ $filename_wo_ext != "INDEX" ]
    then
        echo "[$filename_wo_ext]($filename_wo_ext.html)  " >> INDEX.md

	origdate=$(echo "$filename_wo_ext" | cut -f 1 -d '_')
	pubdaterfc822=$(python3 rfc822date.py ${origdate})

        RSS_ITEM_TITLE="$filename_wo_ext"
        RSS_ITEM_LINK=${RSS_TITLE_LINK}${filename_wo_ext}.html
        RSS_ITEM_PUBDATE=${pubdaterfc822}
        RSS_ITEM_DESC=$RSS_ITEM_TITLE
        cat template_rss_item.xml >> index.xml
        python3 pyreplace.py '$ITEM_TITLE$' "${RSS_ITEM_TITLE}" index.xml
        python3 pyreplace.py '$ITEM_LINK$' "${RSS_ITEM_LINK}" index.xml
        python3 pyreplace.py '$ITEM_PUBDATE$' "${RSS_ITEM_PUBDATE}" index.xml
        python3 pyreplace.py '$ITEM_DESC$' "${RSS_ITEM_DESC}" index.xml
    fi
    
    fi
done

cat template_rss_footer.xml >> index.xml

ln -s INDEX.html index.html
in each repos: see "about"-tab (if existing) for more details / README.
mailto contact at omeckman dot net
all timestamps in UTC (German winter time: UTC+01:00, summer time: UTC+02:00)
dark theme is a modded version of: https://gist.github.com/Yoplitein/f4b671a2ec70c9e743fa