forked from avelino/awesome-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Markdown to html, generate page to awesome-go.com (avelino#1127)
* initial version html generate After being made to change the master generate html based on markdown, ref avelino#363 * change package name, repo to main * up port 80 on caddy server * install mux on travis build * generate sitemap * added robots.txt * set metatags on html page * update repo via exec get the most current readme * remove unnecessary lowdash assign * fix linter errors, remove unnecessary conversion, add binary to .gitignore * fix fonts, use domain-level assets
- Loading branch information
1 parent
ff219e2
commit d6a65b7
Showing
57 changed files
with
2,014 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
tmpl/index.html | ||
awesome-go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM golang:alpine | ||
|
||
RUN apk add --update -t build-deps curl go git libc-dev gcc libgcc | ||
RUN go get github.com/russross/blackfriday github.com/gorilla/mux | ||
|
||
WORKDIR /srv | ||
|
||
CMD ["go", "run", "repo.go"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: "2" | ||
|
||
services: | ||
caddy: | ||
image: abiosoft/caddy | ||
volumes: | ||
- ./tmpl:/srv | ||
ports: | ||
- 80:2015 | ||
webhook: | ||
build: ./ | ||
volumes: | ||
- ./:/srv | ||
ports: | ||
- 9000:9000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,41 @@ | ||
package repo | ||
package main | ||
|
||
import ( | ||
"io/ioutil" | ||
"net/http" | ||
"os" | ||
"os/exec" | ||
"text/template" | ||
|
||
"github.com/gorilla/mux" | ||
"github.com/russross/blackfriday" | ||
) | ||
|
||
type content struct { | ||
Body string | ||
} | ||
|
||
func generateHTML() { | ||
// Update repo | ||
exec.Command("git", "checkout", "-f").Output() | ||
exec.Command("git", "pull").Output() | ||
|
||
input, _ := ioutil.ReadFile("./README.md") | ||
body := string(blackfriday.MarkdownCommon(input)) | ||
c := &content{Body: body} | ||
|
||
t := template.Must(template.ParseFiles("tmpl/tmpl.html")) | ||
f, _ := os.Create("tmpl/index.html") | ||
t.Execute(f, c) | ||
} | ||
|
||
func hookHandler(w http.ResponseWriter, r *http.Request) { | ||
go generateHTML() | ||
w.Write([]byte("Done!\n")) | ||
} | ||
|
||
func main() { | ||
r := mux.NewRouter() | ||
r.HandleFunc("/hook", hookHandler) | ||
http.ListenAndServe(":9000", r) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package repo | ||
package main | ||
|
||
import ( | ||
"bytes" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
* { | ||
max-width: 100%; | ||
box-sizing: border-box; | ||
font-family: "Fira Sans"; | ||
text-decoration: none; | ||
font-weight: 300; | ||
} | ||
.awesome-logo { | ||
max-width: 500px; | ||
width: 100%; | ||
margin: auto; | ||
display: block; | ||
} | ||
|
||
a { | ||
color: #669; | ||
} | ||
a:visited, h1, h2, h3, h4 { | ||
color: #494368; | ||
font-weight: 400; | ||
} | ||
h1 > a:nth-child(1) { | ||
margin-left: 10px; | ||
} | ||
h1 > a img { | ||
padding-right: 5px; | ||
} | ||
|
||
#content { | ||
width: 100%; | ||
padding: 40px 80px; | ||
} | ||
|
||
@media (max-width: 720px) { | ||
#content { | ||
padding: 20px 40px; | ||
} | ||
} | ||
@media (max-width: 420px) { | ||
#content * { | ||
word-wrap: break-word; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
@font-face { | ||
font-family: 'Fira Sans'; | ||
src: local('Fira Sans ExtraLight'), | ||
local('FiraSans-ExtraLight'), | ||
url('/assets/fonts/firasansextralight.woff2') format('woff2'), | ||
url('/assets/fonts/firasansextralight.woff') format('woff'), | ||
url('/assets/fonts/firasansextralight.ttf') format('truetype'); | ||
font-weight: 100; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: 'Fira Sans'; | ||
src: local('Fira Sans ExtraLight Italic'), | ||
local('FiraSans-ExtraLightItalic'), | ||
url('/assets/fonts/firasansextralightitalic.woff2') format('woff2'), | ||
url('/assets/fonts/firasansextralightitalic.woff') format('woff'), | ||
url('/assets/fonts/firasansextralightitalic.ttf') format('truetype'); | ||
font-weight: 100; | ||
font-style: italic; | ||
} | ||
@font-face { | ||
font-family: 'Fira Sans'; | ||
src: local('Fira Sans Light'), | ||
local('FiraSans-Light'), | ||
url('/assets/fonts/firasanslight.woff2') format('woff2'), | ||
url('/assets/fonts/firasanslight.woff') format('woff'), | ||
url('/assets/fonts/firasanslight.ttf') format('truetype'); | ||
font-weight: 200; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: 'Fira Sans'; | ||
src: local('Fira Sans Light Italic'), | ||
local('FiraSans-LightItalic'), | ||
url('/assets/fonts/firasanslightitalic.woff2') format('woff2'), | ||
url('/assets/fonts/firasanslightitalic.woff') format('woff'), | ||
url('/assets/fonts/firasanslightitalic.ttf') format('truetype'); | ||
font-weight: 200; | ||
font-style: italic; | ||
} | ||
@font-face { | ||
font-family: 'Fira Sans'; | ||
src: local('Fira Sans Book'), | ||
local('FiraSans-Book'), | ||
url('/assets/fonts/firasansbook.woff2') format('woff2'), | ||
url('/assets/fonts/firasansbook.woff') format('woff'), | ||
url('/assets/fonts/firasansbook.ttf') format('truetype'); | ||
font-weight: 300; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: 'Fira Sans'; | ||
src: local('Fira Sans Book Italic'), | ||
local('FiraSans-BookItalic'), | ||
url('/assets/fonts/firasansbookitalic.woff2') format('woff2'), | ||
url('/assets/fonts/firasansbookitalic.woff') format('woff'), | ||
url('/assets/fonts/firasansbookitalic.ttf') format('truetype'); | ||
font-weight: 300; | ||
font-style: italic; | ||
} | ||
@font-face { | ||
font-family: 'Fira Sans'; | ||
src: local('Fira Sans'), | ||
local('FiraSans-Regular'), | ||
url('/assets/fonts/firasans.woff2') format('woff2'), | ||
url('/assets/fonts/firasans.woff') format('woff'), | ||
url('/assets/fonts/firasans.ttf') format('truetype'); | ||
font-weight: 400; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: 'Fira Sans'; | ||
src: local('Fira Sans Italic'), | ||
local('FiraSans-Italic'), | ||
url('/assets/fonts/firasansitalic.woff2') format('woff2'), | ||
url('/assets/fonts/firasansitalic.woff') format('woff'), | ||
url('/assets/fonts/firasansitalic.ttf') format('truetype'); | ||
font-weight: 400; | ||
font-style: italic; | ||
} | ||
@font-face { | ||
font-family: 'Fira Sans'; | ||
src: local('Fira Sans Medium'), | ||
local('FiraSans-Medium'), | ||
url('/assets/fonts/firasansmedium.woff2') format('woff2'), | ||
url('/assets/fonts/firasansmedium.woff') format('woff'), | ||
url('/assets/fonts/firasansmedium.ttf') format('truetype'); | ||
font-weight: 500; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: 'Fira Sans'; | ||
src: local('Fira Sans Medium Italic'), | ||
local('FiraSans-MediumItalic'), | ||
url('/assets/fonts/firasansmediumitalic.woff2') format('woff2'), | ||
url('/assets/fonts/firasansmediumitalic.woff') format('woff'), | ||
url('/assets/fonts/firasansmediumitalic.ttf') format('truetype'); | ||
font-weight: 500; | ||
font-style: italic; | ||
} | ||
@font-face { | ||
font-family: 'Fira Sans'; | ||
src: local('Fira Sans SemiBold'), | ||
local('FiraSans-SemiBold'), | ||
url('/assets/fonts/firasanssemibold.woff2') format('woff2'), | ||
url('/assets/fonts/firasanssemibold.woff') format('woff'), | ||
url('/assets/fonts/firasanssemibold.ttf') format('truetype'); | ||
font-weight: 600; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: 'Fira Sans'; | ||
src: local('Fira Sans SemiBold Italic'), | ||
local('FiraSans-SemiBoldItalic'), | ||
url('/assets/fonts/firasanssemibolditalic.woff2') format('woff2'), | ||
url('/assets/fonts/firasanssemibolditalic.woff') format('woff'), | ||
url('/assets/fonts/firasanssemibolditalic.ttf') format('truetype'); | ||
font-weight: 600; | ||
font-style: italic; | ||
} | ||
@font-face { | ||
font-family: 'Fira Sans'; | ||
src: local('Fira Sans Bold'), | ||
local('FiraSans-Bold'), | ||
url('/assets/fonts/firasansbold.woff2') format('woff2'), | ||
url('/assets/fonts/firasansbold.woff') format('woff'), | ||
url('/assets/fonts/firasansbold.ttf') format('truetype'); | ||
font-weight: 700; | ||
font-style: normal; | ||
} | ||
@font-face { | ||
font-family: 'Fira Sans'; | ||
src: local('Fira Sans Bold Italic'), | ||
local('FiraSans-BoldItalic'), | ||
url('/assets/fonts/firasansbolditalic.woff2') format('woff2'), | ||
url('/assets/fonts/firasansbolditalic.woff') format('woff'), | ||
url('/assets/fonts/firasansbolditalic.ttf') format('truetype'); | ||
font-weight: 700; | ||
font-style: italic; | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.