Starting for micro
This commit is contained in:
8
archetypes/micro.md
Normal file
8
archetypes/micro.md
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
title: "{{ replace .Name "-" " " | title }}"
|
||||
date: {{ .Date }}
|
||||
description:
|
||||
tags:
|
||||
categories:
|
||||
---
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
4
content/micro/_index.md
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Micro"
|
||||
specialpost: true
|
||||
---
|
||||
2
go.mod
2
go.mod
@@ -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
4
go.sum
@@ -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=
|
||||
|
||||
6
layouts/partials/socialIcons.html
Normal file
6
layouts/partials/socialIcons.html
Normal 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 }}
|
||||
26
make-post.py
26
make-post.py
@@ -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)()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user