mirror of
https://github.com/arnaucube/padArchiver.git
synced 2026-02-06 19:26:48 +01:00
added build, and added side menu to webserver
This commit is contained in:
18
README.md
18
README.md
@@ -1,14 +1,16 @@
|
|||||||
# padArchiver
|
# padArchiver
|
||||||
Tool to store a pad (from the link) into IPFS and Git.
|
Tool to store a pad (from the link) into IPFS and Git.
|
||||||
|
|
||||||
## webServer
|
All the necessary files are in the /build directory.
|
||||||
|
|
||||||
|
## 1.- webServer
|
||||||
This is a webserver that automatically generates a web from the pads directories and files stored.
|
This is a webserver that automatically generates a web from the pads directories and files stored.
|
||||||
To run:
|
To run, inside 'build' directory:
|
||||||
```
|
```
|
||||||
./webServer
|
./webServer
|
||||||
```
|
```
|
||||||
|
|
||||||
## listPadsImporter
|
## 2.- listPadsImporter
|
||||||
This is to import all pads from the json file 'list.json'.
|
This is to import all pads from the json file 'list.json'.
|
||||||
Just need to edit the json file, for example:
|
Just need to edit the json file, for example:
|
||||||
```json
|
```json
|
||||||
@@ -33,12 +35,12 @@ Just need to edit the json file, for example:
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
And then execute the importer:
|
To run, inside 'build' directory:
|
||||||
```
|
```
|
||||||
./importFromList
|
./importFromList
|
||||||
```
|
```
|
||||||
|
|
||||||
## apiServer
|
## 3.- apiServer
|
||||||
This is an API to run in localhost.
|
This is an API to run in localhost.
|
||||||
|
|
||||||
#### Run
|
#### Run
|
||||||
@@ -56,7 +58,7 @@ To run using the compiled binary:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
- Execute the API server:
|
- Execute the API server, inside the directory 'build':
|
||||||
```
|
```
|
||||||
> ./padArchiver-APIserver
|
> ./padArchiver-APIserver
|
||||||
```
|
```
|
||||||
@@ -108,8 +110,8 @@ this returns:
|
|||||||
```
|
```
|
||||||
The IPFS hash is also added to the first line of the document, before adding the document to Git.
|
The IPFS hash is also added to the first line of the document, before adding the document to Git.
|
||||||
|
|
||||||
## cli
|
## 4.- cli
|
||||||
To run the CLI, just need to run:
|
To run the CLI, just need to run inside the directory 'build':
|
||||||
```
|
```
|
||||||
./padArchiver-cli
|
./padArchiver-cli
|
||||||
```
|
```
|
||||||
|
|||||||
Binary file not shown.
@@ -89,7 +89,7 @@ func PostStorePad(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
defer r.Body.Close()
|
defer r.Body.Close()
|
||||||
|
|
||||||
ipfsHash, err := repo.StorePad(pad.Link, pad.Dir, pad.Title)
|
ipfsHash, err := repo.StorePad(pad.Link, pad.Dir, pad.Title, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, "error storing pad", http.StatusConflict)
|
http.Error(w, "error storing pad", http.StatusConflict)
|
||||||
}
|
}
|
||||||
|
|||||||
31
build.sh
Normal file
31
build.sh
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
echo "starting build process"
|
||||||
|
rm -rf build
|
||||||
|
mkdir build
|
||||||
|
|
||||||
|
cd webServer
|
||||||
|
echo "building webServer"
|
||||||
|
go build
|
||||||
|
cp webServer ../build
|
||||||
|
cp -r templates ../build
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cd listPadsImporter
|
||||||
|
echo "building listPadsImporter"
|
||||||
|
go build
|
||||||
|
cp listPadsImporter ../build
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cd apiServer
|
||||||
|
echo "building apiServer"
|
||||||
|
go build
|
||||||
|
cp apiServer ../build
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
|
||||||
|
cd cli
|
||||||
|
echo "building cli"
|
||||||
|
go build
|
||||||
|
cp cli ../build
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
echo "build process complete, all the necessary files are in the /build directory"
|
||||||
BIN
build/apiServer
Executable file
BIN
build/apiServer
Executable file
Binary file not shown.
BIN
build/listPadsImporter
Executable file
BIN
build/listPadsImporter
Executable file
Binary file not shown.
18
build/templates/menuTemplate.html
Normal file
18
build/templates/menuTemplate.html
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<ul class="list-group">
|
||||||
|
{{range .Items}} {{if .IsDir}}
|
||||||
|
<br><br>
|
||||||
|
<nav aria-label="breadcrumb">
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li class="breadcrumb-item active" aria-current="page">
|
||||||
|
<a href="{{.Path}}">
|
||||||
|
<i class="fas fa-folder"></i> {{.Name}}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
{{else}}
|
||||||
|
<a href="{{.Path}}" class="list-group-item">
|
||||||
|
<i class="fas fa-file-alt"></i> {{.Name}}
|
||||||
|
</a> {{end}} {{end}}
|
||||||
|
</ul>
|
||||||
98
build/templates/pageTemplate.html
Normal file
98
build/templates/pageTemplate.html
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<!-- Required meta tags -->
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
|
||||||
|
<!-- Bootstrap CSS -->
|
||||||
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
|
||||||
|
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
footer {
|
||||||
|
width:100%;
|
||||||
|
background: #38414f;
|
||||||
|
color: #bec0c4;
|
||||||
|
margin-top: 80px;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
a:link {
|
||||||
|
color: #008ae6;
|
||||||
|
}
|
||||||
|
a:visited {
|
||||||
|
color: #008ae6;
|
||||||
|
}
|
||||||
|
a:hover {
|
||||||
|
color: #33adff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<title>padArchiver</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||||
|
<a class="navbar-brand" href="/">
|
||||||
|
<img src="https://seeklogo.com/images/G/go-logo-046185B647-seeklogo.com.png" height="30" class="d-inline-block align-top" alt="">
|
||||||
|
padArchiver
|
||||||
|
</a>
|
||||||
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||||
|
<!--<ul class="navbar-nav mr-auto">
|
||||||
|
<li class="nav-item active">
|
||||||
|
<a class="nav-link" href="/">Home <span class="sr-only">(current)</span></a>
|
||||||
|
</li>
|
||||||
|
</ul>-->
|
||||||
|
</div>
|
||||||
|
<form class="form-inline my-2 my-lg-0">
|
||||||
|
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
|
||||||
|
<button class="btn btn-outline-info my-2 my-sm-0" type="submit">Search</button>
|
||||||
|
</form>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<br><br>
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-3">
|
||||||
|
{{.MenuContent}}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<h3>{{.Title}}</h3>
|
||||||
|
<hr> {{.Content}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<footer class="text-muted">
|
||||||
|
<div class="container">
|
||||||
|
<p class="float-right">
|
||||||
|
<a href="#">Back to top</a>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
padArchiver - webServer
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Github: <a href="https://github.com/arnaucode/padArchiver" target="_blank">https://github.com/arnaucode/padArchiver</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<!-- Optional JavaScript -->
|
||||||
|
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
|
||||||
|
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
|
||||||
|
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
|
||||||
|
|
||||||
|
<!-- font awesome icons -->
|
||||||
|
<script defer src="https://use.fontawesome.com/releases/v5.0.10/js/all.js" integrity="sha384-slN8GvtUJGnv6ca26v8EzVaR9DC58QEwsIk9q1QXdCU8Yu8ck/tL/5szYlBbqmS+" crossorigin="anonymous"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
7
build/templates/wellcome.md
Normal file
7
build/templates/wellcome.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
### Wellcome to the padArchiver.
|
||||||
|
Select one pad from the side menu to visualize.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
This is the wellcome message, from the 'templates/wellcome.md' file.
|
||||||
BIN
build/webServer
Executable file
BIN
build/webServer
Executable file
Binary file not shown.
@@ -87,7 +87,7 @@ func option1() {
|
|||||||
|
|
||||||
repo := padArchiver.OpenRepo(repoID)
|
repo := padArchiver.OpenRepo(repoID)
|
||||||
|
|
||||||
ipfsHash, err := repo.StorePad(link, subdirectory, title)
|
ipfsHash, err := repo.StorePad(link, subdirectory, title, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
color.Red(err.Error())
|
color.Red(err.Error())
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -15,6 +15,11 @@
|
|||||||
"link": "http://board.net/p/pad3",
|
"link": "http://board.net/p/pad3",
|
||||||
"dir": "Group2",
|
"dir": "Group2",
|
||||||
"title": "Pad3"
|
"title": "Pad3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"link": "http://board.net/p/loremipsum",
|
||||||
|
"dir": "SubArea1",
|
||||||
|
"title": "loremipsum"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -58,7 +58,7 @@ func main() {
|
|||||||
fmt.Println(" link: " + pad.Link)
|
fmt.Println(" link: " + pad.Link)
|
||||||
fmt.Println(" dir: " + pad.Dir)
|
fmt.Println(" dir: " + pad.Dir)
|
||||||
fmt.Println(" title: " + pad.Title)
|
fmt.Println(" title: " + pad.Title)
|
||||||
ipfsHash, err := repo.StorePad(pad.Link, pad.Dir, pad.Title)
|
ipfsHash, err := repo.StorePad(pad.Link, pad.Dir, pad.Title, false)
|
||||||
check(err)
|
check(err)
|
||||||
fmt.Println(" ipfs hash: " + ipfsHash)
|
fmt.Println(" ipfs hash: " + ipfsHash)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,13 +23,16 @@ func OpenRepo(directory string) Repo {
|
|||||||
return repo
|
return repo
|
||||||
}
|
}
|
||||||
|
|
||||||
func (repo *Repo) StorePad(link string, directory string, title string) (string, error) {
|
func (repo *Repo) StorePad(link string, directory string, title string, ipfsActive bool) (string, error) {
|
||||||
path, err := repo.GetPad(link, "md", directory, title)
|
path, err := repo.GetPad(link, "md", directory, title)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
color.Red(err.Error())
|
color.Red(err.Error())
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !ipfsActive {
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
hash, err := IpfsAdd(path)
|
hash, err := IpfsAdd(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
color.Red(err.Error())
|
color.Red(err.Error())
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const checkIcon = "\xE2\x9C\x94 "
|
|||||||
func TestAddPad(t *testing.T) {
|
func TestAddPad(t *testing.T) {
|
||||||
color.Blue("TestAddPad")
|
color.Blue("TestAddPad")
|
||||||
repo := OpenRepo("Repo01")
|
repo := OpenRepo("Repo01")
|
||||||
_, err := repo.StorePad("http://board.net/p/pad1", "Group1", "pad1")
|
_, err := repo.StorePad("http://board.net/p/pad1", "Group1", "pad1", true)
|
||||||
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
color.Green(checkIcon + "checked AddPad")
|
color.Green(checkIcon + "checked AddPad")
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"html/template"
|
"html/template"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -13,15 +14,19 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type ItemModel struct {
|
type ItemModel struct {
|
||||||
Name string
|
Name string
|
||||||
Path string
|
Path string
|
||||||
IsDir bool
|
IsDir bool
|
||||||
Content template.HTML
|
|
||||||
}
|
}
|
||||||
type MenuModel struct {
|
type MenuModel struct {
|
||||||
PageTitle string
|
PageTitle string
|
||||||
Items []ItemModel
|
Items []ItemModel
|
||||||
}
|
}
|
||||||
|
type PageModel struct {
|
||||||
|
Title string
|
||||||
|
MenuContent template.HTML
|
||||||
|
Content template.HTML
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
@@ -35,7 +40,7 @@ func main() {
|
|||||||
log.Fatal(http.ListenAndServe(":8080", router))
|
log.Fatal(http.ListenAndServe(":8080", router))
|
||||||
}
|
}
|
||||||
|
|
||||||
func generateMenu(dirpath string) MenuModel {
|
func generateMenuItems(dirpath string) MenuModel {
|
||||||
var menuPage MenuModel
|
var menuPage MenuModel
|
||||||
menuPage.PageTitle = "padArchiver - Menu"
|
menuPage.PageTitle = "padArchiver - Menu"
|
||||||
_ = filepath.Walk(padArchiver.Storage+dirpath, func(path string, f os.FileInfo, err error) error {
|
_ = filepath.Walk(padArchiver.Storage+dirpath, func(path string, f os.FileInfo, err error) error {
|
||||||
@@ -56,6 +61,14 @@ func generateMenu(dirpath string) MenuModel {
|
|||||||
})
|
})
|
||||||
return menuPage
|
return menuPage
|
||||||
}
|
}
|
||||||
|
func generateMenuHTML(dirpath string) template.HTML {
|
||||||
|
menuItems := generateMenuItems(dirpath)
|
||||||
|
tmplMenu := template.Must(template.ParseFiles("templates/menuTemplate.html"))
|
||||||
|
var tpl bytes.Buffer
|
||||||
|
err := tmplMenu.Execute(&tpl, menuItems)
|
||||||
|
check(err)
|
||||||
|
return template.HTML(tpl.String())
|
||||||
|
}
|
||||||
func getDir(w http.ResponseWriter, r *http.Request) {
|
func getDir(w http.ResponseWriter, r *http.Request) {
|
||||||
vars := mux.Vars(r)
|
vars := mux.Vars(r)
|
||||||
var dirpath string
|
var dirpath string
|
||||||
@@ -63,11 +76,18 @@ func getDir(w http.ResponseWriter, r *http.Request) {
|
|||||||
dirpath = vars["path"]
|
dirpath = vars["path"]
|
||||||
dirpath = strings.Replace(dirpath, "%", "/", -1)
|
dirpath = strings.Replace(dirpath, "%", "/", -1)
|
||||||
}
|
}
|
||||||
|
var page PageModel
|
||||||
|
page.Title = dirpath
|
||||||
|
if dirpath == "" {
|
||||||
|
page.Title = "padArchiver"
|
||||||
|
}
|
||||||
|
page.MenuContent = generateMenuHTML(dirpath)
|
||||||
|
content, err := fileToHTML("templates/wellcome.md")
|
||||||
|
check(err)
|
||||||
|
page.Content = template.HTML(content)
|
||||||
|
|
||||||
menuPage := generateMenu(dirpath)
|
tmpl := template.Must(template.ParseFiles("templates/pageTemplate.html"))
|
||||||
|
tmpl.Execute(w, page)
|
||||||
tmpl := template.Must(template.ParseFiles("templates/menuTemplate.html"))
|
|
||||||
tmpl.Execute(w, menuPage)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func getPage(w http.ResponseWriter, r *http.Request) {
|
func getPage(w http.ResponseWriter, r *http.Request) {
|
||||||
@@ -79,10 +99,12 @@ func getPage(w http.ResponseWriter, r *http.Request) {
|
|||||||
content, err := fileToHTML(path)
|
content, err := fileToHTML(path)
|
||||||
check(err)
|
check(err)
|
||||||
|
|
||||||
var item ItemModel
|
var page PageModel
|
||||||
item.Name = path
|
page.Title = path
|
||||||
item.Content = template.HTML(content)
|
page.Content = template.HTML(content)
|
||||||
|
|
||||||
tmpl := template.Must(template.ParseFiles("templates/pageTemplate.html"))
|
page.MenuContent = generateMenuHTML("")
|
||||||
tmpl.Execute(w, item)
|
|
||||||
|
tmplPage := template.Must(template.ParseFiles("templates/pageTemplate.html"))
|
||||||
|
tmplPage.Execute(w, page)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,91 +1,18 @@
|
|||||||
<!doctype html>
|
<ul class="list-group">
|
||||||
<html lang="en">
|
{{range .Items}} {{if .IsDir}}
|
||||||
|
<br><br>
|
||||||
<head>
|
<nav aria-label="breadcrumb">
|
||||||
<!-- Required meta tags -->
|
<ol class="breadcrumb">
|
||||||
<meta charset="utf-8">
|
<li class="breadcrumb-item active" aria-current="page">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<a href="{{.Path}}">
|
||||||
|
<i class="fas fa-folder"></i> {{.Name}}
|
||||||
<!-- Bootstrap CSS -->
|
</a>
|
||||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
|
</li>
|
||||||
|
</ol>
|
||||||
<style>
|
|
||||||
footer {
|
|
||||||
width:100%;
|
|
||||||
background: #38414f;
|
|
||||||
color: #bec0c4;
|
|
||||||
margin-top: 80px;
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<title>padArchiver</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
|
||||||
<a class="navbar-brand" href="/">padArchiver</a>
|
|
||||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
|
||||||
<span class="navbar-toggler-icon"></span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
|
||||||
<ul class="navbar-nav mr-auto">
|
|
||||||
<li class="nav-item active">
|
|
||||||
<a class="nav-link" href="/">Home <span class="sr-only">(current)</span></a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br><br>
|
{{else}}
|
||||||
|
<a href="{{.Path}}" class="list-group-item">
|
||||||
<div class="container">
|
<i class="fas fa-file-alt"></i> {{.Name}}
|
||||||
<div class="row">
|
</a> {{end}} {{end}}
|
||||||
<div class="col-sm-2"></div>
|
</ul>
|
||||||
<div class="col-sm-8">
|
|
||||||
<h3>{{.PageTitle}}</h3>
|
|
||||||
<ul class="list-group">
|
|
||||||
{{range .Items}}
|
|
||||||
{{if .IsDir}}
|
|
||||||
<br><br>
|
|
||||||
<nav aria-label="breadcrumb">
|
|
||||||
<ol class="breadcrumb">
|
|
||||||
<li class="breadcrumb-item active" aria-current="page">
|
|
||||||
<a href="{{.Path}}">{{.Name}}</a>
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
{{else}}
|
|
||||||
<a href="{{.Path}}" class="list-group-item">{{.Name}}</a>
|
|
||||||
{{end}}
|
|
||||||
{{end}}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
<div class="container">
|
|
||||||
<p class="float-right">
|
|
||||||
<a href="#">Back to top</a>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
padArchiver - webServer
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Github: <a href="https://github.com/arnaucode/padArchiver" target="_blank">https://github.com/arnaucode/padArchiver</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</footer>
|
|
||||||
|
|
||||||
<!-- Optional JavaScript -->
|
|
||||||
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
|
|
||||||
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
|
|
||||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
|
|||||||
@@ -10,6 +10,9 @@
|
|||||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
body {
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
footer {
|
footer {
|
||||||
width:100%;
|
width:100%;
|
||||||
background: #38414f;
|
background: #38414f;
|
||||||
@@ -17,6 +20,15 @@
|
|||||||
margin-top: 80px;
|
margin-top: 80px;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
a:link {
|
||||||
|
color: #008ae6;
|
||||||
|
}
|
||||||
|
a:visited {
|
||||||
|
color: #008ae6;
|
||||||
|
}
|
||||||
|
a:hover {
|
||||||
|
color: #33adff;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<title>padArchiver</title>
|
<title>padArchiver</title>
|
||||||
@@ -24,26 +36,35 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||||
<a class="navbar-brand" href="/">padArchiver</a>
|
<a class="navbar-brand" href="/">
|
||||||
|
<img src="https://seeklogo.com/images/G/go-logo-046185B647-seeklogo.com.png" height="30" class="d-inline-block align-top" alt="">
|
||||||
|
padArchiver
|
||||||
|
</a>
|
||||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||||
<ul class="navbar-nav mr-auto">
|
<!--<ul class="navbar-nav mr-auto">
|
||||||
<li class="nav-item active">
|
<li class="nav-item active">
|
||||||
<a class="nav-link" href="/">Home <span class="sr-only">(current)</span></a>
|
<a class="nav-link" href="/">Home <span class="sr-only">(current)</span></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>-->
|
||||||
</div>
|
</div>
|
||||||
|
<form class="form-inline my-2 my-lg-0">
|
||||||
|
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
|
||||||
|
<button class="btn btn-outline-info my-2 my-sm-0" type="submit">Search</button>
|
||||||
|
</form>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-2"></div>
|
<div class="col-sm-3">
|
||||||
<div class="col-sm-10">
|
{{.MenuContent}}
|
||||||
<h3>{{.Name}}</h3>
|
</div>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<h3>{{.Title}}</h3>
|
||||||
<hr> {{.Content}}
|
<hr> {{.Content}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -69,6 +90,9 @@
|
|||||||
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
|
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
|
||||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
|
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
|
||||||
|
|
||||||
|
<!-- font awesome icons -->
|
||||||
|
<script defer src="https://use.fontawesome.com/releases/v5.0.10/js/all.js" integrity="sha384-slN8GvtUJGnv6ca26v8EzVaR9DC58QEwsIk9q1QXdCU8Yu8ck/tL/5szYlBbqmS+" crossorigin="anonymous"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
7
webServer/templates/wellcome.md
Normal file
7
webServer/templates/wellcome.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
### Wellcome to the padArchiver.
|
||||||
|
Select one pad from the side menu to visualize.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
This is the wellcome message, from the 'templates/wellcome.md' file.
|
||||||
Binary file not shown.
Reference in New Issue
Block a user