Embed gist rather than use js script
This commit is contained in:
parent
bfbeb5be2f
commit
4fa7d34d1a
4 changed files with 18 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -226,3 +226,4 @@ ENV/
|
|||
/site
|
||||
|
||||
# End of https://www.gitignore.io/api/hugo,node,python,jetbrains
|
||||
static/src/scss/highlight.css
|
||||
|
|
1
Makefile
1
Makefile
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
||||
<a href="{{ $e.raw_url }}">
|
||||
<i>View Raw</i>
|
||||
</a>
|
||||
</h5>
|
||||
{{ highlight $e.content $e.language "" }}
|
||||
{{ end }}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue