Compare commits

...

2 Commits

Author SHA1 Message Date
f4295107a4
feat: Add now old page for previous now pages
All checks were successful
Build Docker / Build Image (push) Successful in 27s
2024-02-23 21:19:00 +11:00
35e4ae222c
feat: Add date to now page 2024-02-23 17:27:43 +11:00
5 changed files with 184 additions and 5 deletions

View File

@ -3,6 +3,7 @@ import os
import dotenv
import requests
import CloudFlare
import datetime
app = Flask(__name__)
dotenv.load_dotenv()
@ -129,6 +130,7 @@ def index():
return resp
@app.route('/now')
@app.route('/now/')
def now():
global handshake_scripts
@ -139,9 +141,61 @@ def now():
# Get latest now page
files = os.listdir('templates/now')
# Remove template
files = [file for file in files if file != 'template.html']
files = [file for file in files if file != 'template.html' and file != 'old.html']
files.sort(reverse=True)
return render_template('now/' + files[0], handshake_scripts=handshake_scripts)
date = files[0].strip('.html')
# Convert to date
date = datetime.datetime.strptime(date, '%y_%m_%d')
date = date.strftime('%A, %B %d, %Y')
return render_template('now/' + files[0], handshake_scripts=handshake_scripts, DATE=date)
@app.route('/now/<path:path>')
def now_path(path):
global handshake_scripts
# If localhost, don't load handshake
if request.host == "localhost:5000" or request.host == "127.0.0.1:5000" or os.getenv('dev') == "true" or request.host == "test.nathan.woodburn.au":
handshake_scripts = ""
date = path
date = date.strip('.html')
try:
# Convert to date
date = datetime.datetime.strptime(date, '%y_%m_%d')
date = date.strftime('%A, %B %d, %Y')
except:
date = ""
# If file exists, load it
if os.path.isfile('templates/now/' + path):
return render_template('now/' + path, handshake_scripts=handshake_scripts, DATE=date)
if os.path.isfile('templates/now/' + path + '.html'):
return render_template('now/' + path + '.html', handshake_scripts=handshake_scripts, DATE=date)
return render_template('404.html'), 404
@app.route('/now/old')
@app.route('/now/old/')
def now_old():
global handshake_scripts
# If localhost, don't load handshake
if request.host == "localhost:5000" or request.host == "127.0.0.1:5000" or os.getenv('dev') == "true" or request.host == "test.nathan.woodburn.au":
handshake_scripts = ""
now_pages = os.listdir('templates/now')
now_pages = [page for page in now_pages if page != 'template.html' and page != 'old.html']
now_pages.sort(reverse=True)
html = '<ul class="list-group">'
latest = " (Latest)"
for page in now_pages:
link = page.strip('.html')
date = datetime.datetime.strptime(link, '%y_%m_%d')
date = date.strftime('%A, %B %d, %Y')
html += f'<a style="text-decoration:none;" href="/now/{link}"><li class="list-group-item" style="background-color:#000000;color:#ffffff;">{date}{latest}</li></a>'
latest = ""
html += '</ul>'
return render_template('now/old.html', handshake_scripts=handshake_scripts,now_pages=html)
@app.route('/<path:path>')
@ -158,13 +212,15 @@ def catch_all(path):
if os.path.isfile('templates/' + path + '.html'):
return render_template(path + '.html', handshake_scripts=handshake_scripts)
if os.path.isfile('templates/' + path.strip('/') + '.html'):
return render_template(path.strip('/') + '.html', handshake_scripts=handshake_scripts)
return render_template('404.html'), 404
def getAddress():
global address
if address == '':
address = 'hs1qv3uu4amv87g7p7h49xez2pmzwjf92am0wzpnh4'
# address = requests.get('http://hip02-server:3000').text?
return address

View File

@ -72,7 +72,8 @@ Find out what I've been up to in the last week">
</nav>{{handshake_scripts | safe}}
<div class="profile-container" style="margin-bottom: 2em;margin-top: 10em;"><img class="profile background" src="/assets/img/profile.jpg" style="border-radius: 50%;"><img class="profile foreground" src="/assets/img/pfront.webp"></div>
<h1 class="nathanwoodburn" style="margin-bottom: 0px;">Nathan.Woodburn/</h1>
<h3>WHat's Happening Now</h3>
<h3 style="margin-bottom: 0px;">WHat's Happening Now</h3>
<h6>{{DATE}}</h6>
<section style="margin-bottom: 50px;">
<div style="max-width: 700px;margin: auto;">
<h1 style="margin-bottom: 0px;">HappeninG</h1>

115
templates/now/old.html Normal file
View File

@ -0,0 +1,115 @@
<!DOCTYPE html>
<html data-bs-theme="light" lang="en-au">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<title>What's up at the moment | Nathan.Woodburn/</title>
<meta name="theme-color" content="#97009a">
<link rel="canonical" href="https://nathan.woodburn.au/now/old.html">
<meta property="og:url" content="https://nathan.woodburn.au/now/old.html">
<meta http-equiv="onion-location" content="http://wdbrncwefot4hd7bdrz5rzb74mefay7zvrjn2vmkpdm44l7fwnih5ryd.onion">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://nathan.woodburn.au/assets/img/profile.jpg">
<meta property="og:image" content="https://nathan.woodburn.au/assets/img/profile.jpg">
<meta property="og:type" content="website">
<meta property="og:description" content="G'day,
Find out what I've been up to in the last week">
<meta property="og:title" content="What's up at the moment | Nathan.Woodburn/">
<meta name="description" content="G'day,
Find out what I've been up to in the last week">
<meta name="twitter:title" content="What's up at the moment | Nathan.Woodburn/">
<meta name="twitter:description" content="G'day,
Find out what I've been up to in the last week">
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/assets/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/img/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/img/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="180x180" href="/assets/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="192x192" href="/assets/img/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="512x512" href="/assets/img/android-chrome-512x512.png">
<link rel="stylesheet" href="/assets/bootstrap/css/bootstrap.min.css">
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic&amp;display=swap">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Cabin:700&amp;display=swap">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Anonymous+Pro&amp;display=swap">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700">
<link rel="stylesheet" href="/assets/fonts/font-awesome.min.css">
<link rel="stylesheet" href="/assets/fonts/ionicons.min.css">
<link rel="stylesheet" href="/assets/css/styles.min.css">
<link rel="stylesheet" href="/assets/css/profile.min.css">
<link rel="me" href="https://mastodon.woodburn.au/@nathanwoodburn" />
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//analytics.woodburn.au/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
<script async src="https://umami.woodburn.au/script.js" data-website-id="6a55028e-aad3-481c-9a37-3e096ff75589"></script>
</head>
<body class="text-center" style="background: linear-gradient(rgba(0,0,0,0.80), rgba(0,0,0,0.80)), url(&quot;/assets/img/bg/background.webp&quot;) center / cover no-repeat;">
<nav class="navbar navbar-expand-md fixed-top navbar-light" id="mainNav" style="background: var(--bs-navbar-hover-color);">
<div class="container-fluid"><a class="navbar-brand nathanwoodburn" href="/#">Nathan.Woodburn/</a><button data-bs-toggle="collapse" class="navbar-toggler navbar-toggler-right" data-bs-target="#navbarResponsive" type="button" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation" value="Menu"><i class="fa fa-bars"></i></button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ms-auto">
<li class="nav-item nav-link"><a class="nav-link" href="/">Home</a></li>
<li class="nav-item nav-link"><a class="nav-link" href="projects">Projects</a></li>
<li class="nav-item nav-link"><a class="nav-link" href="/now">Now</a></li>
</ul>
</div>
</div>
</nav>{{handshake_scripts | safe}}
<div class="profile-container" style="margin-bottom: 2em;margin-top: 10em;"><img class="profile background" src="/assets/img/profile.jpg" style="border-radius: 50%;"><img class="profile foreground" src="/assets/img/pfront.webp"></div>
<h1 class="nathanwoodburn" style="margin-bottom: 0px;">Nathan.Woodburn/</h1>
<h3>Now History</h3>
<section style="margin-bottom: 50px;">
<div style="max-width: 700px;margin: auto;">
<h1 style="margin-bottom: 0px;">Previous Now Pages</h1>
<p>Check out some of my previous now pages</p>{{now_pages|safe}}
</div>
</section>
<section class="text-center content-section" id="contact" style="padding-top: 25px;padding-bottom: 3em;">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto">
<div class="social-div">
<ul class="list-unstyled social-list">
<li class="social-link"><a href="https://twitter.com/woodburn_nathan" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-twitter-x icon">
<path d="M12.6.75h2.454l-5.36 6.142L16 15.25h-4.937l-3.867-5.07-4.425 5.07H.316l5.733-6.57L0 .75h5.063l3.495 4.633L12.601.75Zm-.86 13.028h1.36L4.323 2.145H2.865l8.875 11.633Z"></path>
</svg></a></li>
<li class="social-link"><a href="https://github.com/Nathanwoodburn" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-github icon">
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8"></path>
</svg></a></li>
<li class="social-link"><a href="mailto:about@nathan.woodburn.au" target="_blank"><i class="icon ion-email icon"></i></a></li>
<li class="social-link"><a href="https://l.woodburn.au/discord" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-discord icon">
<path d="M13.545 2.907a13.227 13.227 0 0 0-3.257-1.011.05.05 0 0 0-.052.025c-.141.25-.297.577-.406.833a12.19 12.19 0 0 0-3.658 0 8.258 8.258 0 0 0-.412-.833.051.051 0 0 0-.052-.025c-1.125.194-2.22.534-3.257 1.011a.041.041 0 0 0-.021.018C.356 6.024-.213 9.047.066 12.032c.001.014.01.028.021.037a13.276 13.276 0 0 0 3.995 2.02.05.05 0 0 0 .056-.019c.308-.42.582-.863.818-1.329a.05.05 0 0 0-.01-.059.051.051 0 0 0-.018-.011 8.875 8.875 0 0 1-1.248-.595.05.05 0 0 1-.02-.066.051.051 0 0 1 .015-.019c.084-.063.168-.129.248-.195a.05.05 0 0 1 .051-.007c2.619 1.196 5.454 1.196 8.041 0a.052.052 0 0 1 .053.007c.08.066.164.132.248.195a.051.051 0 0 1-.004.085 8.254 8.254 0 0 1-1.249.594.05.05 0 0 0-.03.03.052.052 0 0 0 .003.041c.24.465.515.909.817 1.329a.05.05 0 0 0 .056.019 13.235 13.235 0 0 0 4.001-2.02.049.049 0 0 0 .021-.037c.334-3.451-.559-6.449-2.366-9.106a.034.034 0 0 0-.02-.019Zm-8.198 7.307c-.789 0-1.438-.724-1.438-1.612 0-.889.637-1.613 1.438-1.613.807 0 1.45.73 1.438 1.613 0 .888-.637 1.612-1.438 1.612m5.316 0c-.788 0-1.438-.724-1.438-1.612 0-.889.637-1.613 1.438-1.613.807 0 1.451.73 1.438 1.613 0 .888-.631 1.612-1.438 1.612"></path>
</svg></a></li>
<li class="social-link"><a href="https://mastodon.woodburn.au/@nathanwoodburn" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-mastodon icon">
<path d="M11.19 12.195c2.016-.24 3.77-1.475 3.99-2.603.348-1.778.32-4.339.32-4.339 0-3.47-2.286-4.488-2.286-4.488C12.062.238 10.083.017 8.027 0h-.05C5.92.017 3.942.238 2.79.765c0 0-2.285 1.017-2.285 4.488l-.002.662c-.004.64-.007 1.35.011 2.091.083 3.394.626 6.74 3.78 7.57 1.454.383 2.703.463 3.709.408 1.823-.1 2.847-.647 2.847-.647l-.06-1.317s-1.303.41-2.767.36c-1.45-.05-2.98-.156-3.215-1.928a3.614 3.614 0 0 1-.033-.496s1.424.346 3.228.428c1.103.05 2.137-.064 3.188-.189zm1.613-2.47H11.13v-4.08c0-.859-.364-1.295-1.091-1.295-.804 0-1.207.517-1.207 1.541v2.233H7.168V5.89c0-1.024-.403-1.541-1.207-1.541-.727 0-1.091.436-1.091 1.296v4.079H3.197V5.522c0-.859.22-1.541.66-2.046.456-.505 1.052-.764 1.793-.764.856 0 1.504.328 1.933.983L8 4.39l.417-.695c.429-.655 1.077-.983 1.934-.983.74 0 1.336.259 1.791.764.442.505.661 1.187.661 2.046v4.203z"></path>
</svg></a></li>
<li class="social-link"><a href="https://www.youtube.com/@nathanjwoodburn" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16" class="bi bi-youtube icon">
<path d="M8.051 1.999h.089c.822.003 4.987.033 6.11.335a2.01 2.01 0 0 1 1.415 1.42c.101.38.172.883.22 1.402l.01.104.022.26.008.104c.065.914.073 1.77.074 1.957v.075c-.001.194-.01 1.108-.082 2.06l-.008.105-.009.104c-.05.572-.124 1.14-.235 1.558a2.007 2.007 0 0 1-1.415 1.42c-1.16.312-5.569.334-6.18.335h-.142c-.309 0-1.587-.006-2.927-.052l-.17-.006-.087-.004-.171-.007-.171-.007c-1.11-.049-2.167-.128-2.654-.26a2.007 2.007 0 0 1-1.415-1.419c-.111-.417-.185-.986-.235-1.558L.09 9.82l-.008-.104A31.4 31.4 0 0 1 0 7.68v-.123c.002-.215.01-.958.064-1.778l.007-.103.003-.052.008-.104.022-.26.01-.104c.048-.519.119-1.023.22-1.402a2.007 2.007 0 0 1 1.415-1.42c.487-.13 1.544-.21 2.654-.26l.17-.007.172-.006.086-.003.171-.007A99.788 99.788 0 0 1 7.858 2h.193zM6.4 5.209v4.818l4.157-2.408z"></path>
</svg></a></li>
</ul>
</div>
</div>
</div>
</div>
</section>
<script src="/assets/bootstrap/js/bootstrap.min.js"></script>
<script src="/assets/js/script.min.js"></script>
<script src="/assets/js/hacker.min.js"></script>
</body>
</html>

View File

@ -72,7 +72,8 @@ Find out what I've been up to in the last week">
</nav>{{handshake_scripts | safe}}
<div class="profile-container" style="margin-bottom: 2em;margin-top: 10em;"><img class="profile background" src="/assets/img/profile.jpg" style="border-radius: 50%;"><img class="profile foreground" src="/assets/img/pfront.webp"></div>
<h1 class="nathanwoodburn" style="margin-bottom: 0px;">Nathan.Woodburn/</h1>
<h3>WHat's Happening Now</h3>
<h3 style="margin-bottom: 0px;">WHat's Happening Now</h3>
<h6>{{DATE}}</h6>
<section style="margin-bottom: 50px;">
<div style="max-width: 700px;margin: auto;">
<h1 style="margin-bottom: 0px;">Title</h1>

View File

@ -3,6 +3,12 @@
<url>
<loc>https://nathan.woodburn.au/now/24_02_18</loc>
</url>
<url>
<loc>https://nathan.woodburn.au/now/24_02_25</loc>
</url>
<url>
<loc>https://nathan.woodburn.au/now/old</loc>
</url>
<url>
<loc>https://nathan.woodburn.au/now/template</loc>
</url>