Skip to content

Commit 7fad2c5

Browse files
committed
[Add] post to twitter github release
1 parent df5da4d commit 7fad2c5

16 files changed

+138
-22
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#
44
/.idea
55
/vendor
6+
/node_modules
7+
/package-lock.json
68
# Binaries for programs and plugins
79
*.exe
810
*.exe~

Makefile

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
.PHONY: install tests
1+
.PHONY: install tests build-js
2+
3+
build-js:
4+
npm install && npm run build
25

36
install:
47
go mod tidy && go mod vendor
8+
npm install && npm run build
59

610
tests:
711
go test -covermode=set ./... -coverprofile=coverage.txt

go.sum

-8
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
1212
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1313
github.com/gabriel-vasile/mimetype v1.4.7 h1:SKFKl7kD0RiPdbht0s7hFtjl489WcQ1VyPW8ZzUMYCA=
1414
github.com/gabriel-vasile/mimetype v1.4.7/go.mod h1:GDlAgAyIRT27BhFl53XNAFtfjzOkLaF35JdEG0P7LtU=
15-
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
16-
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
1715
github.com/gin-contrib/sse v1.0.0 h1:y3bT1mUWUxDpW4JLQg/HnTqV4rozuW4tC9eFKTxYI9E=
1816
github.com/gin-contrib/sse v1.0.0/go.mod h1:zNuFdwarAygJBht0NTKiSi3jRf6RbqeILZ9Sp6Slhe0=
1917
github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU=
@@ -31,16 +29,12 @@ github.com/goccy/go-json v0.10.4/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PU
3129
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
3230
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
3331
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
34-
github.com/gouef/diago v1.1.0 h1:JExNf1efSOXMt8Q1IWjJIaC4WuRHffiGNYlmq40SThc=
35-
github.com/gouef/diago v1.1.0/go.mod h1:8NIC1I42HhlH/fMM1Jnm3i9oI+o8iOsis7O+Fk81TMo=
3632
github.com/gouef/diago v1.2.0 h1:hqTc2EKHOWM/OpIB0jQg57A+5lBRO22gkcVMilIWLss=
3733
github.com/gouef/diago v1.2.0/go.mod h1:0owQJTVjYQQK1cFbVOuth5egTVKkMAkdFirucr2g2h8=
3834
github.com/gouef/mode v1.0.3 h1:rdTXV2qF/YO3YzTWDrqy4connt+mXFaTMvKkcw+df4c=
3935
github.com/gouef/mode v1.0.3/go.mod h1:F6jloQRk8+CL9OxC4Nf5tgHiKvDXSCsONtt7RX4arss=
4036
github.com/gouef/renderer v0.4.1 h1:+k6486ELUBLGLsKE64qIY+7KPz1SDioDyLLyn4k/4mw=
4137
github.com/gouef/renderer v0.4.1/go.mod h1:FEW+OpeTQWUjkjEwYekW4dcwNDCb5fj6N8r9bFdZGkQ=
42-
github.com/gouef/router v1.1.0 h1:LQ5PLPY4BdM+2qinAwP15q3lcUw8yO8jPE35iwrGCzg=
43-
github.com/gouef/router v1.1.0/go.mod h1:ymO6Yo+jJkWxoesdsGa0uZJRx//6ceJOnFCXBt+3Sfs=
4438
github.com/gouef/router v1.2.0 h1:Pa9BG2sCz9OiNWdtOguoyyxUYLPQOWccLAwMJhRGi/U=
4539
github.com/gouef/router v1.2.0/go.mod h1:ZAfiTldFH+K++fBo2JdRtGHeCYufsknIXxgtobhKaiE=
4640
github.com/gouef/utils v1.9.0 h1:yQBkkbZeJGMRfL3j89cJGTlFHoeY53znJN2iw3jMl0Y=
@@ -99,8 +93,6 @@ golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
9993
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
10094
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
10195
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
102-
google.golang.org/protobuf v1.36.0 h1:mjIs9gYtt56AzC4ZaffQuh88TZurBGhIJMBZGSxNerQ=
103-
google.golang.org/protobuf v1.36.0/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
10496
google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
10597
google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
10698
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

main.go

+1
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,6 @@ func boot() *router.Router {
4646

4747
func main() {
4848
r := boot()
49+
4950
r.Run(":8080")
5051
}

package.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "web-project",
3+
"version": "1.0.0",
4+
"description": "web-project",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1",
8+
"build": "vite build"
9+
},
10+
"keywords": [],
11+
"author": "",
12+
"license": "ISC",
13+
"devDependencies": {
14+
"sass": "^1.83.1",
15+
"vite": "^6.0.7"
16+
},
17+
"dependencies": {
18+
"@popperjs/core": "^2.11.8",
19+
"bootstrap": "^5.3.3"
20+
}
21+
}

static/index.js renamed to src/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Import vlastní SCSS (Bude zkompilováno na CSS)
2+
import './styles.scss'
3+
4+
// Můžeš přidat JavaScript části Bootstrapu, pokud je potřebuješ
5+
import 'bootstrap'
6+
7+
import * as bootstrap from 'bootstrap'
8+
19
function loadSnippet(snippetName) {
210
fetch(`/snippet/${snippetName}`) // AJAX požadavek na server pro snippet
311
.then(response => response.json()) // Očekáváme JSON odpověď

src/styles.scss

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Import all of Bootstrap's CSS
2+
@import "../node_modules/bootstrap/scss/bootstrap";
File renamed without changes.

static/assets/images/gouef_logo.png

598 KB
Loading

static/css/style.css

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/js/main.js

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+10-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
{{define "content"}}
2-
<h1>Welcome</h1>
3-
<p>Gouef works</p>
4-
{{snippet "addAfterClick"}}
5-
<p>Gouef works nice</p>
6-
{{snippetEnd}}
2+
<div class="container">
3+
<h1>Welcome</h1>
4+
<p>Gouef works</p>
5+
{{snippet "addAfterClick"}}
6+
<p>Gouef works nice</p>
7+
{{snippetEnd}}
78

8-
<h2>Counter</h2>
9-
<div>
10-
{{template "counter" .}}
9+
<h2>Counter</h2>
10+
<div>
11+
{{template "counter" .}}
12+
</div>
1113
</div>
1214
{{end}}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{define "counter"}}
22
{{snippet "counter"}}0{{endSnippet}}
33

4-
<button class="ajax" type="button" >Increase</button>
4+
<button class="btn btn-primary" type="button" >Increase</button>
55
<a href="{{link "home"}}">Home</a>
66
<a href="{{link "ping"}}">Ping</a>
77
{{end}}

views/templates/default/layout.gohtml

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en" data-bs-theme="dark">
33
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
46
<title>{{.Title}}</title>
5-
<script type="application/javascript" src="/static/index.js"></script>
6-
<link rel="stylesheet" href="/static/style.css">
7+
<script type="application/javascript" src="/static/js/main.js"></script>
8+
<link rel="stylesheet" href="/static/css/style.css">
79
</head>
810
<body>
9-
{{template "content" .}}
11+
{{template "navigation" . }}
12+
<div class="container-fluid my-2">
13+
{{template "content" .}}
14+
</div>
1015
</body>
1116
</html>
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{{define "navigation"}}
2+
<nav class="navbar navbar-expand-lg bg-body-tertiary">
3+
<div class="container-fluid">
4+
<a class="navbar-brand" href="/">
5+
<img src="/static/assets/images/gouef_logo.png" alt="Gouef" width="40" height="40">
6+
</a>
7+
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
8+
<span class="navbar-toggler-icon"></span>
9+
</button>
10+
<div class="collapse navbar-collapse" id="navbarSupportedContent">
11+
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
12+
<li class="nav-item">
13+
<a class="nav-link active" aria-current="page" href="#">Home</a>
14+
</li>
15+
<li class="nav-item">
16+
<a class="nav-link" href="#">Link</a>
17+
</li>
18+
<li class="nav-item dropdown">
19+
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
20+
Dropdown
21+
</a>
22+
<ul class="dropdown-menu">
23+
<li><a class="dropdown-item" href="#">Action</a></li>
24+
<li><a class="dropdown-item" href="#">Another action</a></li>
25+
<li><hr class="dropdown-divider"></li>
26+
<li><a class="dropdown-item" href="#">Something else here</a></li>
27+
</ul>
28+
</li>
29+
<li class="nav-item">
30+
<a class="nav-link disabled" aria-disabled="true">Disabled</a>
31+
</li>
32+
</ul>
33+
<form class="d-flex" role="search">
34+
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
35+
<button class="btn btn-secondary" type="submit">Search</button>
36+
</form>
37+
</div>
38+
</div>
39+
</nav>
40+
{{end}}

vite.config.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { defineConfig } from 'vite'
2+
3+
export default defineConfig({
4+
build: {
5+
//assetsDir: 'assets',
6+
rollupOptions: {
7+
input: {
8+
main: 'src/index.js',
9+
style: 'src/styles.scss'
10+
},
11+
output: {
12+
entryFileNames: 'js/main.js',
13+
chunkFileNames: 'js/chunks.js',
14+
assetFileNames: ({ name: names }) => {
15+
if (names.endsWith('.css')) {
16+
return 'css/[name].css';
17+
} else if (names.startsWith('images/')) {
18+
return 'assets/images/[name]'; // Obrázky z `src/images/` do `assets/images/`
19+
} else if (/\.(jpe?g|png|gif|svg|webp|ttf|woff|woff2|eot|otf|mp4|webm)$/.test(names)) {
20+
return 'assets/[name]';
21+
}
22+
return 'assets/[name]';
23+
}
24+
}
25+
},
26+
outDir: 'static',
27+
emptyOutDir: false
28+
},
29+
})

0 commit comments

Comments
 (0)