all repos — site @ 21849fe70971172213770b7cce9d5cdb73ba35b7

source for my site, found at icyphox.sh

Latest commit now on the sidebar

Signed-off-by: Anirudh Oppiliappan <x@icyphox.sh>
Anirudh Oppiliappan x@icyphox.sh
Sun, 14 Jun 2020 20:39:41 +0530
commit

21849fe70971172213770b7cce9d5cdb73ba35b7

parent

163f579a37089a9c320a7f7256da317bcc825b6c

4 files changed, 47 insertions(+), 72 deletions(-)

jump to
D bin/commit.py

@@ -1,52 +0,0 @@

-#!/usr/bin/env python3 - -import jinja2 -import subprocess -from jinja2 import DebugUndefined -import sys - - -def jinja_render(commit, date, big_commit, tmpl): - template_loader = jinja2.FileSystemLoader("./") - env = jinja2.Environment(loader=template_loader, undefined=DebugUndefined) - try: - template = env.get_template(tmpl) - except jinja2.exceptions.TemplateNotFound: - print("error: template not found") - sys.exit(1) - - out = template.render(commit=commit, commit_date=date, big_commit=big_commit) - return out - - -def get_commit(): - out = subprocess.run( - ["git", "rev-parse", "--short", "HEAD"], - stdout=subprocess.PIPE) - commit = out.stdout.decode("utf-8").strip() - return commit - -def get_big_commit(): - out = subprocess.run( - ["git", "rev-parse", "HEAD"], - stdout=subprocess.PIPE - ) - big_commit = out.stdout.decode("utf-8").strip() - return big_commit - - -def get_commit_date(commit): - out = subprocess.run( - ["git", "show", "-s", "--format=%cd", "--date=short", commit], - stdout=subprocess.PIPE) - date = out.stdout.decode("utf-8").strip() - return date - - -if __name__ == "__main__": - commit = get_commit() - big_commit = get_big_commit() - date = get_commit_date(commit) - rendered = jinja_render(commit, date, big_commit, "build/index.html") - with open("build/index.html", "w") as f: - f.write(rendered)
M config.pyconfig.py

@@ -4,8 +4,38 @@ title = "icyphox"

author = "" header = """<a href="/"><- back</a>""" +# gets the latest commit +import subprocess + +def get_commit(): + out = subprocess.run( + ["git", "rev-parse", "--short", "HEAD"], + stdout=subprocess.PIPE) + commit = out.stdout.decode("utf-8").strip() + return commit + +def get_big_commit(): + out = subprocess.run( + ["git", "rev-parse", "HEAD"], + stdout=subprocess.PIPE + ) + big_commit = out.stdout.decode("utf-8").strip() + return big_commit + + +def get_commit_date(commit): + out = subprocess.run( + ["git", "show", "-s", "--format=%cd", "--date=short", commit], + stdout=subprocess.PIPE) + date = out.stdout.decode("utf-8").strip() + return date + +commit = get_commit() +big_commit = get_big_commit() +date = get_commit_date(commit) + # actually the sidebar -footer = """ +footer = f""" <img class="logo" src="/static/icyphox.png" alt="icyphox's avatar" /> <p> <span class="sidebar-link">email</span>

@@ -34,7 +64,7 @@

<p> <span class="sidebar-link">last updated</span> <br> - <a href="https://github.com/icyphox/site/commit/{{ big_commit }}">{{ commit }}</a> on {{ commit_date }} + <a href="https://github.com/icyphox/site/commit/{big_commit}">{commit}</a> on {date} </p> <h3>friends</h3>

@@ -59,4 +89,4 @@

""" template = 'text.html' # default is index.html pre_build = [['bin/openring.py', '-j'], 'bin/update_index.py'] -post_build = ['bin/rss.py', 'bin/plaintext.sh', 'bin/commit.py'] +post_build = ['bin/rss.py', 'bin/plaintext.sh']
M pages/about.mdpages/about.md

@@ -38,8 +38,8 @@ ## Contact

Send mail to [x@icyphox.sh](mailto:x@icyphox.sh). It is also my XMPP address; please use OMEMO. -Should you need it, my [PGP key](/static/gpg.txt). Fingerprint: `FE1B -8FCF E6C1 6222 F157 1C8E 8A93 F96F 78C5 D4C4`. +Should you need it, my PGP key: +[FE1B 8FCF E6C1 6222 F157 1C8E 8A93 F96F 78C5 D4C4](/static/gpg.txt). I'm also on IRC @ Freenode and Rizon, usually as `icy` / `icyphox`. If you're interested in **hiring me** -- here's my
M templates/text.htmltemplates/text.html

@@ -48,32 +48,29 @@ <hr>

<div class="openring"> <div class="openring-feed"> - <h4><a href="https://peppe.rs/posts/auto-currying_rust_functions/">Auto-currying Rust Functions</a></h4> - <p>This post contains a gentle introduction to procedural macros in Rust and a guide to writing a procedural macro to curry Rust functions. The source code for the entire library can be found here. It is also available on crates.io. -The following links might …</p> + <h4><a href="https://k1ss.org/blog/20200525a">25/05/2020: This month in KISS (#2)</a></h4> + <p>Welcome to the second monthly update for KISS. This post will be +quite a long one, we've seen some nice changes this month and some +great work by the Community.…</p> - <p>via <a href="https://peppe.rs">nerdypepper's μblog</a> on May 09, 2020</p> + <p>via <a href="https://k1ss.org">KISS Linux Blog</a> on May 25, 2020</p> </div> <div class="openring-feed"> - <h4><a href="https://k1ss.org/blog/20200525a">25/05/2020: This month in KISS (#2)</a></h4> - <p>Welcome to the second monthly update for KISS. This post will be -quite a long one, we've seen some nice changes this month and some -great work by the Community.…</p> + <h4><a href="https://gru.gq/2020/05/29/modern-mass-media-and-info-war/">Modern Mass Media and Info War</a></h4> + <p>This is fascinating… the 3rd largest media company, after Disney and Warner, is The Soul Publishing, and they’re pure online only. They produce dedicated content designed for Facebook and YouTube algorithms. Why is that interesting? Well, for one, their co…</p> - <p>via <a href="https://k1ss.org">KISS Linux Blog</a> on May 25, 2020</p> + <p>via <a href="https://gru.gq">grugq’s domain</a> on May 29, 2020</p> </div> <div class="openring-feed"> - <h4><a href="https://drewdevault.com/tls/security/oauth/2020/06/12/Can-we-talk-about-client-side-certs.html">Can we talk about client-side certificates?</a></h4> - <p>I’m working on improving the means by which API users authenticate with the -SourceHut API. Today, I was reading RFC 6749 (OAuth2) for this purpose, -and it got me thinking about the original OAuth spec. I recalled vaguely that it -had the API clients actuall…</p> + <h4><a href="https://peppe.rs/posts/auto-currying_rust_functions/">Auto-currying Rust Functions</a></h4> + <p>This post contains a gentle introduction to procedural macros in Rust and a guide to writing a procedural macro to curry Rust functions. The source code for the entire library can be found here. It is also available on crates.io. +The following links might …</p> - <p>via <a href="https://drewdevault.com">Drew DeVault's Blog</a> on Jun 12, 2020</p> + <p>via <a href="https://peppe.rs">nerdypepper's μblog</a> on May 09, 2020</p> </div>