Compare commits

...
4 Commits
7 changed files with 67 additions and 70 deletions
+18
View File
@@ -0,0 +1,18 @@
MIT License
Copyright (c) 2026 Lennard Emanuel Haufe
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
+9
View File
@@ -0,0 +1,9 @@
# haufe_website
This is the name of my website project. The name of the domain is diffrent but this is how I referr to it internally.
03.September.2026
We are currently on Version 1.0.0. Every change to articles will counted as the last number of the three. This means that when one new article is published, the last number will get added a 1.
Kind regards Lennard
BIN
View File
Binary file not shown.
+37 -67
View File
@@ -10,7 +10,8 @@ import (
var data_articles_index string = ""
var top string = "<!doctype html><html lang='en'><head><meta charset='UTF-8' /><meta name='viewport' content='width=device-width, initial-scale=1.0' /><title>Haufenet</title><link rel='stylesheet' href='/index.css' /><link rel='icon' type='image/png' href='/favicon-96x96.png' sizes='96x96'/><link rel='icon' type='image/svg+xml' href='/favicon.svg'/><link rel='shortcut icon' href='/favicon.ico' /><link rel='apple-touch-icon' sizes='180x180' href='/apple-touch-icon.png' /><link rel='manifest' href='/site.webmanifest' /><link rel='preconnect' href='https://fonts.googleapis.com'><link rel='preconnect' href='https://fonts.gstatic.com' crossorigin><link href='https://fonts.googleapis.com/css2?family=BBH+Bogle&display=swap' rel='stylesheet'></head><body><header><a href='/' ><b>Haufenet</b></a></header>"
var bottom string = "<footer><p>&copy Lennard Haufe<p><p>No usage of AI</p><a href='/imprint_privacy/'>Imprint and Privacy</a></footer></body><script src='/index.js'></script></html>"
var bottom string = "<footer><p>&copy Lennard Haufe<p><p>Running on net/http GO</p><p>No usage of AI</p><a href='/imprint_privacy/'>Imprint and Privacy</a></footer></body><script src='/index.js'></script></html>"
var tag_collection string = ""
func main() {
entries, err := os.ReadDir("./articles")
@@ -18,14 +19,14 @@ func main() {
log.Fatal(err)
}
for _, e := range entries {
ReadFileArticles(e.Name())
SetupDataIndexArticles(e.Name())
AnalayzeFiles(e.Name())
}
log.Println(tag_collection)
log.Print("Server running on port 8090")
EditArticlesPage()
ReadFileOthers("imprint_privacy.md")
fileserver := http.FileServer(http.Dir("./website"))
http.Handle("/", fileserver)
if err := http.ListenAndServe(":8090", nil); err != nil {
@@ -40,103 +41,72 @@ func EditArticlesPage() {
panic(err)
}
}
func SetupDataIndexArticles(filename string) {
func AnalayzeFiles(filename string) {
file, err := os.Open("./articles/" + filename)
if err != nil {
log.Fatalf("not opening")
}
defer file.Close()
scanner := bufio.NewScanner(file)
var title string = ""
var description string = ""
var tags string = ""
var image string = ""
for scanner.Scan() {
content := scanner.Text()
if strings.Contains(content, "###") {
continue
} else if strings.Contains(content, "##") {
continue
} else if strings.Contains(content, "#") {
part := strings.Split(content, `#`)
title = "<h1>" + part[1] + "</h1>"
} else if strings.Contains(content, "DESCRIPTION:") {
part := strings.Split(content, `DESCRIPTION:`)
description = "<p>" + part[1] + "</p>"
} else if strings.Contains(content, "HEADIMAGE:") {
part := strings.Split(content, `HEADIMAGE:`)
image = "<img src='/pictures/" + part[1] + "'>"
} else if strings.Contains(content, "TAGS:") {
part := strings.Split(content, `TAGS:`)
part_2 := strings.Split(part[1], ",")
part_tags := "<articles-tags>"
for i := 0; i < len(part_2); i++ {
part_tags += "<a href='/tags/" + part_2[i] + "'>" + part_2[i] + "</a>"
}
part_tags += "</articles-tags>"
tags = part_tags
} else {
continue
}
}
filename_new := strings.Split(filename, ".md")
data_articles_index += "<article-display><a href='/articles/" + filename_new[0] + ".html'>" + title + image + description + "</a>" + tags + "</article-display>"
}
func ReadFileArticles(filename string) {
file, err := os.Open("./articles/" + filename)
if err != nil {
log.Fatalf("not opening")
}
defer file.Close()
scanner := bufio.NewScanner(file)
var new_text string = ""
var tags string = ""
var end_text_page_article string = ""
var tags_page_article string = ""
var title_overview_articles string = ""
var description_overview_articles string = ""
var image_overview_articles string = ""
for scanner.Scan() {
content := scanner.Text()
var end_type string = ""
if strings.Contains(content, "###") {
part := strings.Split(content, `###`)
end_type = "<h3>" + part[1] + "</h3>"
end_text_page_article += "<h3>" + part[1] + "</h3>"
} else if strings.Contains(content, "##") {
part := strings.Split(content, `##`)
end_type = "<h2>" + part[1] + "</h2>"
end_text_page_article += "<h2>" + part[1] + "</h2>"
} else if strings.Contains(content, "#") {
part := strings.Split(content, `#`)
end_type = "<h1>" + part[1] + "</h1>"
end_text_page_article += "<h1>" + part[1] + "</h1>"
title_overview_articles = "<h1>" + part[1] + "</h1>"
} else if strings.Contains(content, "HEADIMAGE:") {
part := strings.Split(content, `HEADIMAGE:`)
end_type = "<img src='/pictures/" + part[1] + "'>"
end_text_page_article += "<img src='/pictures/" + part[1] + "'>"
image_overview_articles = "<img src='/pictures/" + part[1] + "'>"
} else if strings.Contains(content, "DESCRIPTION:") {
part := strings.Split(content, `DESCRIPTION:`)
description_overview_articles = "<p>" + part[1] + "</p>"
} else if strings.Contains(content, "[img]:") {
part := strings.Split(content, `[img]:`)
end_type = "<img src='/pictures/" + part[1] + "'>"
end_text_page_article += "<img src='/pictures/" + part[1] + "'>"
} else if strings.Contains(content, "DESCRIPTION:") {
end_type = ""
end_text_page_article = ""
} else if strings.Contains(content, "TAGS:") {
part := strings.Split(content, `TAGS:`)
part_2 := strings.Split(part[1], ",")
part_tags := "<articles-tags>"
for i := 0; i < len(part_2); i++ {
part_tags += "<a href='/tags/" + part_2[i] + "'>" + part_2[i] + "</a>"
tag_collection += "#" + part_2[i] + ":" + filename_new[0] + ":" + title_overview_articles + ":" + description_overview_articles + ":" + image_overview_articles
}
part_tags += "</articles-tags>"
tags = part_tags
tags_page_article = part_tags
} else if content == "" {
end_type = "<br>"
end_text_page_article += "<br>"
} else {
end_type = "<p>" + content + "</p>"
end_text_page_article += "<p>" + content + "</p>"
}
new_text += end_type
}
filename_new := strings.Split(filename, ".md")
err = os.WriteFile("./website/articles/"+filename_new[0]+".html", []byte(top+"<articles-detail><articles-detail-down>"+new_text+"<h4>Tags</h4>"+tags+"<br></articles-detail-down></articles-detail>"+bottom), 0755)
Page_Article(filename_new[0], end_text_page_article, tags_page_article)
Page_Collection_Overview_Articles(filename_new[0], title_overview_articles, image_overview_articles, description_overview_articles, tags_page_article)
}
func Page_Collection_Overview_Articles(filename string, title string, image string, description string, tags string) {
data_articles_index += "<article-display><a href='/articles/" + filename + ".html'>" + title + image + description + "</a>" + tags + "</article-display>"
}
func Page_Article(filename string, text string, tags string) {
err := os.WriteFile("./website/articles/"+filename+".html", []byte(top+"<articles-detail><articles-detail-down>"+text+"<h4>Tags</h4>"+tags+"<br></articles-detail-down></articles-detail>"+bottom), 0755)
if err != nil {
panic(err)
}
+1 -1
View File
@@ -1 +1 @@
<!doctype html><html lang='en'><head><meta charset='UTF-8' /><meta name='viewport' content='width=device-width, initial-scale=1.0' /><title>Haufenet</title><link rel='stylesheet' href='/index.css' /><link rel='icon' type='image/png' href='/favicon-96x96.png' sizes='96x96'/><link rel='icon' type='image/svg+xml' href='/favicon.svg'/><link rel='shortcut icon' href='/favicon.ico' /><link rel='apple-touch-icon' sizes='180x180' href='/apple-touch-icon.png' /><link rel='manifest' href='/site.webmanifest' /><link rel='preconnect' href='https://fonts.googleapis.com'><link rel='preconnect' href='https://fonts.gstatic.com' crossorigin><link href='https://fonts.googleapis.com/css2?family=BBH+Bogle&display=swap' rel='stylesheet'></head><body><header><a href='/' ><b>Haufenet</b></a></header><list-articles><h1 id='top-article-list'>Articles</h1><div><article-display><a href='/articles/this_website.html'><h1> This Website</h1><img src='/pictures/another.png'><p>This Website had a lot of diffrent version, featuring diffrent styles...</p></a><articles-tags><a href='/tags/projects'>projects</a><a href='/tags/css'>css</a><a href='/tags/html'>html</a><a href='/tags/coding'>coding</a></articles-tags></article-display></div></list-articles><footer><p>&copy Lennard Haufe<p><p>No usage of AI</p><a href='/imprint_privacy/'>Imprint and Privacy</a></footer></body><script src='/index.js'></script></html>
<!doctype html><html lang='en'><head><meta charset='UTF-8' /><meta name='viewport' content='width=device-width, initial-scale=1.0' /><title>Haufenet</title><link rel='stylesheet' href='/index.css' /><link rel='icon' type='image/png' href='/favicon-96x96.png' sizes='96x96'/><link rel='icon' type='image/svg+xml' href='/favicon.svg'/><link rel='shortcut icon' href='/favicon.ico' /><link rel='apple-touch-icon' sizes='180x180' href='/apple-touch-icon.png' /><link rel='manifest' href='/site.webmanifest' /><link rel='preconnect' href='https://fonts.googleapis.com'><link rel='preconnect' href='https://fonts.gstatic.com' crossorigin><link href='https://fonts.googleapis.com/css2?family=BBH+Bogle&display=swap' rel='stylesheet'></head><body><header><a href='/' ><b>Haufenet</b></a></header><list-articles><h1 id='top-article-list'>Articles</h1><div><article-display><a href='/articles/this_website.html'><h1> This Website</h1><img src='/pictures/another.png'><p>This Website had a lot of diffrent version, featuring diffrent styles...</p></a><articles-tags><a href='/tags/projects'>projects</a><a href='/tags/css'>css</a><a href='/tags/html'>html</a><a href='/tags/coding'>coding</a></articles-tags></article-display></div></list-articles><footer><p>&copy Lennard Haufe<p><p>Running on net/http GO</p><p>No usage of AI</p><a href='/imprint_privacy/'>Imprint and Privacy</a></footer></body><script src='/index.js'></script></html>
+1 -1
View File
@@ -1 +1 @@
<!doctype html><html lang='en'><head><meta charset='UTF-8' /><meta name='viewport' content='width=device-width, initial-scale=1.0' /><title>Haufenet</title><link rel='stylesheet' href='/index.css' /><link rel='icon' type='image/png' href='/favicon-96x96.png' sizes='96x96'/><link rel='icon' type='image/svg+xml' href='/favicon.svg'/><link rel='shortcut icon' href='/favicon.ico' /><link rel='apple-touch-icon' sizes='180x180' href='/apple-touch-icon.png' /><link rel='manifest' href='/site.webmanifest' /><link rel='preconnect' href='https://fonts.googleapis.com'><link rel='preconnect' href='https://fonts.gstatic.com' crossorigin><link href='https://fonts.googleapis.com/css2?family=BBH+Bogle&display=swap' rel='stylesheet'></head><body><header><a href='/' ><b>Haufenet</b></a></header><articles-detail><articles-detail-down><h1> This Website</h1><img src='/pictures/another.png'><p>This Website had a lot of diffrent version, featuring diffrent styles. Everytime I recreate it, I say "this will be the version I will continue on", but then I make a change to it or am unhappy with it. So I create a new Version, mostly from scratch. If I would be honest I could call this version of the Website v20 at least, but I will call it v1.</p><h2> The "Technology" behind it</h2><p>I use golang to run the http server and to compile my md files to a static website. I use md over html, becaus first one always needs to add "<>" and at the end "</>" of every text element, this makes it a long and fustrating process to write it. Additionaly one needs to add the head, the header and the footer to every file seperatly.This makes changing a style outside the universal css file more complicated. This means that one thinks of a new header structure, every header in every file needs to be changed. Which can be done of course with a IDE and its "occurences-tool", but this process does not ensure correct result. Leading to error this makes the progess even longer, then with the compalation method.</p><h2> Usage of the Website</h2><p>This website is being populated with diffent informations such as projects, documentations and comments on diffrent technical standpoints. I will use it to improve my english level. So if you are an born english speaker, please be so kind and report any erros to me.</p><h4>Tags</h4><articles-tags><a href='/tags/projects'>projects</a><a href='/tags/css'>css</a><a href='/tags/html'>html</a><a href='/tags/coding'>coding</a></articles-tags><br></articles-detail-down></articles-detail><footer><p>&copy Lennard Haufe<p><p>No usage of AI</p><a href='/imprint_privacy/'>Imprint and Privacy</a></footer></body><script src='/index.js'></script></html>
<!doctype html><html lang='en'><head><meta charset='UTF-8' /><meta name='viewport' content='width=device-width, initial-scale=1.0' /><title>Haufenet</title><link rel='stylesheet' href='/index.css' /><link rel='icon' type='image/png' href='/favicon-96x96.png' sizes='96x96'/><link rel='icon' type='image/svg+xml' href='/favicon.svg'/><link rel='shortcut icon' href='/favicon.ico' /><link rel='apple-touch-icon' sizes='180x180' href='/apple-touch-icon.png' /><link rel='manifest' href='/site.webmanifest' /><link rel='preconnect' href='https://fonts.googleapis.com'><link rel='preconnect' href='https://fonts.gstatic.com' crossorigin><link href='https://fonts.googleapis.com/css2?family=BBH+Bogle&display=swap' rel='stylesheet'></head><body><header><a href='/' ><b>Haufenet</b></a></header><articles-detail><articles-detail-down><h1> This Website</h1><img src='/pictures/another.png'><p>This Website had a lot of diffrent version, featuring diffrent styles. Everytime I recreate it, I say "this will be the version I will continue on", but then I make a change to it or am unhappy with it. So I create a new Version, mostly from scratch. If I would be honest I could call this version of the Website v20 at least, but I will call it v1.</p><h2> The "Technology" behind it</h2><p>I use golang to run the http server and to compile my md files to a static website. I use md over html, becaus first one always needs to add "<>" and at the end "</>" of every text element, this makes it a long and fustrating process to write it. Additionaly one needs to add the head, the header and the footer to every file seperatly.This makes changing a style outside the universal css file more complicated. This means that one thinks of a new header structure, every header in every file needs to be changed. Which can be done of course with a IDE and its "occurences-tool", but this process does not ensure correct result. Leading to error this makes the progess even longer, then with the compalation method.</p><h2> Usage of the Website</h2><p>This website is being populated with diffent informations such as projects, documentations and comments on diffrent technical standpoints. I will use it to improve my english level. So if you are an born english speaker, please be so kind and report any erros to me.</p><h4>Tags</h4><articles-tags><a href='/tags/projects'>projects</a><a href='/tags/css'>css</a><a href='/tags/html'>html</a><a href='/tags/coding'>coding</a></articles-tags><br></articles-detail-down></articles-detail><footer><p>&copy Lennard Haufe<p><p>Running on net/http GO</p><p>No usage of AI</p><a href='/imprint_privacy/'>Imprint and Privacy</a></footer></body><script src='/index.js'></script></html>
+1 -1
View File
@@ -1 +1 @@
<!doctype html><html lang='en'><head><meta charset='UTF-8' /><meta name='viewport' content='width=device-width, initial-scale=1.0' /><title>Haufenet</title><link rel='stylesheet' href='/index.css' /><link rel='icon' type='image/png' href='/favicon-96x96.png' sizes='96x96'/><link rel='icon' type='image/svg+xml' href='/favicon.svg'/><link rel='shortcut icon' href='/favicon.ico' /><link rel='apple-touch-icon' sizes='180x180' href='/apple-touch-icon.png' /><link rel='manifest' href='/site.webmanifest' /><link rel='preconnect' href='https://fonts.googleapis.com'><link rel='preconnect' href='https://fonts.gstatic.com' crossorigin><link href='https://fonts.googleapis.com/css2?family=BBH+Bogle&display=swap' rel='stylesheet'></head><body><header><a href='/' ><b>Haufenet</b></a></header><articles-detail><div><h1> Impressum</h1><p>Lennard Haufe</p><p>Obere Ziegeli 11</p><p>71522 Backnang</p><h1> Kontakt</h1><p>Telefon: 004917650320223</p><p>E-Mail: info.lennard.haufe@haufenet.com</p><h1> Inhaltlich verantwortlich i.S.v. § 18 Abs. 2 MStV</h1><p>Lennard Haufe</p><p>Obere Ziegelei 11</p><p>71522 Backnang</p><h1> Dieses Impressum gilt auch für folgende Social-Media-Profile</h1><p>Instagram: https://www.instagram.com/haufe_net_com/</p><h1> Quellenangaben für verwendete Bilder und Grafiken</h1><p>D. Stroh byd-film.de</p></div></articles-detail><footer><p>&copy Lennard Haufe<p><p>No usage of AI</p><a href='/imprint_privacy/'>Imprint and Privacy</a></footer></body><script src='/index.js'></script></html>
<!doctype html><html lang='en'><head><meta charset='UTF-8' /><meta name='viewport' content='width=device-width, initial-scale=1.0' /><title>Haufenet</title><link rel='stylesheet' href='/index.css' /><link rel='icon' type='image/png' href='/favicon-96x96.png' sizes='96x96'/><link rel='icon' type='image/svg+xml' href='/favicon.svg'/><link rel='shortcut icon' href='/favicon.ico' /><link rel='apple-touch-icon' sizes='180x180' href='/apple-touch-icon.png' /><link rel='manifest' href='/site.webmanifest' /><link rel='preconnect' href='https://fonts.googleapis.com'><link rel='preconnect' href='https://fonts.gstatic.com' crossorigin><link href='https://fonts.googleapis.com/css2?family=BBH+Bogle&display=swap' rel='stylesheet'></head><body><header><a href='/' ><b>Haufenet</b></a></header><articles-detail><div><h1> Impressum</h1><p>Lennard Haufe</p><p>Obere Ziegeli 11</p><p>71522 Backnang</p><h1> Kontakt</h1><p>Telefon: 004917650320223</p><p>E-Mail: info.lennard.haufe@haufenet.com</p><h1> Inhaltlich verantwortlich i.S.v. § 18 Abs. 2 MStV</h1><p>Lennard Haufe</p><p>Obere Ziegelei 11</p><p>71522 Backnang</p><h1> Dieses Impressum gilt auch für folgende Social-Media-Profile</h1><p>Instagram: https://www.instagram.com/haufe_net_com/</p><h1> Quellenangaben für verwendete Bilder und Grafiken</h1><p>D. Stroh byd-film.de</p></div></articles-detail><footer><p>&copy Lennard Haufe<p><p>Running on net/http GO</p><p>No usage of AI</p><a href='/imprint_privacy/'>Imprint and Privacy</a></footer></body><script src='/index.js'></script></html>