Starting for micro

This commit is contained in:
fundor333
2025-01-18 00:56:05 +01:00
parent 6e77313e5a
commit 866723ba70
8 changed files with 39 additions and 17 deletions

8
archetypes/micro.md Normal file
View File

@@ -0,0 +1,8 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
description:
tags:
categories:
---

View File

@@ -7,6 +7,10 @@ main:
name: "Blog"
url: "/post"
weight: 20
- pageRef: "/micro"
name: "Micro"
url: "/micro"
weight: 22
- pageRef: "/photos"
name: "Photos"
url: "/photos"

View File

@@ -7,7 +7,7 @@ defaultColor:
# Setting it to 'auto' applies the color scheme based on the visitor's device color preference.If you don't specify anything, ignore this parameter, or leave it blank,
# the default value is set to 'auto'.
# You can take a look at layouts/index.html for more information.
mainSections: ["post", "photos"]
mainSections: ["post", "photos", "micro"]
toc: false # set to false to disable table of contents 'globally'
tocOpen: false # set to true to open table of contents by default
goToTop: true # set to false to disable 'go to top' button

4
content/micro/_index.md Normal file
View File

@@ -0,0 +1,4 @@
---
title: "Micro"
specialpost: true
---

2
go.mod
View File

@@ -3,6 +3,6 @@ module github.com/fundor333/fundor333.github.io
go 1.23.4
require (
github.com/fundor333/macia-image v1.1.0 // indirect
github.com/fundor333/macia-image v1.1.1 // indirect
github.com/hugo-sid/hugo-blog-awesome v1.19.0 // indirect
)

4
go.sum
View File

@@ -1,4 +1,4 @@
github.com/fundor333/macia-image v1.1.0 h1:dLPDbQ8giOhTRKMM4/xWCJ/yFFlkz5HO9nDEH2s1w/Q=
github.com/fundor333/macia-image v1.1.0/go.mod h1:9zBOlIP9CvKcUcK3q+La1av6XH/fWPSApaYF/lvVAKY=
github.com/fundor333/macia-image v1.1.1 h1:KVMA1T8uQqDuS5ydmXmNcUaPA16wtRxC2j75VY8tHz8=
github.com/fundor333/macia-image v1.1.1/go.mod h1:9zBOlIP9CvKcUcK3q+La1av6XH/fWPSApaYF/lvVAKY=
github.com/hugo-sid/hugo-blog-awesome v1.19.0 h1:mKI+aTvXiFY6XSV/4VHdUsn82sL72Vh9OuBbYh3wy8U=
github.com/hugo-sid/hugo-blog-awesome v1.19.0/go.mod h1:3XVERF66wgQpTsruOajS5Swr+uvyTzov1acafNaqm1E=

View File

@@ -0,0 +1,6 @@
{{- range . }}
<a href="{{ trim .url " " }}" target="_blank" rel="noopener noreferrer me"
title="{{ (.title | default .name) | title }}">
{{ partial "svgs/svgs.html" . }}
</a>
{{- end }}

View File

@@ -25,25 +25,25 @@ def post_fc():
os.system(f"hugo new post/{year}/{name.replace(' ','-').replace(',','').lower()}/index.md")
def quiet_fc():
print("Make a quiet")
onlyfiles = [f for f in listdir("content/quiet") if isfile(join("content/quiet", f))]
numbs = []
for e in onlyfiles:
s = filter(str.isdigit, e)
s = "".join(s)
if s:
numbs.append(int(s))
generated = max(numbs) + random.randint(151, 839)
os.system(f"hugo new quiet/{generated}.md")
def micro_fc():
print("Make a micro")
name = input("Give me the title\n")
year = str(datetime.datetime.now().year)
month = str(datetime.datetime.now().month)
day = str(datetime.datetime.now().day)
hour = str(datetime.datetime.now().hour)
minute = str(datetime.datetime.now().minute)
generated = f"{year.ljust(4,"0")}{month.ljust(2,"0")}{day.ljust(2,"0")}{hour.ljust(2,"0")}{minute.ljust(2,"0")}-{name.replace(' ', '-').replace(',', '').lower()}"
print(generated)
os.system(f"hugo new micro/{generated}.md")
print(f"Generated {generated}.md")
ANSWER = {"post": post_fc, "quiet": quiet_fc, 'photo': post_photo, 'redirect': post_redirect}
ANSWER = {"post": post_fc, "micro": micro_fc, 'photo': post_photo, 'redirect': post_redirect}
def main_checker():
text = input("You need a new [post], a new [photo] or a new [quiet]\n") # Python 3
text = input("You need a new [post], a new [photo] or a new [micro]\n") # Python 3
# text = "post"
ANSWER.get(text, main_checker)()