Browse Source

Add shortcode to get file from GitHub

master
Jake Howard 2 years ago
parent
commit
64d0aaa8b4
Signed by: theorangeone GPG Key ID: 57AFB45680EDD477
  1. 9
      content/linux/x-pretty-qt.md
  2. 3
      content/netlify/_index.md
  3. 10
      layouts/shortcodes/github_file.html

9
content/linux/x-pretty-qt.md

@ -0,0 +1,9 @@
---
title: Patch `xsession` so QT looks nice
---
After writing [Make QT less ugly](https://theorangeone.net/posts/make-qt-less-ugly/), I switched to LightDM, which completely broke it.
This is the patch for `/etc/lightdm/Xsession` to stop it overriding my tweaks.
{{< github_file repo="realorangeone/dotfiles" path="files/xsession.patch" >}}

3
content/netlify/_index.md

@ -1,3 +0,0 @@
---
title: Netlify
---

10
layouts/shortcodes/github_file.html

@ -0,0 +1,10 @@
{{ $repo := .Get "repo" }}
{{ $path := .Get "path" }}
{{ $extension := index (last 1 (split $path ".")) 0 }}
{{ $data := getJSON "https://api.github.com/repos/" $repo "/contents/" $path }}
{{ $content := $data.content | base64Decode }}
{{ highlight $content $extension "" }}
<p><a href="{{ $data.html_url }}">View {{ $data.name }}</a></p>
Loading…
Cancel
Save