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> </style>
<body class="markdown-body"> <body class="markdown-body">
<div> <div><a href="index">Index</a></div>
<a href="index">Index</a>
</div>
<h1> <h1>
<a <a
id="user-content-backup-my-way" id="user-content-backup-my-way"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -24,6 +24,7 @@ const (
) )
type templatePostData struct { type templatePostData struct {
Index string
Body string Body string
} }
@ -105,7 +106,14 @@ func main() {
} }
defer htmlFile.Close() 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{ if err := templatePost.Execute(htmlFile, templatePostData{
Index: indexHTML,
Body: ghMarkdown, Body: ghMarkdown,
}); err != nil { }); err != nil {
return fmt.Errorf("template: failed to execute: %w", err) return fmt.Errorf("template: failed to execute: %w", err)

View File

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