Browse Source

migrate to gutenberg

Michael Zhang 4 months ago
parent
commit
63fa0d5d09
Signed by: Michael Zhang <failed.down@gmail.com> GPG Key ID: A1B65B603268116B
56 changed files with 306 additions and 168 deletions
  1. 1
    6
      .gitignore
  2. 0
    12
      Gemfile
  3. 0
    13
      _config.yml
  4. 0
    4
      _includes/footer.html
  5. 0
    8
      _includes/navbar.html
  6. 0
    19
      _layouts/default.html
  7. 0
    28
      _layouts/post.html
  8. 0
    42
      _plugins/latex.rb
  9. 0
    0
      _posts/.gitkeep
  10. 12
    0
      config.toml
  11. 58
    0
      content/2018-02-01-my-new-life-stack.md
  12. 31
    0
      content/2018-02-12-pumping-lemma-proofs.md
  13. 13
    0
      content/2018-02-25-cleaning-up-your-shell.md
  14. 15
    0
      content/2018-04-23-fixing-tmux-colors.md
  15. 48
    0
      content/2018-05-28-web-apps.md
  16. 8
    0
      content/_index.md
  17. 2
    0
      content/pages/_index.md
  18. 10
    8
      content/pages/about.md
  19. 0
    4
      css/index.scss
  20. 0
    22
      index.html
  21. 0
    0
      sass/_breakpoints.scss
  22. 0
    0
      sass/_colors.scss
  23. 5
    0
      sass/_fonts.scss
  24. 0
    0
      sass/_mixins.scss
  25. 0
    0
      sass/_simple-grid.scss
  26. 0
    0
      sass/_syntax.scss
  27. 15
    2
      sass/main.scss
  28. 0
    0
      static/fonts/Roboto/LICENSE.txt
  29. 0
    0
      static/fonts/Roboto/Roboto-Black.ttf
  30. 0
    0
      static/fonts/Roboto/Roboto-BlackItalic.ttf
  31. 0
    0
      static/fonts/Roboto/Roboto-Bold.ttf
  32. 0
    0
      static/fonts/Roboto/Roboto-BoldItalic.ttf
  33. 0
    0
      static/fonts/Roboto/Roboto-Italic.ttf
  34. 0
    0
      static/fonts/Roboto/Roboto-Light.ttf
  35. 0
    0
      static/fonts/Roboto/Roboto-LightItalic.ttf
  36. 0
    0
      static/fonts/Roboto/Roboto-Medium.ttf
  37. 0
    0
      static/fonts/Roboto/Roboto-MediumItalic.ttf
  38. 0
    0
      static/fonts/Roboto/Roboto-Regular.ttf
  39. 0
    0
      static/fonts/Roboto/Roboto-Thin.ttf
  40. 0
    0
      static/fonts/Roboto/Roboto-ThinItalic.ttf
  41. 0
    0
      static/fonts/RobotoMono/LICENSE.txt
  42. 0
    0
      static/fonts/RobotoMono/RobotoMono-Bold.ttf
  43. 0
    0
      static/fonts/RobotoMono/RobotoMono-BoldItalic.ttf
  44. 0
    0
      static/fonts/RobotoMono/RobotoMono-Italic.ttf
  45. 0
    0
      static/fonts/RobotoMono/RobotoMono-Light.ttf
  46. 0
    0
      static/fonts/RobotoMono/RobotoMono-LightItalic.ttf
  47. 0
    0
      static/fonts/RobotoMono/RobotoMono-Medium.ttf
  48. 0
    0
      static/fonts/RobotoMono/RobotoMono-MediumItalic.ttf
  49. 0
    0
      static/fonts/RobotoMono/RobotoMono-Regular.ttf
  50. 0
    0
      static/fonts/RobotoMono/RobotoMono-Thin.ttf
  51. 0
    0
      static/fonts/RobotoMono/RobotoMono-ThinItalic.ttf
  52. 6
    0
      templates/blog.html
  53. 26
    0
      templates/layout.html
  54. 29
    0
      templates/macros/blog.html
  55. 11
    0
      templates/macros/layout.html
  56. 16
    0
      templates/post.html

+ 1
- 6
.gitignore View File

@@ -1,6 +1 @@
1
-_site
2
-.sass-cache
3
-Gemfile.lock
4
-
5
-/_posts/*
6
-!/_posts/.gitkeep
1
+public

+ 0
- 12
Gemfile View File

@@ -1,12 +0,0 @@
1
-# frozen_string_literal: true
2
-
3
-source "https://rubygems.org" do
4
-	gem "kramdown"
5
-	gem "jekyll-feed"
6
-	gem "jekyll-minifier"
7
-	gem "jekyll-watch"
8
-	gem "mathematical"
9
-	gem "rouge"
10
-end
11
-
12
-git_source(:github) {|repo_name| "https://git.mzhang.me/michael/blog" }

+ 0
- 13
_config.yml View File

@@ -1,13 +0,0 @@
1
-markdown: kramdown
2
-
3
-kramdown:
4
-  input: GFM
5
-  smart_quotes: ["apos", "apos", "quot", "quot"]
6
-  syntax_highlighter: rouge
7
-
8
-jekyll-minifier:
9
-  exclude: "feed.xml"
10
-
11
-plugins:
12
-  - jekyll-feed
13
-  - jekyll-minifier

+ 0
- 4
_includes/footer.html View File

@@ -1,4 +0,0 @@
1
-<div style="text-align: center; font-weight: 200;">
2
-    written by Michael Zhang.
3
-    <a href="https://git.mzhang.me/michael/blog" class="colorlink" target="_blank">source</a>
4
-</div>

+ 0
- 8
_includes/navbar.html View File

@@ -1,8 +0,0 @@
1
-<div class="container" id="navbar" style="padding-top: 10px;">
2
-        <a href="/" class="title nocolorlink">michael's blog</a>
3
-    
4
-        <div id="nav">
5
-            <a href="/about" class="link">about</a>
6
-            <a href="https://git.mzhang.me/explore" class="link">gitea</a>
7
-        </div>
8
-</div>

+ 0
- 19
_layouts/default.html View File

@@ -1,19 +0,0 @@
1
-<html>
2
-
3
-<head>
4
-	<title>michael's blog</title>
5
-	<link rel="stylesheet" href="/css/index.css" />
6
-	<meta name="viewport" content="width=device-width, initial-scale=1.0">
7
-</head>
8
-
9
-<body>
10
-	<header>{% include navbar.html %}</header>
11
-
12
-	<div class="container" style="padding: 30px;">
13
-		{{ content }}
14
-	</div>
15
-
16
-	{% include footer.html %}
17
-</body>
18
-
19
-</html>

+ 0
- 28
_layouts/post.html View File

@@ -1,28 +0,0 @@
1
-<html>
2
-
3
-<head>
4
-    <title>{{ page.title }} - michael's blog</title>
5
-    <link rel="stylesheet" href="/css/index.css" />
6
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
-</head>
8
-
9
-<body>
10
-    <header>{% include navbar.html %}</header>
11
-
12
-    <div class="container" style="padding: 30px;">
13
-        <div style="text-align: center;">
14
-            <h1 style="display: inline-block; margin: 0;">{{ page.title }}</h1>
15
-            <p style="font-size: 0.9em;">published:
16
-                <b>{{ page.date | date_to_long_string }}</b>
17
-            </p>
18
-        </div>
19
-
20
-        <div class="content">
21
-            {{ content }}
22
-        </div>
23
-    </div>
24
-
25
-    {% include footer.html %}
26
-</body>
27
-
28
-</html>

+ 0
- 42
_plugins/latex.rb View File

@@ -1,42 +0,0 @@
1
-require "mathematical"
2
-
3
-$blockRgx = /((?<block>\$\$[^\$]+\$\$)|[^\$](?<inline>\$[^\$]+\$)[^\$])/
4
-
5
-module Jekyll
6
-	class InlineLatex < Converter
7
-		safe true
8
-		priority :high
9
-
10
-		def matches(ext)
11
-			ext =~ /^\.md$/i
12
-		end
13
-
14
-		def output_ext(ext)
15
-			".md"
16
-		end
17
-
18
-		def convert(content)
19
-			# first pass
20
-			buf = StringIO.new
21
-			prev = 0
22
-			renderer = Mathematical.new({:base64 => true, :format => :svg})
23
-			content.to_enum(:scan, $blockRgx).map { Regexp.last_match }.to_enum.with_index.each do |match, i|
24
-				if match[:block] != nil
25
-					code = match[:block]
26
-					a, b = match.offset(:block)
27
-				else
28
-					code = match[:inline]
29
-					a, b = match.offset(:inline)
30
-				end
31
-
32
-				buf << content[prev..a].gsub(/^\$?\$/, "").gsub(/\$?\$$/, "")
33
-
34
-				render = renderer.render(code)
35
-				buf << "<img src='" + render[:data] + "' />"
36
-				prev = b - 1
37
-			end
38
-			buf << content[prev..content.length].gsub(/^\$?\$/, "")
39
-			return buf.string
40
-		end
41
-	end
42
-end

+ 0
- 0
_posts/.gitkeep View File


+ 12
- 0
config.toml View File

@@ -0,0 +1,12 @@
1
+title = "michael zhang"
2
+base_url = "https://mzhang.me"
3
+
4
+compile_sass = true
5
+highlight_code = true
6
+generate_rss = true
7
+
8
+[extra]
9
+nav_links = [
10
+    { url = "/pages/about", text = "about" },
11
+    { url = "https://nobs.mzhang.me", text = "projects" },
12
+]

+ 58
- 0
content/2018-02-01-my-new-life-stack.md View File

@@ -0,0 +1,58 @@
1
++++
2
+title = "my new life stack"
3
+template = "post.html"
4
+date = 2018-02-01
5
+
6
+tags = ["life", "technology"]
7
++++
8
+
9
+This is my first post on my new blog! I used to put a CTF challenge writeup here but decided to change it up a bit. Recently, I've been changing a lot of the technology that I use day to day. Here's some of the changes that I've made!
10
+
11
+## Operating System
12
+
13
+I've ran regular Ubuntu on my laptop for a while, then switched to Elementary OS, which I found a lot more pleasing to use. After using Elementary OS for about 6 months, some of the software on my computer started behaving strangely, and I decided it was time for some change.
14
+
15
+```
16
+# michael @ arch in ~ [3:20:09] 
17
+$ screenfetch
18
+                   -`                 
19
+                  .o+`                 michael@arch
20
+                 `ooo/                 OS: Arch Linux 
21
+                `+oooo:                Kernel: x86_64 Linux 4.14.15-1-ARCH
22
+               `+oooooo:               Uptime: 6h 3m
23
+               -+oooooo+:              Packages: 546
24
+             `/:-:++oooo+:             Shell: zsh 5.4.2
25
+            `/++++/+++++++:            Resolution: 1920x1080
26
+           `/++++++++++++++:           WM: i3
27
+          `/+++ooooooooooooo/`         CPU: Intel Core i7-6500U @ 4x 3.1GHz [37.0°C]
28
+         ./ooosssso++osssssso+`        GPU: intel
29
+        .oossssso-````/ossssss+`       RAM: 2963MiB / 7872MiB
30
+       -osssssso.      :ssssssso.     
31
+      :osssssss/        osssso+++.    
32
+     /ossssssss/        +ssssooo/-    
33
+   `/ossssso+/:-        -:/+osssso+-  
34
+  `+sso+:-`                 `.-/+oso: 
35
+ `++:.                           `-/+/
36
+ .`                                 `/
37
+
38
+```
39
+
40
+I installed Arch Linux on my laptop the day before yesterday. I've used Arch Linux before, about a year ago, so setup was relatively familiar. On top of Arch Linux, I'm using the very widely recommended i3 tiling window manager, and urxvt terminal emulator.
41
+
42
+## Code Editor
43
+
44
+I usually use Sublime Text and Visual Studio Code (VSCode) equally much. Both editors are extremely customizable (and VSCode seems to be heavily inspired from Sublime), but when it comes down to it, VSCode doesn't outperform Sublime. There are many occasions when VSCode just takes forever (for example, when trying to open large codebases, and then automatically running static analyzers over the entire thing).
45
+
46
+Since I started using Arch Linux, I've been trying out neovim. I'm packing my configuration with plugins, and seeing how well it works out as my main code editor. If I get really comfortable with it, I'll share my init file on a Git repo, probably.
47
+
48
+## Browser... ??
49
+
50
+I used to use Chromium, and ..I still do. I've tried several alternatives, like Firefox or even Vivaldi, but all of them seem to be missing something. I haven't tried the new Firefox Quantum yet, but unless there's a really big reason for me to change my browser, I'm probably going to stick to Chrome for a while. Chrome's DevTools are by far the best I've used, and its general ease of use makes it my favorite browser.
51
+
52
+### cVim
53
+
54
+[cVim](https://chrome.google.com/webstore/detail/cvim/ihlenndgcmojhcghmfjfneahoeklbjjh?hl=en) is a nice Chrome extension that provides vim-like keyboard bindings to Chrome. I'm going to have to admit that there's a lot of quirks around using it on pages that have heavy key bindings, but ever since I started using it, I can't help but use j/k scrolling and H/L for back and forth navigation!
55
+
56
+## Personal Server
57
+
58
+I got a droplet off DigitalOcean for hosting things that I regularly depend on. In fact, this blog (running Ghost) is hosted there now! I'm also hosting a Git server over at [https://git.mzhang.me](https://git.mzhang.me). It's running Gitea, a Go-based GitHub alternative. This doesn't mean I'm completely ditching GitHub, I just have things that I _really_ want to keep private, private.

+ 31
- 0
content/2018-02-12-pumping-lemma-proofs.md View File

@@ -0,0 +1,31 @@
1
++++
2
+title = "pumping lemma proofs"
3
+template = "post.html"
4
+date = 2018-02-12
5
+
6
+tags = ["education", "math"]
7
++++
8
+
9
+I'm learning about language theory and the pumping lemma in my automata class. This post exists mainly for my personal understanding, but also to build up a future reference. Here I explain the idea of the pumping lemma and how it can be used to disprove properties about languages.
10
+
11
+The pumping lemma provides an interesting sense of "closedness" among languages. On the most general level, if you know that your language is regular, or if it is a context-free language, it can be "pumped"; that is, part of the string can be repeated in such a way that the resulting string will still belong to the original language. I bunched regular languages and context-free languages together in here but the way the pumping lemma works for these two classes of languages actually works quite differently. In this post I'll just focus on the version of the pumping lemma for regular languages, but the version for context-free languages is a bit more involved.
12
+
13
+[Regular languages](https://en.wikipedia.org/wiki/Regular_language) are languages that can be recognized by a finite automaton. If you recall, one of the biggest limitations about finite automata are that they cannot keep track of "parsing state" for arbitrarily long strings. One of the most common examples of an irregular language is the language matching *binary palindromes*. We'll define this language over the alphabet with symbols $\left\{0, 1\right\}$ as: $\left\{ss^R\right\}$, where $s^R$ denotes the reverse of the string. Let's stick to even-length palindromes for now, since it doesn't take that much more work to extend the proof to odd-length palindromes.
14
+
15
+Basically, for any regular language, the pumping lemma guarantees that there exists a pumping length $P$, and that *every* string that is longer than this pumping length will be able to be represented as a concatenation of 3 smaller strings (let's call them $x$, $y$, and $z$) that have some pretty unique properties.
16
+
17
+As long as $|xy| \leq P$ (that is, the length of $x$ concat $y$ is at most $p$), and $y$ is not empty, then the string $y$ can be repeated as many times as you'd like, and the resulting string would still be a member of the original language. To clarify, this means the strings $xz$, $xyz$, $xyyz$, $xyyyz$, etc. will all be closed under the same language. The string $xz$ would just be the equivalent of "unpumping" $y$, or taking 0 copies of $y$.
18
+
19
+So if a regular language is guaranteed to have a pumping length and all these fantastic properties, if a language happens to not have these properties, it will have been proven to not be regular. Let's take this and apply it to the palindrome example above.
20
+
21
+The way we'll perform this proof is by contradiction. We'll assume that the palindrome language is regular, then follow step-by-step until we reach a contradiction in the pumping lemma. Then we'll know for sure that palindromes are not a regular language.
22
+
23
+### the proof
24
+
25
+Suppose the palindrome language is regular. Let's start drawing out some of the conclusions from this assumption using the pumping lemma. First and foremost, being a regular language guarantees this language a pumping length $P$, and that a certain property holds for *every* string above this pumping length. If our goal is to find a contradiction, then finding *any* string for which this property doesn't hold will be enough. Remember, $|xy|$ must be less than or equal to $P$ in order for the pumping to work. So let's pick that one string and define it in terms of $P$, so we will be able to pick out $x$, $y$, and $z$ easier later. The string we'll go with is $s = 0^P1^{2P}0^P$.
26
+
27
+It's easy to look at this string and verify that it belongs to the palindrome language. It consists of two strings, each of length $2P$ which are mirrors of each other. Because $|xy|$ must add up to be less than $P$, $x$ and $y$ must both be strings consisting only of $0$s. It's a good time to note that the pumping lemma doesn't guarantee that *every* combination of $x$ and $y$ can be pumped, only that for every string $s$, there's a *specific* $x$, $y$, and $z$ such that $y$ can be pumped. Consequently, we have to stick with a generic definition of $y$ and show that it will *never* be able to be pumped.
28
+
29
+We're ready to start pumping. Pumping $y$ simply means turning the string $xyz$ into $xyyz$. Ok let's go over that in some more detail. We know that $xyz$ has to take the form $0^P1^{2P}0^P$, with $x$ and $y$ making up some if not all of the first $P$ zeros. We know that the length of $y$ must be greater than zero, since that's one of the premises of the substrings $x$, $y$, and $z$. So $xyyz$ must be $0^{P+|y|}1^{2P}0^P$, where $|y| > 0$. This clearly *isn't* in the palindromes language, since the number of 0s on the left side clearly isn't the same as the number of $0$s on the right side. We've just pumped a string out of its own language, even while following the rules of the pumping lemma. Since we encountered a contradiction, our proof is complete.
30
+
31
+Thanks for reading! I'll try to share some more interesting things I find here.

+ 13
- 0
content/2018-02-25-cleaning-up-your-shell.md View File

@@ -0,0 +1,13 @@
1
++++
2
+title = "cleaning up your shell"
3
+template = "post.html"
4
+date = 2018-02-25
5
+
6
+tags = ["technology", "shell"]
7
++++
8
+
9
+Is your shell loading slower than it used to? Maybe you've been sticking a bit more into your `.bashrc`/`.zshrc` than you thought.
10
+
11
+It's only been a couple weeks since I installed my computer, and already my shell has been starting to lag. Since there's not that much I've put into my `.zshrc` file, I knew who the main culprits were. Namely, oh-my-zsh's "git" plugin and the nvm (node version manager) trying to load itself on startup. I'm not exactly in a situation where I need nvm most of the time I open my shell, so getting rid of that made my shell load a lot faster. It also means that every time I want to use node or npm, I'd have to manually call nvm, but that's not as important to me as a faster shell load time, especially since I don't really touch node that much.
12
+
13
+One trick you can use to see what scripts are being called at startup is the `-x` option (stands for xtrace) that popular shells like `bash` and `zsh` support. If you go into your shell and run `set -o xtrace`, you'll see it start to spit out some bash commands; this is the list of everything that is being run when your shell starts. You might find that some apps take a ridiculous amount of time to start up. These are some of the things you'd want to eliminate.

+ 15
- 0
content/2018-04-23-fixing-tmux-colors.md View File

@@ -0,0 +1,15 @@
1
++++
2
+title = "fixing tmux colors"
3
+template = "post.html"
4
+date = 2018-04-23
5
+
6
+tags = ["technology", "shell"]
7
++++
8
+
9
+Put this in your `~/.tmux.conf`.
10
+
11
+```bash
12
+set -g default-terminal "screen-256color"
13
+```
14
+
15
+If this isn't set properly, tmux usually assumes 16-color mode, which displays colors probably not like what you're used to.

+ 48
- 0
content/2018-05-28-web-apps.md View File

@@ -0,0 +1,48 @@
1
++++
2
+title = "web apps"
3
+template = "post.html"
4
+date = 2018-05-28
5
+
6
+tags = ["technology", "opinion"]
7
++++
8
+
9
+The other day, I just turned off JavaScript from my browser. "fucking neckbeard", "you'll turn it back in 2 weeks", "living without JavaScript is like living without electricity" were some of the responses I got. And they might be right. But let's see why things are the way they are and what we can do about it.
10
+
11
+## what is the purpose of the web?
12
+
13
+Well, the answer's pretty obvious, right? So you can surf it. But what does that even mean anymore? In the past, surfing the web meant viewing websites. You'd open something like your favorite news website, and it'd show you some of the latest updates. Or maybe you'd open the website for some company to find out their telephone so you can contact them. In other words, it was a channel from which you could receive information.
14
+
15
+If you wanted to do anything more complicated or that required more interaction, like sending an email, you'd probably pop open a dedicated client to do it. Things like Microsoft Outlook, Mozilla Thunderbird serve as great email clients. For chat, you could use an IRC client. Hell, even the browser was a client, just for viewing webpages. If you didn't have a client for a service that you wanted to use, you'd download a client, enter in the details of the server you want to connect to, and then you would be off.
16
+
17
+Things aren't that way anymore. For some reason, the web browser has become the all-in-one client for every service. Instead of simply acting as a HTTP client, your browser is now also capable of running full-blown 3D games, chat rooms, real-time word processors, and [full x86 emulators, apparently](http://copy.sh/v86/). What the hell happened?
18
+
19
+## spoiler alert: javascript happened
20
+
21
+JavaScript happened. That little _scripting_ language invented to, you know, make some hover animation on your page or have dropdowns on your menu bar. Thanks to the introduction of JavaScript (and jQuery especially), developers stopped viewing webpages as Word documents that you can share, and more like canvases. Hover animations are cute and dropdowns are useful. Sure. But when this _scripting_ language starts turning into a _systems_ language (for lack of a better term), you have a problem. When's the last time you used Perl to write an operating system?
22
+
23
+Look at the things we do today with JavaScript. We have _full blown frameworks_ that we _compile_ into bundles of _executable code_ in people's browsers. We're basically talking about the equivalent of downloading a binary and executing it on your computer every time you open a _webpage_. Except for a few minor differences. Firstly, it's not really a binary, it's a huge blob of script, which means it must be executed inside some virtual interpreter. For each tab that you're running. Secondly, now you're downloading random scripts from any website that you open, and then [trusting it](https://superlogout.com/) and [running it](https://coinhive.com/). You wouldn't hesitate to click a link, but you'd definitely think twice before installing something from an unknown source into your computer, right?
24
+
25
+On top of that, look at these huge frameworks that almost every company is hiring developers for: React, Angular, Vue. These frameworks help JavaScript developers develop "web apps", meaning your JavaScript is now responsible for things the browser should actually be doing for you: two-way data binding, template rendering, and more. Except now, you're downloading a script and running it inside of a virtual interpreter. And because of technologies like Webpack that bundles all your separate code files together (read: static linking), our browsers can't even use the same framework code from site to site.
26
+
27
+Look at Facebook's home page. Just from regular use, that webpage itself can use over 4 gigabytes of RAM. It makes large amounts of network calls for data that's all just being stored in memory. And everyone who opens the Facebook website (for the first time) must download _all_ of that JavaScript. The website has its own tabs (within the page, yes) for chat windows, games, advertisements, embedded video players, and much more I probably didn't even know about. Why are we running full-blown apps in our browser?
28
+
29
+## ok but what can i do
30
+
31
+There's a number of things that can be done to turn this state of the web down a different path. Here's some ideas for users:
32
+
33
+- Disable JavaScript in your browser. Grant websites permission to use JavaScript only if they need it. You'd be surprised how many sites work with JavaScript disabled.
34
+- If you're not ready to do that yet or don't want to, consider [uBlock Origin](https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm?hl=en). It's an extension that can block scripts by source.
35
+
36
+For developers:
37
+
38
+- [svelte](https://svelte.technology/) is a cool alternative to frameworks like Angular or React.
39
+- Consider the impact of every library you include. Can you do without it? What if you just wrote something from scratch instead of importing a full framework to do it?
40
+- Write more non-JavaScript software/libraries. Developers have only turned towards sticking JavaScript everywhere because it's easy to use, and libraries are readily available through npm.
41
+
42
+## ok but what can you do
43
+
44
+I'm helping with a project called flubber, which originated as an IRC bouncer, but is slowly turning into a general messaging protocol. All-in-one messengers exist (and a particular one exists by that name exactly), but they all work by opening a browser view and just loading the page within it, so it's no different from just opening tabs in a browser. Flubber will communicate with these services through APIs, and then expose a uniform interface to clients which makes it easy to bring all into a single view. Check out my progress [here](https://github.com/iptq/flubber). Other than that, I'm also working on making my websites as light as possible in general, including this one (which, by the way, has 0 JavaScript content).
45
+
46
+And of course, I've disabled JavaScript in my browser.
47
+
48
+\</rant\> <small>thanks for reading!</small>

+ 8
- 0
content/_index.md View File

@@ -0,0 +1,8 @@
1
++++
2
+title = "michael's blog"
3
+template = "blog.html"
4
+
5
+sort_by = "date"
6
+paginate_by = 10
7
+paginate_path = "page"
8
++++

+ 2
- 0
content/pages/_index.md View File

@@ -0,0 +1,2 @@
1
++++
2
++++

about.md → content/pages/about.md View File

@@ -1,18 +1,19 @@
1
----
2
-layout: default
3
----
4
-
5
-# about me
1
++++
2
+title = "about me"
3
+template = "post.html"
4
++++
6 5
 
7 6
 Hi there! I'm a Computer Science student at the University of Minnesota, and I've got a wide variety of interests under this field. I've been doing web development for a long time and now I'm looking into security, programming language development, and software development!
8 7
 
8
+In an effort to rely on less services, I started doing a lot of self-hosting and rewriting of software. Check out some of the projects I'm doing over on my public [Git viewer](https://nobs.mzhang.me)!
9
+
9 10
 Here's some of the languages I like, in approximate order of my skill/confidence in using them:
10 11
 
11
-- **Python** My favorite language by far. Aside from its weakness in performance, I love how the language looks, and I'm currently working on a project that aims to use type inferencing to produce lower-level code.
12
+- **Rust** I can't say I'm fluent in Rust, but writing code in Rust just feels right. Most of my recent projects have been done in Rust.
13
+- **Go** I like the way this language is opinionated, and makes for very clean code. Unfortunately, because of their design decisions it's relatively lacking in language features.
14
+- **Python** One of my favorite languages by far. Aside from its weakness in performance, I love how the language looks. I do have several bones to pick, especially towards its dependency ecosystem.
12 15
 - **JavaScript** Although I'm trying to step away from JavaScript, I find myself using it from time to time simply out of ease of use and plethora of libraries.
13
-- **Rust** I can't say I'm fluent in Rust, but writing code in Rust just feels right.
14 16
 - **C** Largely prefer this over C++ because of much finer control over what's happening.
15
-- **Go** I really love this language.
16 17
 - **OCaml** Learned this from a functional programming class, and I still use it from time to time; I kinda see it as the "Python" of function languages.
17 18
 - **C++** Good for when I did competitive programming because of its very comprehensive standard library.
18 19
 
@@ -21,3 +22,4 @@ If you want my resume, contact me through one of these means:
21 22
 ## Contact
22 23
 - Discord: **michael#8440** (this is usually the best place to find me)
23 24
 - Email: (I sign all my Git commits with this email)
25
+- PGP Key: (coming soon)

+ 0
- 4
css/index.scss View File

@@ -1,4 +0,0 @@
1
----
2
----
3
-
4
-@import "main.scss";

+ 0
- 22
index.html View File

@@ -1,22 +0,0 @@
1
----
2
-layout: default
3
----
4
-
5
-<table style="width: 100%;">
6
-    {% for post in site.posts %}
7
-        <tr>
8
-            <td>
9
-                <h3 style="margin-bottom: 0;">
10
-                    <a class="colorlink" href="{{ post.url }}" style="font-weight: 300;">{{ post.title }}</a>
11
-                </h3>
12
-            </td>
13
-            <td style="text-align: right;">
14
-                <small>{{ post.date | date: "%B %e, %Y" }}</small>
15
-            </td>
16
-        </tr>
17
-    {% endfor %}
18
-</table>
19
-
20
-<p style="text-align: center;">
21
-    <small><a href="/feed.xml" class="colorlink">click here for RSS feed</a></small>
22
-</p>

_sass/breakpoints.scss → sass/_breakpoints.scss View File


_sass/colors.scss → sass/_colors.scss View File


_sass/fonts.scss → sass/_fonts.scss View File

@@ -23,3 +23,8 @@
23 23
     font-weight: 300;
24 24
     src: url(/fonts/RobotoMono/RobotoMono-Light.ttf) format("truetype");
25 25
 }
26
+@font-face {
27
+    font-family: "RobotoMono";
28
+    font-weight: 400;
29
+    src: url(/fonts/RobotoMono/RobotoMono-Regular.ttf) format("truetype");
30
+}

_sass/mixins.scss → sass/_mixins.scss View File


_sass/simple-grid.scss → sass/_simple-grid.scss View File


_sass/syntax.scss → sass/_syntax.scss View File


_sass/main.scss → sass/main.scss View File

@@ -4,6 +4,7 @@
4 4
 @import "mixins.scss";
5 5
 @import "simple-grid.scss";
6 6
 @import "syntax.scss";
7
+
7 8
 body {
8 9
     background-color: #f8f8f8;
9 10
     font-family: "Roboto", sans-serif;
@@ -15,6 +16,7 @@ body {
15 16
 }
16 17
 
17 18
 a {
19
+    color: $brand;
18 20
     text-decoration: none;
19 21
 }
20 22
 
@@ -26,6 +28,10 @@ small {
26 28
     @include colored-link(1px, $brand);
27 29
 }
28 30
 
31
+.brand-colorlink:not(.nocolorlink) {
32
+    @include colored-link(1px, $brand);
33
+}
34
+
29 35
 .colorlink:not(.nocolorlink) {
30 36
     @include colored-link(1px, #000);
31 37
 }
@@ -46,11 +52,18 @@ h6 {
46 52
 
47 53
 pre,
48 54
 code {
55
+    font-weight: 400;
49 56
     * {
50 57
         font-family: "RobotoMono", monospace;
51
-        font-weight: 300;
52 58
     }
53
-    padding: 10px;
59
+    padding: 5px;
60
+    margin: 5px;
61
+    border-radius: 5px;
62
+}
63
+
64
+code {
65
+    background-color: #f9f2f4;
66
+    color: #c7254e;
54 67
 }
55 68
 
56 69
 pre:not(.highlight) {

fonts/Roboto/LICENSE.txt → static/fonts/Roboto/LICENSE.txt View File


fonts/Roboto/Roboto-Black.ttf → static/fonts/Roboto/Roboto-Black.ttf View File


fonts/Roboto/Roboto-BlackItalic.ttf → static/fonts/Roboto/Roboto-BlackItalic.ttf View File


fonts/Roboto/Roboto-Bold.ttf → static/fonts/Roboto/Roboto-Bold.ttf View File


fonts/Roboto/Roboto-BoldItalic.ttf → static/fonts/Roboto/Roboto-BoldItalic.ttf View File


fonts/Roboto/Roboto-Italic.ttf → static/fonts/Roboto/Roboto-Italic.ttf View File


fonts/Roboto/Roboto-Light.ttf → static/fonts/Roboto/Roboto-Light.ttf View File


fonts/Roboto/Roboto-LightItalic.ttf → static/fonts/Roboto/Roboto-LightItalic.ttf View File


fonts/Roboto/Roboto-Medium.ttf → static/fonts/Roboto/Roboto-Medium.ttf View File


fonts/Roboto/Roboto-MediumItalic.ttf → static/fonts/Roboto/Roboto-MediumItalic.ttf View File


fonts/Roboto/Roboto-Regular.ttf → static/fonts/Roboto/Roboto-Regular.ttf View File


fonts/Roboto/Roboto-Thin.ttf → static/fonts/Roboto/Roboto-Thin.ttf View File


fonts/Roboto/Roboto-ThinItalic.ttf → static/fonts/Roboto/Roboto-ThinItalic.ttf View File


fonts/RobotoMono/LICENSE.txt → static/fonts/RobotoMono/LICENSE.txt View File


fonts/RobotoMono/RobotoMono-Bold.ttf → static/fonts/RobotoMono/RobotoMono-Bold.ttf View File


fonts/RobotoMono/RobotoMono-BoldItalic.ttf → static/fonts/RobotoMono/RobotoMono-BoldItalic.ttf View File


fonts/RobotoMono/RobotoMono-Italic.ttf → static/fonts/RobotoMono/RobotoMono-Italic.ttf View File


fonts/RobotoMono/RobotoMono-Light.ttf → static/fonts/RobotoMono/RobotoMono-Light.ttf View File


fonts/RobotoMono/RobotoMono-LightItalic.ttf → static/fonts/RobotoMono/RobotoMono-LightItalic.ttf View File


fonts/RobotoMono/RobotoMono-Medium.ttf → static/fonts/RobotoMono/RobotoMono-Medium.ttf View File


fonts/RobotoMono/RobotoMono-MediumItalic.ttf → static/fonts/RobotoMono/RobotoMono-MediumItalic.ttf View File


fonts/RobotoMono/RobotoMono-Regular.ttf → static/fonts/RobotoMono/RobotoMono-Regular.ttf View File


fonts/RobotoMono/RobotoMono-Thin.ttf → static/fonts/RobotoMono/RobotoMono-Thin.ttf View File


fonts/RobotoMono/RobotoMono-ThinItalic.ttf → static/fonts/RobotoMono/RobotoMono-ThinItalic.ttf View File


+ 6
- 0
templates/blog.html View File

@@ -0,0 +1,6 @@
1
+{% extends "layout.html" %}
2
+{% import "macros/blog.html" as blog %}
3
+
4
+{% block content %}
5
+    {{ blog::postlisting(posts=section.pages) }}
6
+{% endblock %}

+ 26
- 0
templates/layout.html View File

@@ -0,0 +1,26 @@
1
+{% import "macros/layout.html" as layout %}
2
+
3
+<html>
4
+
5
+<head>
6
+	<title>michael's blog</title>
7
+	<link rel="stylesheet" href="/main.css" />
8
+	<meta name="viewport" content="width=device-width, initial-scale=1.0">
9
+</head>
10
+
11
+<body>
12
+	<header>
13
+		{{ layout::navbar(config=config) }}
14
+	</header>
15
+
16
+	<div class="container" style="padding: 5px 30px;">
17
+		{% block content %}{% endblock %}
18
+	</div>
19
+
20
+	<div style="text-align: center; font-weight: 200; margin-bottom: 40px;">
21
+	    written by Michael Zhang.
22
+	    <a href="https://git.mzhang.me/michael/blog" class="colorlink" target="_blank">source</a>
23
+	</div>
24
+</body>
25
+
26
+</html>

+ 29
- 0
templates/macros/blog.html View File

@@ -0,0 +1,29 @@
1
+{% macro postlisting(posts) %}
2
+    <table style="width: 100%;">
3
+    {% for post in posts %}
4
+		{% if not post.draft %}
5
+        	<tr>
6
+            	<td>
7
+                	<span style="font-size: 1.2em;">
8
+                    	<a href="{{ post.permalink }}" class="brand-colorlink">{{ post.title }}</a>
9
+                	</span>
10
+                	<br />
11
+                	<small>
12
+                    	Posted {% if post.extra.author %}by {{ post.extra.author }}{% endif %}
13
+                    	on {{ post.date }}
14
+                	</small>
15
+            	</td>
16
+				{% if post.tags %}
17
+            		<td style="text-align: right;" class="hidden-sm">
18
+                		<small>{{ post.tags | join(sep=", ") }}</small>
19
+            		</td>
20
+				{% endif %}
21
+        	</tr>
22
+		{% endif %}
23
+    {% endfor %}
24
+    </table>
25
+
26
+    <p style="text-align: center;">
27
+        <small><a href="/rss.xml">click here for RSS feed</a></small>
28
+    </p>
29
+{% endmacro postlisting %}

+ 11
- 0
templates/macros/layout.html View File

@@ -0,0 +1,11 @@
1
+{% macro navbar(config) %}
2
+    <div class="container">
3
+        <a href="/" class="title nocolorlink">{{ config.title }}</a>
4
+
5
+        <div id="nav">
6
+            {% for link in config.extra.nav_links %}
7
+                <a href="{{ link.url | safe }}" class="link">{{ link.text | replace(from=" ", to="&nbsp;") }}</a>
8
+            {% endfor %}
9
+        </div>
10
+    </div>
11
+{% endmacro navbar %}

+ 16
- 0
templates/post.html View File

@@ -0,0 +1,16 @@
1
+{% extends "layout.html" %}
2
+
3
+{% block content %}
4
+    <h1 style="margin-bottom: 0;">{{ page.title }}</h1>
5
+    {% if page.date or page.author %}
6
+    <small style="display: block; margin-bottom: 20px;">
7
+        Posted
8
+        {% if page.extra.author %}by {{ page.extra.author }}{% endif %}
9
+        on {{ page.date }}
10
+    </small>
11
+    {% endif %}
12
+    {{ page.content | safe }}
13
+	{% if page.extra.link %}
14
+		<p>Visit <a href="{{ page.extra.link }}">here</a> for more info.</p>
15
+	{% endif %}
16
+{% endblock %}