Notes on Hugo and Markdown

Some MarkDown Syntax Working with URLs on MarkDown Some URL 1 Some link [Link to Unsplash](https://unsplash.com/@chelseanscott?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) Rendered as Some link Link to Unsplash Use HTML code if you want to open link on a new tab. Here is an example. 1 <a href="https://unsplash.com" target="_blank"> Link2<a/> Rendering code on MarkDown The Code can be rendered using the the following Syntax. 1 2 3 `<language> (use 3 `) (some code here) ` (use 3 `) Here is some Python code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 import psycopg2 data_folder = "clean_data/August" import os import pandas as pd import numpy as np #Establishing the connection conn = psycopg2.connect( database="kiprono_database2", user='postgres', password='pass1', host='127.0.0.1', port= '5432' ) #Setting auto commit false conn.autocommit = True #Creating a cursor object using the cursor() method cursor = conn.cursor() files = os.listdir(data_folder) print(files) for file in files: df = pd.read_csv(os.path.join(data_folder, file)) df = df[['wmoID', 'kmdID', 'Year', 'Month', 'Day', 'Hour', 'AirTemp', 'Tmax', 'Tmin']] data = df.to_dict(orient="records") for data_point in data: result = list(data_point.values()) insert_command = '''INSERT INTO AMSS(wmoID, kmdID, Year, Month, Day, Hour, AirTemp, Tmax, Tmin)\ VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)''' try: cursor.execute(insert_command, result) # Commit your changes in the database conn.commit() except psycopg2.errors.UniqueViolation as e: print(e) continue # Closing the connection conn.close() More code on CSS ...

Nov 21, 2022 · 4 min · 730 words · Kiprono