-
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.
- Loading branch information
1 parent
1d4bd97
commit cc52c20
Showing
14 changed files
with
257 additions
and
0 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,16 @@ | ||
---- | ||
- Title: Test | ||
- Description: description | ||
---- | ||
|
||
# Heading1 | ||
|
||
description1 | ||
|
||
## Heading2 | ||
|
||
description1 | ||
|
||
- list | ||
- item | ||
- item |
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,22 @@ | ||
---- | ||
- Title: "SSG" | ||
- Description: "description" | ||
---- | ||
|
||
# Go ssg generator | ||
## Overview | ||
|
||
- template: svelte | ||
- generator: go (write this) | ||
|
||
## Steps | ||
|
||
- define svelte/md code | ||
- run gen | ||
- get md data in go | ||
- run svelte compiler with template with the given data | ||
|
||
## Refs | ||
|
||
- https://github.com/zupzup/blog-generator | ||
- https://www.zupzup.org/static-blog-generator-go/index.html |
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,7 @@ | ||
/* templates/detail.css */ | ||
.detail_title { | ||
font-size: 1.5rem; | ||
font-weight: 600; | ||
margin-bottom: .5rem; | ||
color: red; | ||
} |
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,7 @@ | ||
/* templates/layout.css */ | ||
.description { | ||
font-size: 1.2rem; | ||
font-weight: 300; | ||
line-height: 1.5; | ||
margin-bottom: 1.5rem; | ||
} |
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 @@ | ||
/* templates/layout.css */ | ||
.description { | ||
font-size: 1.2rem; | ||
font-weight: 300; | ||
line-height: 1.5; | ||
margin-bottom: 1.5rem; | ||
} | ||
|
||
/* templates/list.css */ | ||
.title { | ||
font-size: 1.5rem; | ||
font-weight: 600; | ||
margin-bottom: .5rem; | ||
color: red; | ||
} |
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,24 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-us"> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"/> | ||
<meta name="title" content="Articles List"/> | ||
<meta name="description" content="List of articles"/> | ||
|
||
<link rel="stylesheet" href="./list.css"> | ||
<title>Articles</title> | ||
</head> | ||
<body> | ||
<div id="content"> | ||
<h1 id="title">Articles</h1> | ||
<ul> | ||
|
||
<li><a href="generated/test.html">Test</a></li> | ||
|
||
<li><a href="generated/testMd.html">SSG</a></li> | ||
|
||
</ul> | ||
</div> | ||
</body> | ||
</html> |
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,34 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-us"> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"/> | ||
<meta name="title" content="Example Title"/> | ||
<meta name="description" content="Example Description"/> | ||
<title>My Page Title</title> | ||
|
||
<link rel="stylesheet" href="./detail.css"> | ||
</head> | ||
<body> | ||
<div id="content"> | ||
<h1 class="detail_title">My Page Title</h1> | ||
<h1 id="heading1">Heading1</h1> | ||
|
||
<p>description1</p> | ||
|
||
<h2 id="heading2">Heading2</h2> | ||
|
||
<p>description1</p> | ||
|
||
<ul> | ||
<li>list | ||
|
||
<ul> | ||
<li>item</li> | ||
<li>item</li> | ||
</ul></li> | ||
</ul> | ||
|
||
</div> | ||
</body> | ||
</html> |
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,45 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-us"> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"/> | ||
<meta name="title" content="Example Title"/> | ||
<meta name="description" content="Example Description"/> | ||
<title>My Page Title</title> | ||
|
||
<link rel="stylesheet" href="./detail.css"> | ||
</head> | ||
<body> | ||
<div id="content"> | ||
<h1 class="detail_title">My Page Title</h1> | ||
<h1 id="go-ssg-generator">Go ssg generator</h1> | ||
|
||
<h2 id="overview">Overview</h2> | ||
|
||
<ul> | ||
<li>template: svelte</li> | ||
<li>generator: go (write this)</li> | ||
</ul> | ||
|
||
<h2 id="steps">Steps</h2> | ||
|
||
<ul> | ||
<li>define svelte/md code</li> | ||
<li>run gen | ||
|
||
<ul> | ||
<li>get md data in go</li> | ||
<li>run svelte compiler with template with the given data</li> | ||
</ul></li> | ||
</ul> | ||
|
||
<h2 id="refs">Refs</h2> | ||
|
||
<ul> | ||
<li><a href="https://github.com/zupzup/blog-generator" target="_blank">https://github.com/zupzup/blog-generator</a></li> | ||
<li><a href="https://www.zupzup.org/static-blog-generator-go/index.html" target="_blank">https://www.zupzup.org/static-blog-generator-go/index.html</a></li> | ||
</ul> | ||
|
||
</div> | ||
</body> | ||
</html> |
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,26 @@ | ||
package main | ||
|
||
import ( | ||
gosimplessg "go-simple-ssg" | ||
"go-simple-ssg/config" | ||
"log" | ||
"net/http" | ||
) | ||
|
||
func main() { | ||
baseConfig := config.NewConfig(config.Config{}) | ||
engine := gosimplessg.New(baseConfig) | ||
engine.Build() | ||
serveFiles() | ||
|
||
} | ||
|
||
func serveFiles() { | ||
fs := http.FileServer(http.Dir(config.GENERATED_HTML_DIR)) | ||
http.Handle("/", fs) | ||
log.Println("Serving files on http://localhost:8080...") | ||
err := http.ListenAndServe(":8081", nil) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
} |
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,7 @@ | ||
|
||
.detail_title { | ||
font-size: 1.5rem; | ||
font-weight: 600; | ||
margin-bottom: 0.5rem; | ||
color: red; | ||
} |
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,18 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-us"> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"/> | ||
<meta name="title" content="{{.HTMLTitle}}"/> | ||
<meta name="description" content="{{.MetaDescription}}"/> | ||
<title>{{.PageTitle}}</title> | ||
<!-- Generated path --> | ||
<link rel="stylesheet" href="./detail.css"> | ||
</head> | ||
<body> | ||
<div id="content"> | ||
<h1 class="detail_title">{{.PageTitle}}</h1> | ||
{{.Content}} | ||
</div> | ||
</body> | ||
</html> |
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,7 @@ | ||
|
||
.description { | ||
font-size: 1.2rem; | ||
font-weight: 300; | ||
line-height: 1.5; | ||
margin-bottom: 1.5rem; | ||
} |
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,7 @@ | ||
@import url("./layout.css"); | ||
.title { | ||
font-size: 1.5rem; | ||
font-weight: 600; | ||
margin-bottom: 0.5rem; | ||
color: red; | ||
} |
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,22 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-us"> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"/> | ||
<meta name="title" content="{{.HTMLTitle}}"/> | ||
<meta name="description" content="{{.MetaDescription}}"/> | ||
<!-- Generated path --> | ||
<link rel="stylesheet" href="./list.css"> | ||
<title>{{.PageTitle}}</title> | ||
</head> | ||
<body> | ||
<div id="content"> | ||
<h1 id="title">{{.PageTitle}}</h1> | ||
<ul> | ||
{{range .Articles}} | ||
<li><a href="{{.Path}}">{{.Title}}</a></li> | ||
{{end}} | ||
</ul> | ||
</div> | ||
</body> | ||
</html> |