diff --git a/haufenet.de b/haufenet.de index 4438613..b956733 100755 Binary files a/haufenet.de and b/haufenet.de differ diff --git a/main.go b/main.go index 31a4f93..7c245dc 100644 --- a/main.go +++ b/main.go @@ -10,7 +10,8 @@ import ( var data_articles_index string = "" var top string = "Haufenet
Haufenet
" -var bottom string = "" +var bottom string = "" +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 = "

" + part[1] + "

" - } else if strings.Contains(content, "DESCRIPTION:") { - part := strings.Split(content, `DESCRIPTION:`) - description = "

" + part[1] + "

" - } else if strings.Contains(content, "HEADIMAGE:") { - part := strings.Split(content, `HEADIMAGE:`) - image = "" - } else if strings.Contains(content, "TAGS:") { - part := strings.Split(content, `TAGS:`) - part_2 := strings.Split(part[1], ",") - part_tags := "" - for i := 0; i < len(part_2); i++ { - part_tags += "" + part_2[i] + "" - } - part_tags += "" - tags = part_tags - } else { - continue - } - } - filename_new := strings.Split(filename, ".md") - data_articles_index += "" + title + image + description + "" + tags + "" -} - -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 = "

" + part[1] + "

" + end_text_page_article += "

" + part[1] + "

" } else if strings.Contains(content, "##") { part := strings.Split(content, `##`) - end_type = "

" + part[1] + "

" + end_text_page_article += "

" + part[1] + "

" } else if strings.Contains(content, "#") { part := strings.Split(content, `#`) - end_type = "

" + part[1] + "

" + end_text_page_article += "

" + part[1] + "

" + title_overview_articles = "

" + part[1] + "

" } else if strings.Contains(content, "HEADIMAGE:") { part := strings.Split(content, `HEADIMAGE:`) - end_type = "" + end_text_page_article += "" + image_overview_articles = "" + } else if strings.Contains(content, "DESCRIPTION:") { + part := strings.Split(content, `DESCRIPTION:`) + description_overview_articles = "

" + part[1] + "

" } else if strings.Contains(content, "[img]:") { part := strings.Split(content, `[img]:`) - end_type = "" + end_text_page_article += "" } 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 := "" for i := 0; i < len(part_2); i++ { part_tags += "" + part_2[i] + "" + tag_collection += "#" + part_2[i] + ":" + filename_new[0] + ":" + title_overview_articles + ":" + description_overview_articles + ":" + image_overview_articles } part_tags += "" - tags = part_tags + tags_page_article = part_tags } else if content == "" { - end_type = "
" + end_text_page_article += "
" } else { - end_type = "

" + content + "

" + end_text_page_article += "

" + content + "

" } - new_text += end_type } - filename_new := strings.Split(filename, ".md") - err = os.WriteFile("./website/articles/"+filename_new[0]+".html", []byte(top+""+new_text+"

Tags

"+tags+"
"+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 += "" + title + image + description + "" + tags + "" +} +func Page_Article(filename string, text string, tags string) { + err := os.WriteFile("./website/articles/"+filename+".html", []byte(top+""+text+"

Tags

"+tags+"
"+bottom), 0755) if err != nil { panic(err) } diff --git a/website/articles/index.html b/website/articles/index.html index 02002e2..a56f4a7 100644 --- a/website/articles/index.html +++ b/website/articles/index.html @@ -1 +1 @@ -Haufenet
Haufenet

Articles

This Website

This Website had a lot of diffrent version, featuring diffrent styles...

projectscsshtmlcoding
\ No newline at end of file +Haufenet
Haufenet

Articles

This Website

This Website had a lot of diffrent version, featuring diffrent styles...

projectscsshtmlcoding
\ No newline at end of file diff --git a/website/articles/this_website.html b/website/articles/this_website.html index d2176b3..8d307f2 100755 --- a/website/articles/this_website.html +++ b/website/articles/this_website.html @@ -1 +1 @@ -Haufenet
Haufenet

This Website

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.

The "Technology" behind it

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.

Usage of the Website

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.

Tags

projectscsshtmlcoding
\ No newline at end of file +Haufenet
Haufenet

This Website

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.

The "Technology" behind it

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.

Usage of the Website

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.

Tags

projectscsshtmlcoding
\ No newline at end of file diff --git a/website/imprint_privacy/index.html b/website/imprint_privacy/index.html index 7f80cf7..c976cd4 100755 --- a/website/imprint_privacy/index.html +++ b/website/imprint_privacy/index.html @@ -1 +1 @@ -Haufenet
Haufenet

Impressum

Lennard Haufe

Obere Ziegeli 11

71522 Backnang

Kontakt

Telefon: 004917650320223

E-Mail: info.lennard.haufe@haufenet.com

Inhaltlich verantwortlich i.S.v. § 18 Abs. 2 MStV

Lennard Haufe

Obere Ziegelei 11

71522 Backnang

Dieses Impressum gilt auch für folgende Social-Media-Profile

Instagram: https://www.instagram.com/haufe_net_com/

Quellenangaben für verwendete Bilder und Grafiken

D. Stroh – byd-film.de

\ No newline at end of file +Haufenet
Haufenet

Impressum

Lennard Haufe

Obere Ziegeli 11

71522 Backnang

Kontakt

Telefon: 004917650320223

E-Mail: info.lennard.haufe@haufenet.com

Inhaltlich verantwortlich i.S.v. § 18 Abs. 2 MStV

Lennard Haufe

Obere Ziegelei 11

71522 Backnang

Dieses Impressum gilt auch für folgende Social-Media-Profile

Instagram: https://www.instagram.com/haufe_net_com/

Quellenangaben für verwendete Bilder und Grafiken

D. Stroh – byd-film.de

\ No newline at end of file