1
Fork 0

Embed gist rather than use js script

This commit is contained in:
Jake Howard 2017-09-30 22:18:21 +01:00
parent bfbeb5be2f
commit 4fa7d34d1a
Signed by: jake
GPG key ID: 57AFB45680EDD477
4 changed files with 18 additions and 2 deletions

1
.gitignore vendored
View file

@ -226,3 +226,4 @@ ENV/
/site
# End of https://www.gitignore.io/api/hugo,node,python,jetbrains
static/src/scss/highlight.css

View file

@ -10,6 +10,7 @@ build: install
rm -rf $(OUTPUT_DIR)
rm -rf $(STATIC_BUILD)
mkdir -p $(STATIC_BUILD)/js $(STATIC_BUILD)/css
hugo gen chromastyles --style=tango > $(STATIC_SRC)/scss/highlight.css
$(NODE_BIN)/browserify $(STATIC_SRC)/js/index.js -o $(STATIC_BUILD)/js/app.js
$(NODE_BIN)/node-sass $(STATIC_SRC)/scss/style.scss $(STATIC_BUILD)/css/style.css --source-map-embed
cp -r $(BASEDIR)/node_modules/font-awesome/fonts $(STATIC_BUILD)/fonts

View file

@ -1,3 +1,15 @@
{{ $id := default (.Get 0) .Page.Params.gist }}
{{ $data := getJSON "https://api.github.com/gists/" $id }}
<script src='{{ $data.html_url }}.js'></script>
{{ range $i, $e := $data.files }}
<h5>
<a href="{{ $data.html_url }}#file-{{ $i }}">
<strong>{{ $i }}</strong>
</a>
&nbsp;&nbsp;
<a href="{{ $e.raw_url }}">
<i>View Raw</i>
</a>
</h5>
{{ highlight $e.content $e.language "" }}
{{ end }}

View file

@ -6,9 +6,10 @@ $fa-font-path: "../fonts";
@import "node_modules/bootstrap/scss/_transitions";
@import "node_modules/bootstrap/scss/_card";
@import "node_modules/bootstrap/scss/_badge";
@import "node_modules/pygments-css/github";
@import "node_modules/lightgallery/src/sass/lightgallery";
@import "highlight"; // Generated by Hugo
@import "alpha.min";
.box .box {
@ -52,6 +53,7 @@ pre code {
border-radius: 0;
background: none;
padding: 0;
font-size: 0.75em;
}
code {