Add shortcode to get file from GitHub
This commit is contained in:
parent
27b661c90b
commit
64d0aaa8b4
3 changed files with 19 additions and 3 deletions
9
content/linux/x-pretty-qt.md
Normal file
9
content/linux/x-pretty-qt.md
Normal file
|
@ -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" >}}
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
title: Netlify
|
||||
---
|
10
layouts/shortcodes/github_file.html
Normal file
10
layouts/shortcodes/github_file.html
Normal file
|
@ -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>
|
Reference in a new issue