Skip to content

Commit

Permalink
feat: add internet security filing
Browse files Browse the repository at this point in the history
  • Loading branch information
Egolas committed Nov 4, 2023
1 parent 5e1d7ab commit 404e5d8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var (
Title string
Index string
ICP string
ISF string
FDir string
Copyright int64
LayoutFile = "layouts/layout.html"
Expand Down Expand Up @@ -79,6 +80,7 @@ func RunWeb(ctx *cli.Context) error {
ctx.ViewData("Title", Title)
ctx.ViewData("Nav", navs)
ctx.ViewData("ICP", ICP)
ctx.ViewData("ISF", ISF)
ctx.ViewData("Copyright", Copyright)
ctx.ViewData("ActiveNav", activeNav)
ctx.ViewLayout(LayoutFile)
Expand Down Expand Up @@ -123,6 +125,7 @@ func initParams(ctx *cli.Context) {
Title = ctx.String("title")
Index = ctx.String("index")
ICP = ctx.String("icp")
ISF = ctx.String("isf")
Copyright = ctx.Int64("copyright")
FDir = ctx.String("fdir")

Expand Down
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ func webCommand() *cli.Command {
Name: "icp",
Value: "",
Usage: "ICP, default is empty",
}), altsrc.NewStringFlag(&cli.StringFlag{
Name: "isf",
Value: "",
Usage: "National Internet Security Filing, default is empty",
}),
altsrc.NewIntFlag(&cli.IntFlag{
Name: "copyright",
Expand Down
6 changes: 5 additions & 1 deletion web/views/layouts/footer.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{{ if .ICP }}
<div class="footer">
<p>© Copyright {{.Copyright}} <a class="link" href="https://beian.miit.gov.cn">{{.ICP}}</a></p>
<p>© Copyright {{.Copyright}} <a class="link" href="https://beian.miit.gov.cn">{{.ICP}}</a>
{{ if .ISF }}
<a class="link" href="https://beian.mps.gov.cn">{{.ISF}}</a>
{{ end }}
</p>
</div>
{{ end }}

0 comments on commit 404e5d8

Please sign in to comment.