From 105cd37dfe7af2e0090bf707330129b28e28260c Mon Sep 17 00:00:00 2001 From: shuai Date: Mon, 7 Apr 2025 11:44:34 +0800 Subject: [PATCH] fix: update seo template for footer template --- cmd/wire_gen.go | 24 +- docs/docs.go | 19 - docs/swagger.yaml | 17 - internal/service/mock/siteinfo_repo_mock.go | 19 - ui/template/footer.html | 34 +- ui/template/header.html | 3 +- ui/template/question.html | 172 ++++---- ui/test.html | 443 ++++++++++++++++++++ 8 files changed, 551 insertions(+), 180 deletions(-) create mode 100644 ui/test.html diff --git a/cmd/wire_gen.go b/cmd/wire_gen.go index 702f60df..3ad59130 100644 --- a/cmd/wire_gen.go +++ b/cmd/wire_gen.go @@ -1,28 +1,8 @@ -//go:build !wireinject -// +build !wireinject - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - // Code generated by Wire. DO NOT EDIT. //go:generate go run github.com/google/wire/cmd/wire +//go:build !wireinject +// +build !wireinject package answercmd diff --git a/docs/docs.go b/docs/docs.go index 2fb46904..34f87f2b 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1,22 +1,3 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - // Package docs Code generated by swaggo/swag. DO NOT EDIT package docs diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 16c5cfbb..bc0df88b 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1,20 +1,3 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - basePath: / definitions: constant.NotificationChannelKey: diff --git a/internal/service/mock/siteinfo_repo_mock.go b/internal/service/mock/siteinfo_repo_mock.go index 1b841278..7f6d89eb 100644 --- a/internal/service/mock/siteinfo_repo_mock.go +++ b/internal/service/mock/siteinfo_repo_mock.go @@ -1,22 +1,3 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - // Code generated by MockGen. DO NOT EDIT. // Source: ./siteinfo_service.go // diff --git a/ui/template/footer.html b/ui/template/footer.html index a72db38c..c5e97736 100644 --- a/ui/template/footer.html +++ b/ui/template/footer.html @@ -19,23 +19,25 @@ --> {{define "footer"}} - - + + + + {{if .FooterCode }}{{.FooterCode | templateHTML}}{{end}} diff --git a/ui/template/header.html b/ui/template/header.html index f6529b8d..404df75b 100644 --- a/ui/template/header.html +++ b/ui/template/header.html @@ -191,10 +191,9 @@
{{template "sidenav" . }} - {{end}}
- + {{end}}
diff --git a/ui/template/question.html b/ui/template/question.html index 6d7be332..7680e705 100644 --- a/ui/template/question.html +++ b/ui/template/question.html @@ -20,96 +20,98 @@ --> {{template "header" . }}
-
-
-
-
-
- {{translator $.language "ui.question.all_questions"}} -
- {{template "sort-btns" .}} -
-
- {{range .data}} -
  • -
    -
    - - shuai - {{.Operator.DisplayName}} - - {{.Operator.Rank}} -
    - • - -
    - -
    - {{if $.useTitle }} - {{.Title}} - {{else}} - {{.Title}} - {{end}} +
    +
    +
    +
    +
    +
    + {{translator $.language "ui.question.all_questions"}}
    - -
    - {{if $.useTitle }} - {{.Description}} - {{else}} - {{.Description}} - {{end}} -
    - -
    - {{range .Tags }} - - {{.SlugName}} - - {{end}} -
    - -
    -
    -
    - - {{.VoteCount}} - {{translator $.language "ui.counts.votes"}} + {{template "sort-btns" .}} +
    +
    + {{range .data}} +
  • +
    +
    + + shuai + {{.Operator.DisplayName}} + + {{.Operator.Rank}}
    -
    - - {{.AnswerCount}} - {{translator $.language "ui.counts.answers"}} -
    - - - {{.ViewCount}} - {{translator $.language "ui.counts.views"}} - + • +
    -
  • -
  • - {{end}} -
    -
    - {{template "page" .}} + +
    + {{if $.useTitle }} + {{.Title}} + {{else}} + {{.Title}} + {{end}} +
    + +
    + {{if $.useTitle }} + {{.Description}} + {{else}} + {{.Description}} + {{end}} +
    + +
    + {{range .Tags }} + + {{.SlugName}} + + {{end}} +
    + +
    +
    +
    + + {{.VoteCount}} + {{translator $.language "ui.counts.votes"}} +
    +
    + + {{.AnswerCount}} + {{translator $.language "ui.counts.answers"}} +
    + + + {{.ViewCount}} + {{translator $.language "ui.counts.views"}} + +
    +
    + + {{end}} +
    +
    + {{template "page" .}} +
    -
    -
    - {{template "hot-question" .}} +
    + {{template "hot-question" .}} +
    diff --git a/ui/test.html b/ui/test.html new file mode 100644 index 00000000..20cf636c --- /dev/null +++ b/ui/test.html @@ -0,0 +1,443 @@ + + + + + + 快速问答 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + +
    +
    +
    +
    +
    + + +
    +
    + +
    + +
    +
    +
    +
    +
    +
    + ui.question.all_questions +
    + + + + + +
    +
    + +
  • +
    + + • + +
    + +
    + + What is a tag? + +
    + + + + + +
    +
    +
    + + 0 + ui.counts.votes +
    +
    + + 1 + ui.counts.answers +
    + + + 0 + ui.counts.views + +
    +
    +
  • + +
  • +
    + + • + +
    + +
    + + What is reputation and how do I + earn them? + +
    + + + + + +
    +
    +
    + + 0 + ui.counts.votes +
    +
    + + 1 + ui.counts.answers +
    + + + 0 + ui.counts.views + +
    +
    +
  • + +
    +
    + +
      + + + +
    • + 1 + (current) + +
    • + + + +
    + +
    +
    +
    + +
    +
    + + +
    +
    +
    +
    + + \ No newline at end of file