diff --git a/2 b/2
new file mode 100644
index 0000000..b068184
--- /dev/null
+++ b/2
@@ -0,0 +1,84 @@
+package page
+
+import "github.com/lorenzhohermuth/portfolio/view/layout"
+import "github.com/lorenzhohermuth/portfolio/view/component"
+
+templ ShowHome(arr []component.CarouselEntry, index int, events []component.Event) {
+ @layout.Base(){
+
+
+
+ About this Website
+
+
+ The Purpose of this website is to try a new Stack with GO and HTMX with the goal of using a Minimal amount of Code.
+ And to refresh my old Portfolio to a newer State.
+
+
+
+
+ @component.Banner("Stack", "", "#6266ec", "#b9f301" )
+
+
+
+
+
+
+
+
+ Language
+
+
+ GO
+
+
+
+ HTMX
+
+
+ Frontend Famework
+
+
+
+ CSS Famework
+
+
+ Uno CSS
+
+
+
+ Templ
+
+
+ HTML Templating
+
+
+
+ HTTP Famework
+
+
+ Echo
+
+
+
+
+
+
+
+
+ @component.Banner("Porjects", "", "#b9f301", "#ff5cdb")
+
+ @component.Carousel(arr, index)
+
+
+
+
+ @component.Banner("Work", "", "#1733d2", "#ff5cdb")
+
+
+ @component.Timeline(events)
+
+
+
+ }
+}
diff --git a/internal/mdparser/projects.go b/internal/mdparser/projects.go
new file mode 100644
index 0000000..69be2a0
--- /dev/null
+++ b/internal/mdparser/projects.go
@@ -0,0 +1,73 @@
+package mdparser
+
+import (
+ "context"
+ "regexp"
+ "strings"
+
+ "github.com/lorenzhohermuth/portfolio/pkg/github"
+ "github.com/lorenzhohermuth/portfolio/view/component"
+)
+
+func GetProjects() []component.CarouselEntry {
+ projectsFile, ghErr := github.FetchGHFile(context.Background(), "/interactive/projects.md")
+ if ghErr != nil {
+ panic(ghErr)
+ }
+ components := make([]component.CarouselEntry, 0)
+
+ lines := strings.Split(projectsFile, "\n")
+ tmpTitle := ""
+ tmpText := ""
+ tmpImg := ""
+ for _, l := range lines {
+ isFilled, elm := parseMdProject(l, &tmpTitle, &tmpText, &tmpImg)
+ if isFilled {
+ components = append(components, elm)
+ }
+ }
+
+ return components
+}
+
+func getChar(text string, pos int) string {
+ text = strings.TrimSpace(text)
+ if text == "" {
+ return ""
+ }
+ return string([]rune(text)[pos])
+}
+
+func parseMdProject(line string, title *string, text *string, img *string) (bool, component.CarouselEntry){
+ char := getChar(line, 0)
+
+ if char == "" {
+ elm := component.CarouselEntry{
+ ImgPath: *img,
+ Title: *title,
+ Text: *text,
+ }
+ *img = ""
+ *title = ""
+ *text = ""
+ return true, elm
+
+ } else if char == "#" {
+ *title = strings.TrimSpace(line[1:])
+
+ } else if char == "!" {
+ rgx := regexp.MustCompile(`\((.*?)\)`)
+ mdImage := rgx.FindStringSubmatch(line)[1]
+ mdImage = strings.TrimSpace(mdImage)
+
+ if mdImage[:4] != "http" {
+ mdImage = strings.Replace(mdImage, "assets", "static", 1)
+ }
+
+ *img = mdImage
+
+ } else {
+ *text += line
+ }
+ return false, component.CarouselEntry{}
+}
diff --git a/internal/mdparser/work.go b/internal/mdparser/work.go
new file mode 100644
index 0000000..20e2b2e
--- /dev/null
+++ b/internal/mdparser/work.go
@@ -0,0 +1,49 @@
+package mdparser
+
+import (
+ "context"
+ "strings"
+
+ "github.com/lorenzhohermuth/portfolio/pkg/github"
+ "github.com/lorenzhohermuth/portfolio/view/component"
+)
+
+func GetWork() []component.Event {
+ projectsFile, ghErr := github.FetchGHFile(context.Background(), "/interactive/work.md")
+ if ghErr != nil {
+ panic(ghErr)
+ }
+ components := make([]component.Event, 0)
+
+ lines := strings.Split(projectsFile, "\n")
+ tmpTitle := ""
+ tmpPeriod := ""
+ for _, l := range lines {
+ isFilled, elm := parseMdWork(l, &tmpTitle, &tmpPeriod)
+ if isFilled {
+ components = append(components, elm)
+ }
+ }
+
+ return components
+}
+
+func parseMdWork(line string, title *string, periode *string) (bool, component.Event){
+ char := getChar(line, 0)
+
+ if char == "" {
+ elm := component.Event{
+ TimePeriode: *periode,
+ Title: *title,
+ }
+ *title = ""
+ *periode = ""
+ return true, elm
+
+ } else if char == "#" {
+ *title = strings.TrimSpace(line[1:])
+ } else {
+ *periode = line
+ }
+ return false, component.Event{}
+}
diff --git a/view/component/carousel.templ b/view/component/carousel.templ
index 9e9a824..081888f 100644
--- a/view/component/carousel.templ
+++ b/view/component/carousel.templ
@@ -17,7 +17,7 @@ func getEntry(arr []CarouselEntry, index int) CarouselEntry {
templ Carousel(elm []CarouselEntry , index int) {
-
+
-
+
-
-
+
+
{getEntry(elm, index).Title}
@@ -41,7 +41,7 @@ templ Carousel(elm []CarouselEntry , index int) {
hx-trigger="click"
hx-target="#carousel-parent"
>
-
+
diff --git a/view/component/carousel_templ.go b/view/component/carousel_templ.go
index b03195c..291d76d 100644
--- a/view/component/carousel_templ.go
+++ b/view/component/carousel_templ.go
@@ -38,7 +38,7 @@ func Carousel(elm []CarouselEntry, index int) templ.Component {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
")
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"h-32 w-64 md:h-48 md:w-96 xl:h-82 xl:w-164 rounded object-cover bg-neutral-800\">
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -90,7 +90,7 @@ func Carousel(elm []CarouselEntry, index int) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"h-28 w-52 rounded object-cover bg-neutral-800\">
")
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"h-28 w-56 md:h-40 md:w-80 xl:h-64 xl:w-156 rounded object-cover bg-neutral-800\">
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/view/layout/base.templ b/view/layout/base.templ
index 8d29ee1..4bd70ce 100644
--- a/view/layout/base.templ
+++ b/view/layout/base.templ
@@ -22,7 +22,7 @@ templ Base() {
-
+
Home
Projects
diff --git a/view/layout/base_templ.go b/view/layout/base_templ.go
index c8f375b..7d69680 100644
--- a/view/layout/base_templ.go
+++ b/view/layout/base_templ.go
@@ -23,7 +23,7 @@ func Base() templ.Component {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Portfolio Lorenz Hohermuth ")
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Portfolio Lorenz Hohermuth ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/view/page/home.templ b/view/page/home.templ
index 124aee1..ca08860 100644
--- a/view/page/home.templ
+++ b/view/page/home.templ
@@ -5,66 +5,80 @@ import "github.com/lorenzhohermuth/portfolio/view/component"
templ ShowHome(arr []component.CarouselEntry, index int, events []component.Event) {
@layout.Base(){
-
-
-
- About this Website
-
-
- The Purpose of this website is to try a new Stack with GO and HTMX with the goal of using a Minimal amount of Code.
- And to refresh my old Portfolio to a newer State.
-
+
+
+
+
+ About this Website
+
+
+ The Purpose of this website is to try a new Stack with GO and HTMX with the goal of using a Minimal amount of Code.
+ And to refresh my old Portfolio to a newer State.
+
+
+ Normally, my Portfolio is seriously out of date.
+ So I have written this one with the GitHub API and a small parser, which parser the Markdown Files in my Repo into the Timeline and the Carousel.
+ They are the files in the Interactive folder.
+
+
Repo
+
+ Yes, I could have written a GitHub workflow to Automatically make restart the site,
+ but I wanted to learn more about the go Context. (Plus Pipelines are a Pain in the Ass).
+
+
-
+
@component.Banner("Stack", "", "#6266ec", "#b9f301" )
-
-
-
-
-
- Language
-
-
- GO
-
-
-
- HTMX
-
-
- Frontend Famework
-
+
+
-
- CSS Famework
-
-
- Uno CSS
-
+
-
- Templ
-
-
- HTML Templating
-
+
+ Language
+
+
+ GO
+
-
- HTTP Famework
+
+ HTMX
+
+
+ Frontend Famework
+
+
+
+ CSS Famework
+
+
+ Uno CSS
+
+
+
+ Templ
+
+
+ HTML Templating
+
+
+
+ HTTP Famework
+
+
+ Echo
+
+
-
- Echo
-
-
- @component.Banner("Porjects", "", "#b9f301", "#ff5cdb")
+ @component.Banner("Projects", "", "#b9f301", "#ff5cdb")
@component.Carousel(arr, index)
@@ -73,7 +87,7 @@ templ ShowHome(arr []component.CarouselEntry, index int, events []component.Even
@component.Banner("Work", "", "#1733d2", "#ff5cdb")
-
+
@component.Timeline(events)
diff --git a/view/page/home_templ.go b/view/page/home_templ.go
index e1ae951..df2f728 100644
--- a/view/page/home_templ.go
+++ b/view/page/home_templ.go
@@ -32,7 +32,7 @@ func ShowHome(arr []component.CarouselEntry, index int, events []component.Event
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
About this Website
The Purpose of this website is to try a new Stack with GO and HTMX with the goal of using a Minimal amount of Code. And to refresh my old Portfolio to a newer State.
")
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
About this Website The Purpose of this website is to try a new Stack with GO and HTMX with the goal of using a Minimal amount of Code. And to refresh my old Portfolio to a newer State.
Normally, my Portfolio is seriously out of date. So I have written this one with the GitHub API and a small parser, which parser the Markdown Files in my Repo into the Timeline and the Carousel. They are the files in the Interactive folder.
Repo Yes, I could have written a GitHub workflow to Automatically make restart the site, but I wanted to learn more about the go Context. (Plus Pipelines are a Pain in the Ass).
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -40,11 +40,11 @@ func ShowHome(arr []component.CarouselEntry, index int, events []component.Event
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Language
GO
HTMX
Frontend Famework
CSS Famework
Uno CSS
Templ
HTML Templating
HTTP Famework
Echo
")
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" Language
GO
HTMX
Frontend Famework
CSS Famework
Uno CSS
Templ
HTML Templating
HTTP Famework
Echo
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = component.Banner("Porjects", "", "#b9f301", "#ff5cdb").Render(ctx, templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = component.Banner("Projects", "", "#b9f301", "#ff5cdb").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -64,7 +64,7 @@ func ShowHome(arr []component.CarouselEntry, index int, events []component.Event
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("")
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}