From dc8f0c34508f3ccea2f6cf3fe5db348abd531eb2 Mon Sep 17 00:00:00 2001 From: Oleh Prypin Date: Thu, 7 Jan 2021 01:14:28 +0100 Subject: [PATCH] Vendor external dependency --- Makefile | 6 +++++- nightly_link.cr | 10 ++++++++++ templates/head.html | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8defbc2..ecf84b7 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,9 @@ release ?= md_files = $(wildcard *.md) html_files := $(md_files:.md=.html) +vendored_files := github-markdown.min.css -nightly_link: nightly_link.cr $(wildcard *.cr) $(html_files) $(wildcard templates/*.html) +nightly_link: nightly_link.cr $(wildcard *.cr) $(html_files) $(wildcard templates/*.html) $(vendored_files) $(CRYSTAL) build $(if $(release),--release )$< render_md: render_md.cr @@ -13,6 +14,9 @@ render_md: render_md.cr %.html: %.md render_md ./render_md $< > $@ +github-markdown.min.css: + curl -O https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/4.0.0/github-markdown.min.css + .PHONY: clean clean: rm -f $(html_files) render_md nightly_link diff --git a/nightly_link.cr b/nightly_link.cr index d92886c..c899783 100644 --- a/nightly_link.cr +++ b/nightly_link.cr @@ -398,4 +398,14 @@ class ArtifactsController < ART::Controller end end +class StaticController < ART::Controller + @[ART::Get(path: "/github-markdown.min.css")] + def css : ART::Response + ART::Response.new( + {{read_file("#{__DIR__}/github-markdown.min.css")}}, + headers: HTTP::Headers{"content-type" => MIME.from_extension(".css")} + ) + end +end + ART.run(host: "127.0.0.1", port: PORT) diff --git a/templates/head.html b/templates/head.html index ef6c265..303e768 100644 --- a/templates/head.html +++ b/templates/head.html @@ -1,6 +1,6 @@ - +