feat: only show index in posts

main
sudo pacman -Syu 2022-12-30 17:08:50 +07:00
parent defb09a5b1
commit 33de466470
15 changed files with 23 additions and 45 deletions

View File

@ -40,9 +40,7 @@
}
</style>
<body class="markdown-body">
<div>
<a href="index">Index</a>
</div>
<div><a href="index">Index</a></div>
<h1>
<a
id="user-content-backup-my-way"

View File

@ -40,9 +40,7 @@
}
</style>
<body class="markdown-body">
<div>
<a href="index">Index</a>
</div>
<div><a href="index">Index</a></div>
<h1>
<a
id="user-content-dockerfile-for-go"

View File

@ -40,9 +40,7 @@
}
</style>
<body class="markdown-body">
<div>
<a href="index">Index</a>
</div>
<div><a href="index">Index</a></div>
<h1>
<a
id="user-content-bootstrap-go"

View File

@ -40,9 +40,7 @@
}
</style>
<body class="markdown-body">
<div>
<a href="index">Index</a>
</div>
<div><a href="index">Index</a></div>
<h1>
<a
id="user-content-uuid-or-else"

View File

@ -40,9 +40,7 @@
}
</style>
<body class="markdown-body">
<div>
<a href="index">Index</a>
</div>
<div><a href="index">Index</a></div>
<h1>
<a
id="user-content-migrate-to-buf-from-prototool"

View File

@ -40,9 +40,7 @@
}
</style>
<body class="markdown-body">
<div>
<a href="index">Index</a>
</div>
<div><a href="index">Index</a></div>
<h1>
<a
id="user-content-experiment-go"

View File

@ -40,9 +40,7 @@
}
</style>
<body class="markdown-body">
<div>
<a href="index">Index</a>
</div>
<div><a href="index">Index</a></div>
<h1>
<a id="user-content-sql" class="anchor" aria-hidden="true" href="#sql"
><span aria-hidden="true" class="octicon octicon-link"></span></a

View File

@ -40,9 +40,7 @@
}
</style>
<body class="markdown-body">
<div>
<a href="index">Index</a>
</div>
<div><a href="index">Index</a></div>
<h1>
<a
id="user-content-gitignore"

View File

@ -40,9 +40,7 @@
}
</style>
<body class="markdown-body">
<div>
<a href="index">Index</a>
</div>
<div><a href="index">Index</a></div>
<h1>
<a
id="user-content-reload-config"

View File

@ -40,9 +40,7 @@
}
</style>
<body class="markdown-body">
<div>
<a href="index">Index</a>
</div>
<div><a href="index">Index</a></div>
<h1>
<a
id="user-content-install-arch-linux"

View File

@ -40,9 +40,7 @@
}
</style>
<body class="markdown-body">
<div>
<a href="index">Index</a>
</div>
<div><a href="index">Index</a></div>
<h1>
<a
id="user-content-integration-go-grpc-with-buf"

View File

@ -40,9 +40,7 @@
}
</style>
<body class="markdown-body">
<div>
<a href="index">Index</a>
</div>
<div><a href="index">Index</a></div>
<h1>
<a
id="user-content-speed-up-writing-go-test-asap"

View File

@ -40,9 +40,6 @@
}
</style>
<body class="markdown-body">
<div>
<a href="index">Index</a>
</div>
<h1>
<a id="user-content-index" class="anchor" aria-hidden="true" href="#index"
><span aria-hidden="true" class="octicon octicon-link"></span></a

View File

@ -24,6 +24,7 @@ const (
)
type templatePostData struct {
Index string
Body string
}
@ -105,7 +106,14 @@ func main() {
}
defer htmlFile.Close()
// Ignore index in index file
indexHTML := `<div><a href="index">Index</a></div>`
if strings.Contains(postFilename, "index") {
indexHTML = ""
}
if err := templatePost.Execute(htmlFile, templatePostData{
Index: indexHTML,
Body: ghMarkdown,
}); err != nil {
return fmt.Errorf("template: failed to execute: %w", err)

View File

@ -40,10 +40,7 @@
}
</style>
<body class="markdown-body">
<div>
<a href="index">Index</a>
</div>
{{.Body}}
{{.Index}} {{.Body}}
<div>
Feel free to ask me via
<a href="mailto:hauvipapro+posts@gmail.com">email</a> or