[
  {
    "path": ".gitignore",
    "content": "# If you prefer the allow list template instead of the deny list, see community template:\n# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore\n#\n# Binaries for programs and plugins\n*.exe\n*.exe~\n*.dll\n*.so\n*.dylib\n\n# Test binary, built with `go test -c`\n*.test\n\n# Output of the go coverage tool, specifically when used with LiteIDE\n*.out\n\n# Dependency directories (remove the comment below to include it)\n# vendor/\n\n# Go workspace file\ngo.work\n\n# Customize\nmarkdown\nstorage\nconfig.yml\n.idea"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "<div align=\"center\">\n  <a href=\"https://happy.zj.cn/\">\n    <img src=\"doc/imgs/Lacerate.png\" width=\"80px\" height=\"80px\">\n  </a>\n  <h1 align=\"center\">\n    Lacerate\n  </h1>\n  <h3 align=\"center\">\n    一个Goland编写的简单的静态博客生成器\n  </h3>\n\n[下 载](https://github.com/Foleyzhao/lacerate/releases) | [主 页](https://happy.zj.cn/)\n\n  <a href=\"https://github.com/Foleyzhao/lacerate/releases/latest\">\n    <img src=\"https://img.shields.io/github/release/Foleyzhao/lacerate.svg?style=flat-square\" alt=\"\">\n  </a>\n\n  <a href=\"https://github.com/Foleyzhao/lacerate/master/LICENSE\">\n    <img src=\"https://img.shields.io/github/license/Foleyzhao/lacerate.svg?style=flat-square\" alt=\"\">\n  </a>\n\n  <a href=\"https://github.com/Foleyzhao/lacerate/releases/latest\">\n    <img alt=\"GitHub All Releases\" src=\"https://img.shields.io/github/downloads/Foleyzhao/lacerate/total.svg?color=%2312b886&style=flat-square\">\n  </a>\n\n</div>\n<br>\n<div align=\"center\">\n  <img src=\"doc/imgs/主页.png\">\n</div>\n<br>\n\n👏  欢迎使用 **Lacerate** ！\n\n✍️  **Lacerate** 一个简单的静态博客生成器。\n\n## 特性👇\n\n📝  使用 **Markdown** 语法，进行快速创作\n\n🌉  对文章进行分类\n\n🏷️  对文章进行标签分组\n\n📋 根据年月进行文章归档\n\n🌁  自定义关于我页面\n\n💻  支持多客户端: **𝖶𝗂𝗇𝖽𝗈𝗐𝗌** / **𝖬𝖺𝖼𝖮𝖲** / **Linux**\n\n## 教程\n[配置文件说明](https://github.com/Foleyzhao/lacerate/blob/main/doc/%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E8%AF%B4%E6%98%8E.md) | \n[博客编写指南](https://github.com/Foleyzhao/lacerate/blob/main/doc/%E5%8D%9A%E5%AE%A2%E7%BC%96%E5%86%99%E6%8C%87%E5%8D%97.md)\n\n### 快速启动\n\n```bash\ngit clone https://github.com/Foleyzhao/lacerate.git\n\ngo build -o lacerate ./cmd/cmd.go\n\nnohup ./lacerate run > lacerate.log 2>&1 &\n```\n访问: http://localhost:8090/ \n\n### 详细指令\n\n```bash\n# lacerate command [args...]\n\n# 初始化博客文件夹\nlacerate init\n\n# 新建 markdown 文件\nlacerate new filename\n\n# 编译博客\nlacerate compile/c\n    \n# 打开文件监听器\nlacerate watch/w\n\n# 运行http服务，默认端口8090\nlacerate http [port]\n    \n# 运行lacerate，默认端口8090\nlacerate run [port]\n```\n\n## 联系\n[主页](https://happy.zj.cn/) | 邮箱: foleyzhao@163.com\n\n## 示例截图\n<div align=\"center\">\n  <img src=\"doc/imgs/主页.png\">\n</div>\n<br>\n<div align=\"center\">\n  <img src=\"doc/imgs/分类.png\">\n</div>\n<br>\n<div align=\"center\">\n  <img src=\"doc/imgs/归档.png\">\n</div>\n<br>\n<div align=\"center\">\n  <img src=\"doc/imgs/文章详情.png\">\n</div>\n<br>\n<div align=\"center\">\n  <img src=\"doc/imgs/关于我.png\">\n</div>\n\n## 贡献\n欢迎任何形式的贡献。可以使用 [pull requests](https://github.com/Foleyzhao/lacerate/pulls) 或 [issues](https://github.com/Foleyzhao/lacerate/issues) 的方式提交任何想法。\n\n## 支持\n<div>\n  <img src=\"doc/imgs/WeChat.jpg\" width=\"240px\">\n</div>\n\n## License\n[Apache-2.0](https://github.com/Foleyzhao/lacerate/blob/main/LICENSE). Copyright (c) 2024 Lacerate\n"
  },
  {
    "path": "cmd/cmd.go",
    "content": "package main\n\nimport (\n\t\"flag\"\n\t\"github.com/fatih/color\"\n\t\"lacerate/core/command\"\n\t\"lacerate/core/common\"\n\t\"lacerate/core/config\"\n\t\"lacerate/core/service\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\t// 命令行参数\n\targs []string\n)\n\n// 入口函数\nfunc main() {\n\t_, _ = color.New(color.FgGreen).Fprintln(os.Stdout, common.Banner)\n\n\tflag.Parse()\n\targs = flag.Args()\n\tif len(args) == 0 || len(args) > 3 {\n\t\tcommand.PrintHelp()\n\t\tos.Exit(1)\n\t}\n\n\tswitch args[0] {\n\n\tdefault:\n\t\tcommand.PrintHelp()\n\t\tos.Exit(1)\n\tcase \"init\":\n\t\tcommand.Initialize()\n\tcase \"new\":\n\t\tif len(args) == 2 {\n\t\t\tname := args[1]\n\t\t\tservice.CreateMarkdown(name)\n\t\t} else {\n\t\t\tpanic(\"the file name is missing.\")\n\t\t}\n\tcase \"compile\", \"c\":\n\t\tservice.Compile()\n\tcase \"watch\", \"w\":\n\t\tservice.NewWatch(config.Config().Paths, config.Config().Suffix).Watcher()\n\t\tdone := make(chan bool)\n\t\t<-done\n\tcase \"run\":\n\t\tservice.Compile()\n\t\tservice.NewWatch(config.Config().Paths, config.Config().Suffix).Watcher()\n\t\tvar port = 8090\n\t\tif len(args) == 2 {\n\t\t\tp, err := strconv.Atoi(args[1])\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tport = p\n\t\t}\n\t\tcommand.ListenHttpServer(port)\n\tcase \"http\", \"web\":\n\t\tvar port = 8090\n\t\tif len(args) == 2 {\n\t\t\tp, err := strconv.Atoi(args[1])\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tport = p\n\t\t}\n\t\tcommand.ListenHttpServer(port)\n\t}\n}\n"
  },
  {
    "path": "core/command/command.go",
    "content": "package command\n\nimport (\n\t\"fmt\"\n\t\"lacerate/core/config\"\n\t\"lacerate/core/log\"\n\t\"net/http\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\t// HELP 帮助信息\n\tHELP = `\nUsage:\n\nlacerate command [args...]\n\n\tInitialize the blog folder\n    \tlacerate init\n\n\tCreate a new markdown file\n    \tlacerate new filename\n\n\tCompile the blog\n    \tlacerate compile/c\n\n    Open the file listener\n    \tlacerate watch/w\n\n\tOpen the file server\n    \tlacerate http/web [port]\n\n    Run all Lacerate services\n    \tlacerate run [port]\n\t`\n)\n\n// PrintHelp 打印帮助信息\nfunc PrintHelp() {\n\tfmt.Println(HELP)\n}\n\n// Initialize 初始化操作\nfunc Initialize() {\n\tconfig.CreateConf()\n\tCreateDir()\n\tlog.Log.Debug(\"the initialization is successful!\")\n}\n\n// ListenHttpServer 启动http服务\nfunc ListenHttpServer(port int) {\n\tlog.Log.Info(\"open the built-in web server...\")\n\tp := strconv.Itoa(port)\n\thttp.Handle(\"/assets/\", http.StripPrefix(\"/assets/\", http.FileServer(http.Dir(config.GlobalConf.Html+\"/assets/\"))))\n\thttp.Handle(\"/\", http.StripPrefix(\"/\", http.FileServer(http.Dir(config.GlobalConf.Html))))\n\tlog.Log.Debugf(\"the built-in web server is successfully turned on and the port is monitored: %d...\", port)\n\terr := http.ListenAndServe(\":\"+p, nil)\n\tif err != nil {\n\t\tlog.Log.Errorf(\"listen http serve error: %s\", err)\n\t}\n}\n\n// CreateDir 创建博客目录\nfunc CreateDir() {\n\t_, err := os.Stat(config.GlobalConf.Html)\n\tif os.IsNotExist(err) {\n\t\tif err := os.MkdirAll(config.GlobalConf.Html, os.ModePerm); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\t_, err = os.Stat(config.GlobalConf.Markdown)\n\tif os.IsNotExist(err) {\n\t\tif err := os.MkdirAll(config.GlobalConf.Markdown, os.ModePerm); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\t_, err = os.Stat(config.GlobalConf.Storage)\n\tif os.IsNotExist(err) {\n\t\tif err := os.MkdirAll(config.GlobalConf.Storage, os.ModePerm); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\t_, err = os.Stat(config.GlobalConf.Theme)\n\tif os.IsNotExist(err) {\n\t\tif err := os.MkdirAll(config.GlobalConf.Theme, os.ModePerm); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "core/common/banner.go",
    "content": "package common\n\n// Banner banner\nvar Banner = `\n=========================================================\n ▄                                           ▄          \n █       ▄▄▄    ▄▄▄    ▄▄▄    ▄ ▄▄   ▄▄▄   ▄▄█▄▄   ▄▄▄  \n █      ▀   █  █▀  ▀  █▀  █   █▀  ▀ ▀   █    █    █▀  █ \n █      ▄▀▀▀█  █      █▀▀▀▀   █     ▄▀▀▀█    █    █▀▀▀▀ \n █▄▄▄▄▄ ▀▄▄▀█  ▀█▄▄▀  ▀█▄▄▀   █     ▀▄▄▀█    ▀▄▄  ▀█▄▄▀ \n         \n                 Author: HappyNewYear\n=========================================================\n`\n"
  },
  {
    "path": "core/config/config.go",
    "content": "package config\n\nimport (\n\t\"gopkg.in/yaml.v3\"\n\t\"io\"\n\t\"os\"\n)\n\nvar GlobalConf = Config()\n\nvar confFileName = \"config.yml\"\n\nvar confContent = `\n# 站点信息\ntitle: xxx's Blog\nsubtitle: 主页\ndescription: xxx's Blog\nkeywords: blog\n# 作者信息\nauthor: HappyNewYear\navatar: /assets/avatar.jpg\ngithub: https://github.com/Foleyzhao\nemail: foleyzhao@163.com\n# 配置信息\nsummary_line: 6\nhome_post_num: 10\n# 文件存储\ntheme: theme/blog\nmarkdown: markdown\nhtml: /data/www/html\nstorage: storage\n# 文件监听\npaths:\n  - markdown\nsuffix:\n  - md\n  - yml\n# 自定义信息\nhome_title: xxx's Blog\narchive_title: 归档\ntag_title: 标签\ncategory_title: 分类\nabout_title: 关于我\n`\n\n// SystemConfig 系统配置\ntype SystemConfig struct {\n\tTitle         string   `yaml:\"title\"`\n\tSubTitle      string   `yaml:\"subtitle\"`\n\tDescription   string   `yaml:\"description\"`\n\tKeywords      string   `yaml:\"keywords\"`\n\tAuthor        string   `yaml:\"name\"`\n\tAvatar        string   `yaml:\"avatar\"`\n\tGithub        string   `yaml:\"github\"`\n\tEmail         string   `yaml:\"email\"`\n\tSummaryLine   int      `yaml:\"summary_line\"`\n\tHomePostNum   int      `yaml:\"home_post_num\"`\n\tTheme         string   `yaml:\"theme\"`\n\tMarkdown      string   `yaml:\"markdown\"`\n\tHtml          string   `yaml:\"html\"`\n\tStorage       string   `yaml:\"storage\"`\n\tPaths         []string `yaml:\"paths\"`\n\tSuffix        []string `yaml:\"suffix\"`\n\tHomeTitle     string   `yaml:\"home_title,omitempty\"`\n\tArchiveTitle  string   `yaml:\"archive_title,omitempty\"`\n\tTagTitle      string   `yaml:\"tag_title,omitempty\"`\n\tCategoryTitle string   `yaml:\"category_title,omitempty\"`\n\tAboutTitle    string   `yaml:\"about_title,omitempty\"`\n}\n\n// 加载系统配置\nfunc loadConf() ([]byte, error) {\n\t_, err := os.Stat(confFileName)\n\tif os.IsNotExist(err) {\n\t\tCreateConf()\n\t}\n\tfile, err := os.Open(confFileName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func(file *os.File) {\n\t\t_ = file.Close()\n\t}(file)\n\n\treturn io.ReadAll(file)\n}\n\n// CreateConf 创建系统配置文件\nfunc CreateConf() {\n\t_, err := os.Stat(confFileName)\n\tif os.IsNotExist(err) {\n\t\t_, err := os.OpenFile(confFileName, os.O_WRONLY|os.O_CREATE, 0755)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tvar confWrite = []byte(confContent)\n\t\terr = os.WriteFile(confFileName, confWrite, 0666)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n}\n\n// Config 系统配置\nfunc Config() SystemConfig {\n\tconfContent, err := loadConf()\n\tif err != nil {\n\t\tpanic(\"failed to load configuration file: \" + err.Error())\n\t}\n\n\tc := SystemConfig{}\n\terr = yaml.Unmarshal(confContent, &c)\n\tif err != nil {\n\t\tpanic(\"failed to parse the configuration file: \" + err.Error())\n\t}\n\n\treturn c\n}\n"
  },
  {
    "path": "core/log/logger.go",
    "content": "package log\n\nimport \"github.com/sirupsen/logrus\"\n\n// Log 日志记录器\nvar Log = logrus.WithFields(logrus.Fields{})\n\n// 初始化\nfunc init() {\n\tLog.Logger.SetFormatter(&logrus.TextFormatter{\n\t\tForceColors: true,\n\t})\n\n\tLog.Logger.SetLevel(logrus.DebugLevel)\n}\n"
  },
  {
    "path": "core/model/archive.go",
    "content": "package model\n\nimport \"time\"\n\n// PublishedYears 年份归档列表\ntype PublishedYears []*PublishedYear\n\n// PublishedMonths 月份归档列表\ntype PublishedMonths []*PublishedMonth\n\n// PublishedYear 年份归档\ntype PublishedYear struct {\n\tYearStr   string                     `json:\"year\"`\n\tMonths    []*PublishedMonth          `json:\"months\"`\n\tMonthDict map[string]*PublishedMonth `json:\"-\"`\n}\n\n// PublishedMonth 月份归档\ntype PublishedMonth struct {\n\tMonthStr string     `json:\"month\"`\n\tPosts    []*Post    `json:\"posts\"`\n\tMonth    time.Month `json:\"-\"`\n}\n\nfunc (y PublishedYears) Len() int {\n\treturn len(y)\n}\n\nfunc (y PublishedYears) Swap(i, j int) {\n\ty[i], y[j] = y[j], y[i]\n}\n\nfunc (y PublishedYears) Less(i, j int) bool {\n\treturn y[i].YearStr > y[j].YearStr\n}\n\nfunc (m PublishedMonths) Len() int {\n\treturn len(m)\n}\n\nfunc (m PublishedMonths) Swap(i, j int) {\n\tm[i], m[j] = m[j], m[i]\n}\n\nfunc (m PublishedMonths) Less(i, j int) bool {\n\treturn m[i].Month > m[j].Month\n}\n"
  },
  {
    "path": "core/model/category.go",
    "content": "package model\n\n// Category 分类\ntype Category struct {\n\tCount int     `json:\"count\"`\n\tName  string  `json:\"name\"`\n\tPosts []*Post `json:\"posts\"`\n\tUrl   string  `json:\"url\"`\n}\n"
  },
  {
    "path": "core/model/post.go",
    "content": "package model\n\n// PostList 文章列表\ntype PostList []*Post\n\n// Post 文章\ntype Post struct {\n\tId          int      `json:\"id\"`\n\tTitle       string   `json:\"title\"`\n\tDescription string   `json:\"description\"`\n\tSummary     string   `json:\"summary\"`\n\tContent     string   `json:\"content\"`\n\tTags        []string `json:\"tags\"`\n\tCategory    []string `json:\"category\"`\n\tCreatedAt   int64    `json:\"created_at\"`\n\tUpdatedAt   int64    `json:\"updated_at\"`\n\tUrl         string   `json:\"url\"`\n}\n\nfunc (p PostList) Len() int {\n\treturn len(p)\n}\n\nfunc (p PostList) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p PostList) Less(i, j int) bool {\n\treturn p[i].CreatedAt > p[j].CreatedAt\n}\n"
  },
  {
    "path": "core/model/tag.go",
    "content": "package model\n\n// Tag 标签\ntype Tag struct {\n\tCount int     `json:\"count\"`\n\tName  string  `json:\"name\"`\n\tPosts []*Post `json:\"posts\"`\n\tUrl   string  `json:\"url\"`\n}\n"
  },
  {
    "path": "core/service/about.go",
    "content": "package service\n\nimport (\n\t\"lacerate/core/config\"\n\t\"lacerate/core/model\"\n\t\"lacerate/core/utils\"\n\t\"os\"\n\t\"path\"\n\t\"time\"\n)\n\n// GetAbout 获取about内容\nfunc GetAbout() (post *model.Post, err error) {\n\tpost = &model.Post{}\n\tabout := path.Join(config.GlobalConf.Markdown, \"/about.md\")\n\tif _, err := os.Stat(about); os.IsNotExist(err) {\n\t\treturn post, nil\n\t}\n\tcontent, err := os.ReadFile(about)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpost.Title = \"\"\n\tpost.Content = utils.MarkdownToHtml(string(content))\n\tpost.CreatedAt = time.Now().Unix()\n\treturn post, nil\n}\n"
  },
  {
    "path": "core/service/archive.go",
    "content": "package service\n\nimport (\n\t\"lacerate/core/model\"\n\t\"lacerate/core/utils\"\n\t\"sort\"\n\t\"time\"\n)\n\n// GetArchive 获取归档信息\nfunc GetArchive() []*model.PublishedYear {\n\tarchiveYear := make(model.PublishedYears, 0)\n\t_archiveYear := make(map[string]*model.PublishedYear)\n\tfor _, post := range postList {\n\t\tyearStr := utils.Year(post.CreatedAt)\n\t\tmonthStr := utils.Month(post.CreatedAt)\n\t\t_month := time.Unix(post.CreatedAt, 0).Month()\n\t\tyear := _archiveYear[yearStr]\n\t\tif year == nil {\n\t\t\tyear = &model.PublishedYear{YearStr: yearStr, Months: make([]*model.PublishedMonth, 0), MonthDict: make(map[string]*model.PublishedMonth)}\n\t\t\t_archiveYear[yearStr] = year\n\t\t}\n\t\tmonth := year.MonthDict[monthStr]\n\t\tif month == nil {\n\t\t\tmonth = &model.PublishedMonth{MonthStr: monthStr, Posts: []*model.Post{}, Month: _month}\n\t\t\tyear.MonthDict[monthStr] = month\n\t\t}\n\t\tmonth.Posts = append(month.Posts, post)\n\t}\n\tfor _, year := range _archiveYear {\n\t\tmonthArray := make(model.PublishedMonths, 0)\n\t\tfor _, month := range year.MonthDict {\n\t\t\tmonthArray = append(monthArray, month)\n\t\t}\n\t\tsort.Sort(monthArray)\n\t\tyear.MonthDict = nil\n\t\tyear.Months = monthArray\n\t\tarchiveYear = append(archiveYear, year)\n\t}\n\tsort.Sort(archiveYear)\n\treturn archiveYear\n}\n"
  },
  {
    "path": "core/service/category.go",
    "content": "package service\n\nimport (\n\t\"lacerate/core/model\"\n)\n\n// 分类列表\nvar categoryList map[string]*model.Category\n\n// 初始化\nfunc init() {\n\tcategoryList = make(map[string]*model.Category)\n}\n\n// GetCategoryList 获取菜单列表\nfunc GetCategoryList() map[string]*model.Category {\n\treturn categoryList\n}\n"
  },
  {
    "path": "core/service/compile.go",
    "content": "package service\n\nimport (\n\t\"html/template\"\n\t\"lacerate/core/config\"\n\t\"lacerate/core/log\"\n\t\"lacerate/core/utils\"\n\t\"os\"\n\t\"path\"\n\t\"strings\"\n)\n\n// 全局数据\nvar data = map[string]interface{}{\n\t\"title\":       config.GlobalConf.Title,\n\t\"subtitle\":    config.GlobalConf.SubTitle,\n\t\"description\": config.GlobalConf.Description,\n\t\"keywords\":    config.GlobalConf.Keywords,\n\t\"author\":      config.GlobalConf.Author,\n\t\"avatar\":      config.GlobalConf.Avatar,\n\t\"github\":      config.GlobalConf.Github,\n\t\"email\":       config.GlobalConf.Email,\n}\n\n// html模板函数字典\nvar funcMaps = template.FuncMap{\n\t\"unescaped\": utils.Unescaped,\n\t\"cmonth\":    utils.CMonth,\n\t\"format\":    utils.Format,\n\t\"count\":     utils.Count,\n\t\"lt\":        utils.Lt,\n\t\"gt\":        utils.Gt,\n\t\"eq\":        utils.Eq,\n\t\"md5\":       utils.Xmd5,\n}\n\n// Compile 编译博客\nfunc Compile() {\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tlog.Log.Errorf(\"panic recovered from: %v\", r)\n\t\t}\n\t}()\n\tlog.Log.Info(\"start compiling your blog...\")\n\tcheckThemeFile()\n\tcopyAssetsFile()\n\tLoadPostList()\n\t// 创建页面\n\tCompileHome()\n\tCompilePost()\n\tCompileArchive()\n\tCompileTagPage()\n\tCompileTag()\n\tCompileCategoryPage()\n\tCompileCategory()\n\tCompileAbout()\n\tstorageBlogMap()\n\tlog.Log.Debug(\"compilation complete...\")\n}\n\n// 存储文章\nfunc storageBlogMap() {\n\tstorage, err := utils.NewStorage(config.GlobalConf.Storage, \"storage.json\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\terr = storage.Store(GetPostList())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// CompileHome 编译主页\nfunc CompileHome() {\n\ttitle := config.GlobalConf.HomeTitle\n\tif len(strings.TrimSpace(title)) == 0 {\n\t\tdata[\"title\"] = \"home page\"\n\t} else {\n\t\tdata[\"title\"] = title\n\t}\n\tdata[\"postList\"] = GetHomePostList()\n\tdata[\"categoryList\"] = GetCategoryList()\n\tdata[\"tagList\"] = GetTagList()\n\terr := utils.MkDir(config.GlobalConf.Html)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\thomePath := path.Join(config.GlobalConf.Html, \"index.html\")\n\thtmlFile, err := os.Create(homePath)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tt, err := template.New(\"main.tpl\").Funcs(funcMaps).ParseFiles(config.GlobalConf.Theme+\"/layout/main.tpl\", config.GlobalConf.Theme+\"/layout/home.tpl\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\terr = t.Execute(htmlFile, data)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// 拷贝静态文件\nfunc copyAssetsFile() {\n\terr := utils.CopyDir(path.Join(config.GlobalConf.Theme, \"assets\"), path.Join(config.GlobalConf.Html, \"assets\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// 校验模板文件\nfunc checkThemeFile() {\n\tif _, err := os.Stat(config.GlobalConf.Theme); os.IsNotExist(err) {\n\t\tpanic(\"you need to initialize and add the template file first.\")\n\t}\n}\n\n// CompileCategoryPage 编译分类导航页\nfunc CompileCategoryPage() {\n\tsubTitle := config.GlobalConf.CategoryTitle\n\tif len(strings.TrimSpace(subTitle)) == 0 {\n\t\tdata[\"subtitle\"] = \"article category\"\n\t} else {\n\t\tdata[\"subtitle\"] = subTitle\n\t}\n\tdata[\"categoryList\"] = GetCategoryList()\n\tdata[\"tagList\"] = GetTagList()\n\tfilepath := path.Join(config.GlobalConf.Html, \"category\")\n\terr := utils.MkDir(filepath)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfilename := path.Join(filepath, \"index.html\")\n\thtmlFile, err := os.Create(filename)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tt, err := template.New(\"main.tpl\").Funcs(funcMaps).ParseFiles(config.GlobalConf.Theme+\"/layout/category.tpl\", config.GlobalConf.Theme+\"/layout/main.tpl\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\terr = t.Execute(htmlFile, data)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// CompileCategory 编译分类页\nfunc CompileCategory() {\n\tcateList := GetCategoryList()\n\tdata[\"categoryList\"] = cateList\n\tdata[\"tagList\"] = GetTagList()\n\tfor _, cate := range cateList {\n\t\tdata[\"subtitle\"] = cate.Name\n\t\tdata[\"pageTitle\"] = cate.Name\n\t\tdata[\"content\"] = cate.Posts\n\t\tdata[\"count\"] = cate.Count\n\t\tfilepath := path.Join(config.GlobalConf.Html, \"category\", cate.Name)\n\t\terr := utils.MkDir(filepath)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tfilename := path.Join(filepath, \"index.html\")\n\t\thtmlFile, err := os.Create(filename)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tt, err := template.New(\"main.tpl\").Funcs(funcMaps).ParseFiles(config.GlobalConf.Theme+\"/layout/page.tpl\", config.GlobalConf.Theme+\"/layout/main.tpl\")\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\terr = t.Execute(htmlFile, data)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n}\n\n// CompileTagPage 编译标签导航页\nfunc CompileTagPage() {\n\tsubTitle := config.GlobalConf.TagTitle\n\tif len(strings.TrimSpace(subTitle)) == 0 {\n\t\tdata[\"subtitle\"] = \"article tags\"\n\t} else {\n\t\tdata[\"subtitle\"] = subTitle\n\t}\n\tdata[\"categoryList\"] = GetCategoryList()\n\tdata[\"tagList\"] = GetTagList()\n\tfilePath := path.Join(config.GlobalConf.Html, \"tag\")\n\terr := utils.MkDir(filePath)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfileName := path.Join(filePath, \"index.html\")\n\thtmlFile, err := os.Create(fileName)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tt, err := template.New(\"main.tpl\").Funcs(funcMaps).ParseFiles(config.GlobalConf.Theme+\"/layout/tag.tpl\", config.GlobalConf.Theme+\"/layout/main.tpl\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\terr = t.Execute(htmlFile, data)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// CompileTag 编译标签页\nfunc CompileTag() {\n\ttags := GetTagList()\n\tdata[\"categoryList\"] = GetCategoryList()\n\tdata[\"tagList\"] = GetTagList()\n\tfor _, tag := range tags {\n\t\tdata[\"subtitle\"] = tag.Name\n\t\tdata[\"pageTitle\"] = tag.Name\n\t\tdata[\"content\"] = tag.Posts\n\t\tdata[\"count\"] = tag.Count\n\t\tdata[\"tpl\"] = config.GlobalConf.Theme + \"/layout/page.html\"\n\t\tfilepath := path.Join(config.GlobalConf.Html, \"tag\", tag.Name)\n\t\terr := utils.MkDir(filepath)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tfilename := path.Join(filepath, \"index.html\")\n\t\thtmlFile, err := os.Create(filename)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tt, err := template.New(\"main.tpl\").Funcs(funcMaps).ParseFiles(config.GlobalConf.Theme+\"/layout/page.tpl\", config.GlobalConf.Theme+\"/layout/main.tpl\")\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\terr = t.Execute(htmlFile, data)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n}\n\n// CompileAbout 编译关于我页\nfunc CompileAbout() {\n\tabout, err := GetAbout()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tsubTitle := config.GlobalConf.AboutTitle\n\tif len(strings.TrimSpace(subTitle)) == 0 {\n\t\tdata[\"subtitle\"] = \"about me\"\n\t} else {\n\t\tdata[\"subtitle\"] = subTitle\n\t}\n\tdata[\"post\"] = about\n\tdata[\"categoryList\"] = GetCategoryList()\n\tdata[\"tagList\"] = GetTagList()\n\tfilePath := path.Join(config.GlobalConf.Html, \"about.html\")\n\thtmlFile, err := os.Create(filePath)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tt, err := template.New(\"main.tpl\").Funcs(funcMaps).ParseFiles(config.GlobalConf.Theme+\"/layout/post.tpl\", config.GlobalConf.Theme+\"/layout/main.tpl\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\terr = t.Execute(htmlFile, data)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// CompilePost 编译文章页\nfunc CompilePost() {\n\tdata[\"categoryList\"] = GetCategoryList()\n\tdata[\"tagList\"] = GetTagList()\n\tfor _, post := range postList {\n\t\tdata[\"subtitle\"] = post.Title\n\t\tdata[\"description\"] = strings.TrimSpace(post.Summary)\n\t\tdata[\"keywords\"] = strings.Join(post.Tags, \",\")\n\t\tdata[\"post\"] = post\n\t\turl := CreatePostLink(post)\n\t\tfilePath := path.Join(config.GlobalConf.Html, url)\n\t\terr := utils.MkDir(filePath)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tfileName := path.Join(filePath, \"index.html\")\n\t\thtmlFile, err := os.Create(fileName)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tt, err := template.New(\"main.tpl\").Funcs(funcMaps).ParseFiles(config.GlobalConf.Theme+\"/layout/post.tpl\", config.GlobalConf.Theme+\"/layout/main.tpl\")\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\terr = t.Execute(htmlFile, data)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n}\n\n// CompileArchive 编译归档页\nfunc CompileArchive() {\n\tsubTitle := config.GlobalConf.ArchiveTitle\n\tif len(strings.TrimSpace(subTitle)) == 0 {\n\t\tdata[\"subtitle\"] = \"article archiving\"\n\t} else {\n\t\tdata[\"subtitle\"] = subTitle\n\t}\n\tdata[\"archive\"] = GetArchive()\n\tdata[\"categoryList\"] = GetCategoryList()\n\tdata[\"tagList\"] = GetTagList()\n\tfilePath := path.Join(config.GlobalConf.Html, \"archive\")\n\terr := utils.MkDir(filePath)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfileName := path.Join(filePath, \"index.html\")\n\thtmlFile, err := os.Create(fileName)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tt, err := template.New(\"main.tpl\").Funcs(funcMaps).ParseFiles(config.GlobalConf.Theme+\"/layout/archive.tpl\", config.GlobalConf.Theme+\"/layout/main.tpl\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\terr = t.Execute(htmlFile, data)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n"
  },
  {
    "path": "core/service/post.go",
    "content": "package service\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"gopkg.in/yaml.v3\"\n\t\"io\"\n\t\"lacerate/core/config\"\n\t\"lacerate/core/log\"\n\t\"lacerate/core/model\"\n\t\"lacerate/core/utils\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"sort\"\n\t\"strings\"\n\t\"time\"\n)\n\n// 文章列表\nvar postList []*model.Post\n\n// Content markdown内容\ntype Content struct {\n\tTitle       string\n\tDescription string\n\tDate        string\n\tCategories  []string\n\tTags        []string\n\tContent     string\n}\n\n// GetPostList 获取文章列表\nfunc GetPostList() []*model.Post {\n\treturn postList\n}\n\n// CreateMarkdown 创建markdown文件\nfunc CreateMarkdown(filename string) string {\n\tfile := path.Join(config.GlobalConf.Markdown, filename+\".md\")\n\t_, err := os.Stat(file)\n\tif !os.IsNotExist(err) {\n\t\tlog.Log.Errorf(\"The file already exists.\")\n\t\tos.Exit(1)\n\t}\n\tsrc, err := utils.CreateFile(config.GlobalConf.Markdown, filename+\".md\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdate := time.Now().Format(\"2006-01-02\")\n\tnow := time.Now().Format(\"15:04:05\")\n\tinformationContent := `---\ndate: ` + date + `\ntime: ` + now + `\ntitle: ` + filename + `\ncategories:\n-\ntagList:\n-\n-\n---`\n\terr = utils.WriteFile(src, informationContent)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn src\n}\n\n// MarkdownList 获取markdown文件夹下所有文件\nfunc MarkdownList(markdownDir string) (markdownList []string) {\n\t_ = filepath.Walk(markdownDir, func(path string, f os.FileInfo, err error) error {\n\t\tif err != nil { //忽略错误\n\t\t\treturn err\n\t\t}\n\t\tif f.IsDir() {\n\t\t\treturn nil\n\t\t}\n\t\t//if strings.ToLower(f.Name()) == \"readme.md\" {\n\t\t//\treturn nil\n\t\t//}\n\t\tif f.Name() == \"about.md\" {\n\t\t\treturn nil\n\t\t}\n\t\tif strings.HasSuffix(f.Name(), \".md\") {\n\t\t\tmarkdownList = append(markdownList, path)\n\t\t}\n\t\treturn nil\n\t})\n\n\treturn markdownList\n}\n\n// LoadPostList 加载文章列表\nfunc LoadPostList() {\n\tpostList = make([]*model.Post, 0)\n\tmarkdownList := MarkdownList(config.GlobalConf.Markdown)\n\tfor _, markdown := range markdownList {\n\t\tpost, err := loadMarkdownContent(markdown)\n\t\tif err == nil {\n\t\t\tpost.Url = CreatePostLink(post)\n\t\t\tpostList = append(postList, post)\n\t\t\tfor _, _cate := range post.Category {\n\t\t\t\tif len(_cate) <= 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tcategory := categoryList[_cate]\n\t\t\t\tif category == nil {\n\t\t\t\t\tcategory = &model.Category{Count: 0, Name: _cate, Posts: make([]*model.Post, 0), Url: \"/category/\" + _cate}\n\t\t\t\t\tcategoryList[_cate] = category\n\t\t\t\t}\n\n\t\t\t\tcategory.Count += 1\n\t\t\t\tcategory.Posts = append(category.Posts, post)\n\t\t\t}\n\t\t\tfor _, _tag := range post.Tags {\n\t\t\t\tif len(_tag) <= 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttag := tagList[_tag]\n\t\t\t\tif tag == nil {\n\t\t\t\t\ttag = &model.Tag{Count: 0, Name: _tag, Posts: make([]*model.Post, 0), Url: \"/tag/\" + _tag}\n\t\t\t\t\ttagList[_tag] = tag\n\t\t\t\t}\n\t\t\t\ttag.Count += 1\n\t\t\t\ttag.Posts = append(tag.Posts, post)\n\t\t\t}\n\t\t} else {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\tsort.Sort(model.PostList(postList))\n}\n\n// 加载markdown内容生成文章\nfunc loadMarkdownContent(file string) (post *model.Post, err error) {\n\tpost = &model.Post{}\n\tcontent, err := ReadMarkdownContent(file)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif post.Summary == \"\" {\n\t\tsummaryLine := config.GlobalConf.SummaryLine\n\t\tpost.Summary, err = generateSummary(content.Content, summaryLine)\n\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tpost.Title = content.Title\n\tpost.Description = content.Description\n\tpost.Category = content.Categories\n\tpost.Tags = content.Tags\n\tpost.Content = utils.MarkdownToHtml(content.Content)\n\tpost.CreatedAt = utils.Str2Unix(\"2006-01-02\", content.Date)\n\n\treturn post, nil\n}\n\n// 生成摘要\nfunc generateSummary(content string, lines int) (string, error) {\n\tbuff := bufio.NewReader(bytes.NewBufferString(content))\n\tdst := \"\"\n\tfor lines > 0 {\n\t\tline, err := buff.ReadString('\\n')\n\t\tif err != nil || io.EOF == err {\n\t\t\tbreak\n\t\t}\n\t\tif strings.Contains(strings.ToLower(line), \"[toc]\") {\n\t\t\tcontinue\n\t\t}\n\t\treg := regexp.MustCompile(`!\\[(.*)\\]\\((.*)\\)`)\n\t\tif reg.MatchString(line) {\n\t\t\tcontinue\n\t\t}\n\t\tif strings.Trim(line, \"\\r\\n\\t \") == \"```\" {\n\t\t\tcontinue\n\t\t}\n\t\tdst += line\n\t\tlines--\n\t}\n\n\treturn utils.MarkdownToHtml(dst), nil\n}\n\n// ReadMarkdownContent 读取markdown内容\nfunc ReadMarkdownContent(path string) (content *Content, err error) {\n\tf, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func(f *os.File) {\n\t\t_ = f.Close()\n\t}(f)\n\tbr := bufio.NewReader(f)\n\tline, err := br.ReadString('\\n')\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !strings.HasPrefix(line, \"---\") {\n\t\terr = fmt.Errorf(\"markdown file format error, the file header must start with '---': \" + path)\n\t\treturn nil, err\n\t}\n\tbuf := bytes.NewBuffer(nil)\n\tfor {\n\t\tline, err = br.ReadString('\\n')\n\t\tif err != nil {\n\t\t\tif err != io.EOF {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tif strings.HasPrefix(line, \"---\") {\n\t\t\tbreak\n\t\t}\n\t\tbuf.WriteString(line)\n\t}\n\terr = yaml.Unmarshal(buf.Bytes(), &content)\n\tcontentByte, err := io.ReadAll(br)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfi, _ := f.Stat()\n\tif content.Title == \"\" {\n\t\tcontent.Title = strings.Replace(strings.TrimRight(fi.Name(), \".md\"), config.GlobalConf.Markdown+\"/\", \"\", 1)\n\t}\n\tif content.Date == \"\" {\n\t\tcontent.Date = utils.Format(fi.ModTime().Unix())\n\t}\n\tcontent.Content = string(contentByte)\n\treturn\n}\n\n// CreatePostLink 创建文章链接\nfunc CreatePostLink(art *model.Post) string {\n\tt := time.Unix(art.CreatedAt, 0)\n\tyear, month, day := t.Date()\n\tlink := fmt.Sprintf(\"/%s/%d/%d/%d/%s/\", \"post\", year, month, day, utils.Convert(art.Title))\n\treturn link\n}\n\n// GetHomePostList 获取首页文章列表\nfunc GetHomePostList() []*model.Post {\n\tnum := config.GlobalConf.HomePostNum\n\tif num == 0 || len(postList) <= num {\n\t\tnum = len(postList)\n\t}\n\n\thomePostList := make([]*model.Post, num)\n\tcopy(homePostList, postList)\n\n\treturn homePostList\n}\n"
  },
  {
    "path": "core/service/tag.go",
    "content": "package service\n\nimport (\n\t\"lacerate/core/model\"\n)\n\n// 标签列表\nvar tagList map[string]*model.Tag\n\n// 初始化\nfunc init() {\n\ttagList = make(map[string]*model.Tag)\n}\n\n// GetTagList 获取标签列表\nfunc GetTagList() map[string]*model.Tag {\n\treturn tagList\n}\n"
  },
  {
    "path": "core/service/watcher.go",
    "content": "package service\n\nimport (\n\t\"github.com/fsnotify/fsnotify\"\n\t\"lacerate/core/log\"\n\t\"os\"\n\t\"strings\"\n\t\"time\"\n)\n\nvar (\n\t// 文件事件与事件时间字典\n\teventTime = make(map[string]int64)\n\t// 触发编译时间\n\tscheduleTime time.Time\n)\n\n// Watch 文件监控\ntype Watch struct {\n\tPaths  []string // 监控文件路径\n\tSuffix []string // 监控文件后缀\n}\n\n// NewWatch 新建文件监控\nfunc NewWatch(paths []string, suffix []string) *Watch {\n\treturn &Watch{paths, suffix}\n}\n\n// Watcher 文件监控\nfunc (w *Watch) Watcher() {\n\t// 初始化监听器\n\tlog.Log.Info(\"initialize the file listener...\")\n\twatcher, err := fsnotify.NewWatcher()\n\tif err != nil {\n\t\tpanic(\"failed to initialize the file listener: \" + err.Error())\n\t}\n\tgo func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase event := <-watcher.Events:\n\t\t\t\tbuild := true\n\t\t\t\tif !w.checkFileSuffix(event.Name) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif event.Op&fsnotify.Chmod == fsnotify.Chmod {\n\t\t\t\t\tlog.Log.Infof(\" skin %s \", event)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tmt := w.getFileModTime(event.Name)\n\t\t\t\tif t := eventTime[event.Name]; mt == t {\n\t\t\t\t\tlog.Log.Infof(\" skin %s \", event.String())\n\t\t\t\t\tbuild = false\n\t\t\t\t}\n\t\t\t\teventTime[event.Name] = mt\n\t\t\t\tif build {\n\t\t\t\t\tgo func() {\n\t\t\t\t\t\tscheduleTime = time.Now().Add(1 * time.Second)\n\t\t\t\t\t\tfor {\n\t\t\t\t\t\t\ttime.Sleep(scheduleTime.Sub(time.Now()))\n\t\t\t\t\t\t\tif time.Now().After(scheduleTime) {\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlog.Log.Infof(\"triggers a compilation event: %s \", event)\n\t\t\t\t\t\tCompile()\n\t\t\t\t\t}()\n\t\t\t\t}\n\t\t\tcase err := <-watcher.Errors:\n\t\t\t\tlog.Log.Errorf(\"monitoring failed %s \", err)\n\t\t\t}\n\t\t}\n\t}()\n\n\tfor _, path := range w.Paths {\n\t\tlog.Log.Infof(\"listen to folders: [%s] \", path)\n\t\terr = watcher.Add(path)\n\t\tif err != nil {\n\t\t\tlog.Log.Errorf(\"failed to monitor folder: [%s] \", err)\n\t\t\tos.Exit(2)\n\t\t}\n\t}\n\tlog.Log.Debug(\"the monitoring is successfully initialized...\")\n}\n\n// 校验文件后缀名\nfunc (w *Watch) checkFileSuffix(name string) bool {\n\tfor _, s := range w.Suffix {\n\t\tif strings.HasSuffix(name, \".\"+s) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// 获取文件最后更新时间\nfunc (w *Watch) getFileModTime(path string) int64 {\n\tpath = strings.Replace(path, \"\\\\\", \"/\", -1)\n\tf, err := os.Open(path)\n\tif err != nil {\n\t\tlog.Log.Errorf(\"the file failed to open [ %s ]\", err)\n\t\treturn time.Now().Unix()\n\t}\n\tdefer func(f *os.File) {\n\t\t_ = f.Close()\n\t}(f)\n\tfi, err := f.Stat()\n\tif err != nil {\n\t\tlog.Log.Errorf(\"unable to get file information [ %s ]\", err)\n\t\treturn time.Now().Unix()\n\t}\n\n\treturn fi.ModTime().Unix()\n}\n"
  },
  {
    "path": "core/utils/crypto.go",
    "content": "package utils\n\nimport (\n\t\"crypto/md5\"\n\t\"encoding/hex\"\n)\n\n// Xmd5 md5编码\nfunc Xmd5(text string) string {\n\tctx := md5.New()\n\tctx.Write([]byte(text))\n\treturn hex.EncodeToString(ctx.Sum(nil))\n}\n"
  },
  {
    "path": "core/utils/file.go",
    "content": "package utils\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path\"\n)\n\n// CreateFile 创建文件\nfunc CreateFile(dir string, name string) (string, error) {\n\tsrc := path.Join(dir, name)\n\t_, err := os.Stat(src)\n\tif os.IsExist(err) {\n\t\treturn src, nil\n\t}\n\tif err := os.MkdirAll(dir, 0777); err != nil {\n\t\tif os.IsPermission(err) {\n\t\t\tpanic(\"insufficient permissions\")\n\t\t}\n\t\treturn \"\", err\n\t}\n\t_, err = os.Create(src)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn src, nil\n}\n\n// MkDir 创建路径\nfunc MkDir(filepath string) error {\n\tif _, err := os.Stat(filepath); err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\terr = os.MkdirAll(filepath, os.ModePerm)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// CopyFile 复制文件\nfunc CopyFile(src, des string) (w int64, err error) {\n\tsrcFile, err := os.Open(src)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer func(srcFile *os.File) {\n\t\t_ = srcFile.Close()\n\t}(srcFile)\n\tdesFile, err := os.Create(des)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdefer func(desFile *os.File) {\n\t\t_ = desFile.Close()\n\t}(desFile)\n\treturn io.Copy(desFile, srcFile)\n}\n\n// CopyDir 复制路径\nfunc CopyDir(source string, dest string) (err error) {\n\tfi, err := os.Stat(source)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !fi.IsDir() {\n\t\treturn errors.New(\"source is not a directory\")\n\t}\n\t_, err = os.Open(dest)\n\tif os.IsExist(err) {\n\t\terr = os.RemoveAll(dest)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\terr = os.MkdirAll(dest, fi.Mode())\n\tif err != nil {\n\t\treturn err\n\t}\n\tentries, err := os.ReadDir(source)\n\tfor _, entry := range entries {\n\t\tsfp := source + \"/\" + entry.Name()\n\t\tdfp := dest + \"/\" + entry.Name()\n\t\tif entry.IsDir() {\n\t\t\terr = CopyDir(sfp, dfp)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t} else {\n\t\t\t_, err = CopyFile(sfp, dfp)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\n// WriteFile 写文件\nfunc WriteFile(file string, text string) error {\n\tf, err := os.OpenFile(file, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0660)\n\tif err != nil {\n\t\t_ = fmt.Errorf(\"open file error: %s\", err)\n\t}\n\tdefer func(f *os.File) {\n\t\t_ = f.Close()\n\t}(f)\n\tw := bufio.NewWriter(f)\n\t_, err = w.Write([]byte(text))\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn w.Flush()\n}\n"
  },
  {
    "path": "core/utils/markdown.go",
    "content": "package utils\n\nimport (\n\tbf \"github.com/russross/blackfriday\"\n\t\"log\"\n\t\"regexp\"\n\t\"strings\"\n)\n\n// TocTitle 目录标题\nvar TocTitle = \"<h4>目录:</h4>\"\n\n// nav正则\nvar navRegex = regexp.MustCompile(`(?ismU)<nav>(.*)</nav>`)\n\n// MarkdownToHtml markdown转html\nfunc MarkdownToHtml(content string) (str string) {\n\tdefer func() {\n\t\te := recover()\n\t\tif e != nil {\n\t\t\tstr = content\n\t\t\tlog.Println(\"Render markdown err:\", e)\n\t\t}\n\t}()\n\thtmlFlags := 0\n\tif strings.Contains(strings.ToLower(content), \"[toc]\") {\n\t\thtmlFlags |= bf.HTML_TOC\n\t}\n\thtmlFlags |= bf.HTML_USE_XHTML\n\thtmlFlags |= bf.HTML_USE_SMARTYPANTS\n\thtmlFlags |= bf.HTML_SMARTYPANTS_FRACTIONS\n\thtmlFlags |= bf.HTML_SMARTYPANTS_LATEX_DASHES\n\thtmlFlags |= bf.HTML_FOOTNOTE_RETURN_LINKS\n\trenderer := bf.HtmlRenderer(htmlFlags, \"\", \"\")\n\textensions := 0\n\textensions |= bf.EXTENSION_NO_INTRA_EMPHASIS\n\textensions |= bf.EXTENSION_TABLES\n\textensions |= bf.EXTENSION_FENCED_CODE\n\textensions |= bf.EXTENSION_AUTOLINK\n\textensions |= bf.EXTENSION_STRIKETHROUGH\n\textensions |= bf.EXTENSION_SPACE_HEADERS\n\textensions |= bf.EXTENSION_HARD_LINE_BREAK\n\textensions |= bf.EXTENSION_FOOTNOTES\n\tstr = string(bf.Markdown([]byte(content), renderer, extensions))\n\tif htmlFlags&bf.HTML_TOC != 0 {\n\t\tfound := navRegex.FindIndex([]byte(str))\n\t\tif len(found) > 0 {\n\t\t\ttoc := str[found[0]:found[1]]\n\t\t\ttoc = TocTitle + toc\n\t\t\tstr = str[found[1]:]\n\t\t\treg := regexp.MustCompile(`\\[toc\\]|\\[TOC\\]`)\n\t\t\tstr = reg.ReplaceAllString(str, toc)\n\t\t}\n\t}\n\treturn str\n}\n"
  },
  {
    "path": "core/utils/slice.go",
    "content": "package utils\n\n// Count 统计分片长度\nfunc Count(sl []string) (num int) {\n\tnum = 0\n\tfor _, s := range sl {\n\t\tif s != \"\" {\n\t\t\tnum += 1\n\t\t}\n\t}\n\treturn\n}\n\n// Lt 判断小于\nfunc Lt(a, b int) bool { return a < b }\n\n// Eq 判断等于\nfunc Eq(a, b int) bool { return a == b }\n\n// Gt 判断大于\nfunc Gt(a, b int) bool { return a > b }\n"
  },
  {
    "path": "core/utils/storage.go",
    "content": "package utils\n\nimport (\n\t\"bufio\"\n\t\"encoding/json\"\n\t\"os\"\n\t\"path\"\n)\n\n// Storage 文件存储\ntype Storage struct {\n\tstoragePath string // 文件存储路径\n\tname        string // 文件名\n}\n\n// NewStorage 新建文件存储\nfunc NewStorage(storagePath, fileName string) (*Storage, error) {\n\tif _, err := os.Stat(storagePath); err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\terr = os.MkdirAll(storagePath, os.ModePerm)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t} else {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn &Storage{storagePath: storagePath, name: fileName}, nil\n}\n\n// Get 解析文件存储\nfunc (s *Storage) Get(value interface{}) error {\n\tvar filepath = path.Join(s.storagePath, s.name)\n\treturn storageRead(filepath, value)\n}\n\n// Store 缓存文件存储\nfunc (s *Storage) Store(value interface{}) error {\n\tvar filepath = path.Join(s.storagePath, s.name)\n\treturn storageWrite(filepath, value)\n}\n\n// Del 删除文件存储\nfunc (s *Storage) Del() error {\n\tvar filepath = path.Join(s.storagePath, s.name)\n\treturn os.Remove(filepath)\n}\n\n// 读文件存储\nfunc storageRead(storagePath string, value interface{}) error {\n\tf, err := os.OpenFile(storagePath, os.O_RDWR, 0666)\n\tdefer func(f *os.File) {\n\t\t_ = f.Close()\n\t}(f)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn json.NewDecoder(bufio.NewReader(f)).Decode(&value)\n}\n\n// 写文件存储\nfunc storageWrite(storagePath string, value interface{}) error {\n\tcontent, err := json.Marshal(value)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn os.WriteFile(storagePath, content, os.ModePerm)\n}\n"
  },
  {
    "path": "core/utils/string.go",
    "content": "package utils\n\nimport (\n\t\"strings\"\n)\n\n// Convert 文章标题转换文章链接\nfunc Convert(str string) string {\n\tstr = strings.ToLower(str)\n\tss := strings.SplitN(str, \" \", -1)\n\n\treturn strings.Join(ss, \"-\")\n}\n"
  },
  {
    "path": "core/utils/template.go",
    "content": "package utils\n\nimport \"html/template\"\n\n// Unescaped 解析html\nfunc Unescaped(x string) interface{} {\n\treturn template.HTML(x)\n}\n"
  },
  {
    "path": "core/utils/time.go",
    "content": "package utils\n\nimport \"time\"\n\n// Format 日期格式化\nfunc Format(unix int64) string {\n\tt := time.Unix(unix, 0)\n\treturn t.Format(\"2006-01-02\")\n}\n\n// Month 月份格式化\nfunc Month(unix int64) string {\n\tt := time.Unix(unix, 0)\n\treturn t.Format(\"1\")\n}\n\n// Year 年份格式化\nfunc Year(unix int64) string {\n\tt := time.Unix(unix, 0)\n\treturn t.Format(\"2006\")\n}\n\n// CMonth 日期格式化（不带年份）\nfunc CMonth(unix int64) string {\n\tt := time.Unix(unix, 0)\n\treturn t.Format(\"01-02\")\n}\n\n// Str2Unix 字符串转时间\nfunc Str2Unix(layout, timeStr string) int64 {\n\ttm, _ := time.Parse(layout, timeStr)\n\treturn tm.Unix()\n}\n"
  },
  {
    "path": "doc/博客编写指南.md",
    "content": "博客（markdown）需要以 `---` 开头进行说明：\n\n```md\n\n---\ndate: 日期 xxxx-xx-xx\ntitle: 标题\ncategories:\n- 分类\ntags:\n- 标签\n---\n\n```"
  },
  {
    "path": "doc/配置文件说明.md",
    "content": "`config.yml`配置说明：\n\n```yaml\n\n# 站点信息\ntitle: 站点标题\nsubtitle: 站点子标题\ndescription: 站点描述\nkeywords: 站点关键字\n# 作者信息\nauthor: 作者名称\navatar: 头像图标\ngithub: github地址\nemail: 邮箱\n# 配置信息\nsummary_line: 首页文章行数\nhome_post_num: 首页文章数量\n# 文件存储\ntheme: 模板文件夹\nmarkdown: markdown文件夹\nhtml: html文件夹\nstorage: 存储文件夹\n# 文件监听\npaths:\n  - 监听文件\nsuffix:\n  - 监听文件后缀\n# 自定义信息\nhome_title: 主页子标题\narchive_title: 归档页面子标题\ntag_title: 标签页面子标题\ncategory_title: 分类页面子标题\nabout_title: 关于我页面子标题\n\n```"
  },
  {
    "path": "go.mod",
    "content": "module lacerate\n\ngo 1.22\n\nrequire (\n\tgithub.com/fatih/color v1.16.0\n\tgithub.com/fsnotify/fsnotify v1.7.0\n\tgithub.com/russross/blackfriday v1.6.0\n\tgithub.com/sirupsen/logrus v1.9.3\n\tgopkg.in/yaml.v3 v3.0.1\n)\n\nrequire (\n\tgithub.com/kr/pretty v0.3.1 // indirect\n\tgithub.com/mattn/go-colorable v0.1.13 // indirect\n\tgithub.com/mattn/go-isatty v0.0.20 // indirect\n\tgolang.org/x/sys v0.18.0 // indirect\n\tgopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect\n)\n"
  },
  {
    "path": "go.sum",
    "content": "github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=\ngithub.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=\ngithub.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=\ngithub.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=\ngithub.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=\ngithub.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=\ngithub.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=\ngithub.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=\ngithub.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=\ngithub.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=\ngithub.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=\ngithub.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=\ngithub.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=\ngithub.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=\ngithub.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww=\ngithub.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY=\ngithub.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=\ngithub.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=\ngithub.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=\ngithub.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=\ngithub.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=\ngolang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=\ngolang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\n"
  },
  {
    "path": "theme/blog/assets/css/basic.css",
    "content": "html {\n    height: 100%;\n    max-height: 100%;\n    padding: 0;\n    margin: 0; }\n\nbody {\n    padding: 0;\n    margin: 0;\n    line-height: 1.6em; }\n\n.clear {\n    clear: both;\n    display: block;\n    overflow: hidden;\n    visibility: hidden;\n    width: 0;\n    height: 0; }\n\nh1, h2, h3, h4, h5, h6 {\n    text-rendering: optimizeLegibility;\n    line-height: 1;\n    margin: 2rem 0; }\n\nh1 {\n    font-size: 2.1rem;\n    line-height: 1.2em; }\n\nh2 {\n    font-size: 1.9rem;\n    line-height: 1.2em; }\n\nh3 {\n    font-size: 1.75rem; }\n\nh4 {\n    font-size: 1.3rem; }\n\nh5 {\n    font-size: 1.3rem; }\n\nh6 {\n    font-size: 1.3rem; }\n\nimg {\n    max-width: 100%;\n    height: auto; }\n\np, ul, ol, dl {\n    margin: 1em 0; }\n\nol ol, ul ul, ul ol, ol ul {\n    margin: 0.4em 0; }\n\nul p, ol p, li p, .content li p, blockquote p, .content blockquote p,\n.post blockquote p, .post li p {\n    margin: 0;\n    overflow: visible; }\n\na img {\n    border: none; }\n\ndl dt {\n    float: left;\n    width: 180px;\n    overflow: hidden;\n    clear: left;\n    text-align: right;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    font-weight: bold;\n    margin-bottom: 1em; }\n\ndl dd {\n    margin-left: 200px;\n    margin-bottom: 1em; }\n\nhr {\n    display: block;\n    height: 1px;\n    border: 0;\n    border-top: 1px solid #efefef;\n    margin: 3.2em 0;\n    padding: 0; }\n\nblockquote {\n    -moz-box-sizing: border-box;\n    box-sizing: border-box;\n    margin: 1.6em 0 1.6em -2.3em;\n    padding: 0 0 0 1.6em;\n    border-radius: 0.4em;\n    border-left: #FF6600 0.4em solid; }\n\nblockquote p {\n    margin: 0.8em 0; }\n\nblockquote small {\n    display: inline-block;\n    margin: 0.8em 0 0.8em 1.5em;\n    font-size: 0.9em;\n    color: #ccc; }\n\nblockquote small:before {\n    content: '\\2014 \\00A0'; }\n\nblockquote cite {\n    font-weight: bold; }\n\nblockquote cite a {\n    font-weight: normal; }\n\nmark {\n    background-color: #ffc336; }\n\ncode, tt {\n    padding: 1px 3px;\n    font-family: Inconsolata, monospace, sans-serif;\n    font-size: 0.85em;\n    white-space: pre-wrap;\n    border: 1px solid #E3EDF3;\n    background: #f7f7f9;\n    color: #d14;\n    border-radius: 2px; }\n\n.label {\n    padding: 1px 5px 1px;\n    font-size: 11.25px;\n    font-weight: bold;\n    font-family: 'Lato', \"Open Sans\", \"PingFang SC\", \"Microsoft YaHei\", sans-serif;\n    color: #fff;\n    text-transform: uppercase;\n    background-color: #999;\n    -webkit-border-radius: 3px;\n    -moz-border-radius: 3px;\n    border-radius: 3px;\n    margin-left: 1mm;\n}\n.label-important {\n    background-color: #b94a48;\n    margin-right: 2mm;\n}\n\npre {\n    -moz-box-sizing: border-box;\n    box-sizing: border-box;\n    margin: 1.6em 0;\n    border: 1px solid #E3EDF3;\n    width: 100%;\n    padding: 10px;\n    font-family: Inconsolata, monospace, sans-serif;\n    font-size: 0.9em;\n    white-space: pre;\n    overflow: auto;\n    background: #F7FAFB;\n    border-radius: 3px; }\n\npre code, tt {\n    font-size: inherit;\n    white-space: -moz-pre-wrap;\n    white-space: pre-wrap;\n    background: transparent;\n    border: none;\n    color: #333;\n    padding: 0; }\n\nkbd {\n    display: inline-block;\n    margin-bottom: 0.4em;\n    padding: 1px 8px;\n    border: #ccc 1px solid;\n    color: #666;\n    text-shadow: #fff 0 1px 0;\n    font-size: 0.9em;\n    font-weight: bold;\n    background: #f4f4f4;\n    border-radius: 4px;\n    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 1px 0 0 white inset; }\n\ntable {\n    -moz-box-sizing: border-box;\n    box-sizing: border-box;\n    margin: 1em 0;\n    width: 100%;\n    max-width: 100%;\n    border-width: 1px;\n    border-style: solid;\n    background-color: transparent; }\n\ntable, table tr, table tr td, table tr th {\n    border-color: #e5e5e5; }\n\ntable th {\n    color: #666666;\n    background-color: #fdfdfd; }\n\ntr th {\n    border-bottom-width: 1px;\n    border-bottom-style: solid;\n    text-align: left; }\n\ntr th, tr td {\n    padding: 5px 20px;\n    border-right: 1px solid;\n    font-size: 1rem; }\n\ntr th:last-child, tr td:last-child {\n    border-right: 0px; }\n\ntable th {\n    font-weight: bold; }\n\ntable tbody > tr:nth-child(odd) > td, table tbody > tr:nth-child(odd) > th {\n    background-color: #f9f9f9; }\n\n.gist {\n    font-size: 12px; }\n.gist table {\n    margin: 0;\n    width: auto; }\n.gist table pre {\n    font-size: 12px; }\n.gist table .line-numbers {\n    font-size: 12px; }\n\n.codehilitetable {\n    margin: 0;\n    width: auto; }\n.codehilitetable tr th {\n    border: none; }\n.codehilitetable tr th, .codehilitetable tr td {\n    padding: 0;\n    border: none; }\n.codehilitetable .linenos pre {\n    background: transparent;\n    border: none; }\n.codehilitetable pre {\n    margin: 0; }\n\n.toc {\n    border: 1px solid #f0f0f0;\n    margin-bottom: 20px;\n    padding: 10px 30px; }\n\n#fb_comments_container {\n    overflow: hidden;\n    margin: 0 auto; }\n#fb_comments_container #fb_comments {\n    list-style-type: none;\n    padding: 0; }\n#fb_comments_container #fb_comments h1 {\n    font-size: 1.3em; }\n#fb_comments_container #fb_comments h2 {\n    font-size: 1.2em; }\n#fb_comments_container #fb_comments h3 {\n    font-size: 1.1em; }\n#fb_comments_container #fb_comments h4, #fb_comments_container #fb_comments h5,\n#fb_comments_container #fb_comments h6 {\n    font-size: 1.05em; }\n#fb_comments_container #fb_comments .comment {\n    position: relative;\n    padding: 25px 0;\n    border-bottom: 1px solid rgba(150, 150, 150, 0.2);\n    *border-bottom: 1px solid #f0f0f0; }\n#fb_comments_container #fb_comments .comment .avatar {\n    position: absolute;\n    top: 25px;\n    left: 0;\n    width: 50px;\n    float: left; }\n#fb_comments_container #fb_comments .comment .avatar img {\n    width: 48px;\n    border: none;\n    border-radius: 5px;\n    margin: 0; }\n#fb_comments_container #fb_comments .comment .comment_body,\n#fb_comments_container #fb_comments .comment .c_content {\n    margin-left: 70px;\n    display: block; }\n#fb_comments_container #fb_comments .comment .comment_body p,\n#fb_comments_container #fb_comments .comment .c_content p {\n    margin: 5px 0 15px 0;\n    padding: 0;\n    line-height: 1.8; }\n#fb_comments_container #fb_comments .comment .comment_body .author,\n#fb_comments_container #fb_comments .comment .c_content .author {\n    line-height: 1.5em;\n    margin: 0;\n    padding: 0; }\n#fb_comments_container #fb_comments .comment .comment_body .author b,\n#fb_comments_container #fb_comments .comment .c_content .author b {\n    color: #555; }\n#fb_comments_container #fb_comments .comment .comment_body .author small,\n#fb_comments_container #fb_comments .comment .c_content .author small {\n    font-weight: normal;\n    padding-left: 10px;\n    font-size: 0.7em;\n    color: #666; }\n\n#fb_new_comment {\n    padding-bottom: 50px; }\n#fb_new_comment textarea {\n    border-radius: 5px;\n    height: 80px;\n    width: 98%;\n    padding: 5px;\n    font-size: 1em;\n    border: 1px solid rgba(150, 150, 150, 0.5);\n    *border: 1px solid #a8a8a8;\n    line-height: 1.5; }\n#fb_new_comment .comment_error {\n    color: red;\n    text-align: center;\n    display: block;\n    font-size: 0.8em;\n    padding-top: 1em; }\n#fb_new_comment .c_button:hover {\n    background: #E60900;\n    color: #fff;\n    text-decoration: none; }\n#fb_new_comment .c_button, #fb_new_comment #c_submit {\n    cursor: pointer;\n    font-family: \"Hiragino Sans GB\", \"Microsoft YaHei\", sans-serif;\n    font-size: 1em;\n    line-height: 1.3em;\n    letter-spacing: 1px;\n    border-radius: 5px;\n    padding: 5px 5px 2px 5px; }\n#fb_new_comment .input_body {\n    margin-top: 10px; }\n#fb_new_comment .input_body ul {\n    list-style: none;\n    padding: 5px 0;\n    margin: auto 0; }\n#fb_new_comment .input_body ul li {\n    float: left;\n    margin-right: 2.2%;\n    *margin-right: 22px; }\n#fb_new_comment .input_body ul li label {\n    line-height: 1em; }\n#fb_new_comment .input_body ul li input {\n    border-radius: 5px;\n    border: 1px solid #ddd;\n    padding: 5px;\n    background: rgba(255, 255, 255, 0.5);\n    margin: 0 0 10px 0; }\n\n#SwfStore_farbox_0 {\n    height: 0;\n    overflow: hidden; }\n\n@media screen and (max-width: 320px) {\n    #fb_comments .c_content, #fb_comments .comment_body {\n        margin-left: 57px;   }\n}\n\n.codehilite code, .codehilite pre {\n    word-break: break-word;\n    color: #fdce93;\n    background-color: #3f3f3f;\n    padding: 10px;\n    border-radius: 3px; }\n\n.codehilite .hll {\n    background-color: #222; }\n\n.codehilite .c {\n    color: #7f9f7f; }\n\n.codehilite .err {\n    color: #e37170;\n    background-color: #3d3535; }\n\n.codehilite .g {\n    color: #7f9f7f; }\n\n.codehilite .k {\n    color: #f0dfaf; }\n\n.codehilite .l {\n    color: #ccc; }\n\n.codehilite .n {\n    color: #dcdccc; }\n\n.codehilite .o {\n    color: #f0efd0; }\n\n.codehilite .x {\n    color: #ccc; }\n\n.codehilite .p {\n    color: #41706f; }\n\n.codehilite .cm {\n    color: #7f9f7f; }\n\n.codehilite .cp {\n    color: #7f9f7f; }\n\n.codehilite .c1 {\n    color: #7f9f7f; }\n\n.codehilite .cs {\n    color: #cd0000;\n    font-weight: bold; }\n\n.codehilite .gd {\n    color: #cd0000; }\n\n.codehilite .ge {\n    color: #ccc;\n    font-style: italic; }\n\n.codehilite .gr {\n    color: red; }\n\n.codehilite .gh {\n    color: #dcdccc;\n    font-weight: bold; }\n\n.codehilite .gi {\n    color: #00cd00; }\n\n.codehilite .go {\n    color: gray; }\n\n.codehilite .gp {\n    color: #dcdccc;\n    font-weight: bold; }\n\n.codehilite .gs {\n    color: #ccc;\n    font-weight: bold; }\n\n.codehilite .gu {\n    color: purple;\n    font-weight: bold; }\n\n.codehilite .gt {\n    color: #0040D0; }\n\n.codehilite .kc {\n    color: #dca3a3; }\n\n.codehilite .kd {\n    color: #ffff86; }\n\n.codehilite .kn {\n    color: #dfaf8f;\n    font-weight: bold; }\n\n.codehilite .kp {\n    color: #cdcf99; }\n\n.codehilite .kr {\n    color: #cdcd00; }\n\n.codehilite .kt {\n    color: #00cd00; }\n\n.codehilite .ld {\n    color: #cc9393; }\n\n.codehilite .m {\n    color: #8cd0d3; }\n\n.codehilite .s {\n    color: #cc9393; }\n\n.codehilite .na {\n    color: #9ac39f; }\n\n.codehilite .nb {\n    color: #efef8f; }\n\n.codehilite .nc {\n    color: #efef8f; }\n\n.codehilite .no {\n    color: #ccc; }\n\n.codehilite .nd {\n    color: #ccc; }\n\n.codehilite .ni {\n    color: #c28182; }\n\n.codehilite .ne {\n    color: #c3bf9f;\n    font-weight: bold; }\n\n.codehilite .nf {\n    color: #efef8f; }\n\n.codehilite .nl {\n    color: #ccc; }\n\n.codehilite .nn {\n    color: #8fbede; }\n\n.codehilite .nx {\n    color: #ccc; }\n\n.codehilite .py {\n    color: #ccc; }\n\n.codehilite .nt {\n    color: #9ac39f; }\n\n.codehilite .nv {\n    color: #dcdccc; }\n\n.codehilite .ow {\n    color: #f0efd0; }\n\n.codehilite .w {\n    color: #ccc; }\n\n.codehilite .mf {\n    color: #8cd0d3; }\n\n.codehilite .mh {\n    color: #8cd0d3; }\n\n.codehilite .mi {\n    color: #8cd0d3; }\n\n.codehilite .mo {\n    color: #8cd0d3; }\n\n.codehilite .sb {\n    color: #cc9393; }\n\n.codehilite .sc {\n    color: #cc9393; }\n\n.codehilite .sd {\n    color: #cc9393; }\n\n.codehilite .s2 {\n    color: #cc9393; }\n\n.codehilite .se {\n    color: #cc9393; }\n\n.codehilite .sh {\n    color: #cc9393; }\n\n.codehilite .si {\n    color: #cc9393; }\n\n.codehilite .sx {\n    color: #cc9393; }\n\n.codehilite .sr {\n    color: #cc9393; }\n\n.codehilite .s1 {\n    color: #cc9393; }\n\n.codehilite .ss {\n    color: #cc9393; }\n\n.codehilite .bp {\n    color: #efef8f; }\n\n.codehilite .vc {\n    color: #efef8f; }\n\n.codehilite .vg {\n    color: #dcdccc; }\n\n.codehilite .vi {\n    color: #ffffc7; }\n\n.codehilite .il {\n    color: #8cd0d3; }\n\n@media (max-width: 480px) {\n    code {\n        padding: 0;\n        margin: 0;   }\n}"
  },
  {
    "path": "theme/blog/assets/css/style.css",
    "content": "html {\n    background-color: #fff;\n    -webkit-font-smoothing: antialiased; }\n\nbody {\n    color: rgba(0, 0, 0, 0.5);\n    font-family: georgia,palatino,\"Helvetica Neue\", Helvetica, \"Hiragino Sans GB\", \"STHeitiSC-Light\",\n    \"Microsoft YaHei\", \"微软雅黑\", Arial, sans-serif;\n    font-size: 15px;\n    width: 100%;\n    margin: 0 auto 30px auto;\n    background-color: #fff; }\n\n\n::selection{\n    background: #ec6200;\n    color:#FFF;\n}\n::-moz-selection{\n    background:#ec6200;\n    color:#FFF;\n}\np {\n    line-height: 1.9em;\n    font-weight: 400;\n    font-size: 16px; }\n\na {\n    text-decoration: none;\n}\n\na:link, a:visited {\n    opacity: 1;\n    -webkit-transition: all 0.15s linear;\n    -moz-transition: all 0.15s linear;\n    -o-transition: all 0.15s linear;\n    -ms-transition: all 0.15s linear;\n    transition: all 0.15s linear;\n    color: #424242; }\n\na:hover, a:active {\n    color: #555; }\n\n.animated {\n    -webkit-animation-fill-mode: both;\n    -moz-animation-fill-mode: both;\n    -ms-animation-fill-mode: both;\n    -o-animation-fill-mode: both;\n    animation-fill-mode: both;\n    -webkit-animation-duration: 1s;\n    -moz-animation-duration: 1s;\n    -ms-animation-duration: 1s;\n    -o-animation-duration: 1s;\n    animation-duration: 1s; }\n\n.animated.hinge {\n    -webkit-animation-duration: 1s;\n    -moz-animation-duration: 1s;\n    -ms-animation-duration: 1s;\n    -o-animation-duration: 1s;\n    animation-duration: 1s; }\n\n@-webkit-keyframes fadeInDown {\n    0% {\n        opacity: 0;\n        -webkit-transform: translateY(-20px);   }\n    100% {\n        opacity: 1;\n        -webkit-transform: translateY(0);   }\n}\n\n@-moz-keyframes fadeInDown {\n    0% {\n        opacity: 0;\n        -moz-transform: translateY(-20px);   }\n    100% {\n        opacity: 1;\n        -moz-transform: translateY(0);   }\n}\n\n@-o-keyframes fadeInDown {\n    0% {\n        opacity: 0;\n        -o-transform: translateY(-20px);   }\n    100% {\n        opacity: 1;\n        -o-transform: translateY(0);   }\n}\n\n@keyframes fadeInDown {\n    0% {\n        opacity: 0;\n        transform: translateY(-20px);   }\n    100% {\n        opacity: 1;\n        transform: translateY(0);   }\n}\n\n.fadeInDown {\n    -webkit-animation-name: fadeInDown;\n    -moz-animation-name: fadeInDown;\n    -o-animation-name: fadeInDown;\n    animation-name: fadeInDown; }\n\n.content {\n    height: auto;\n    float: right;\n    width: 70%;\n    margin-top: 60px; }\n\n.page-top {\n    width: 69.9%;\n    position: fixed;\n    right: 0;\n    z-index: 9999;\n    background-color: #fff;\n    height: 60px;\n    border-bottom: 1px solid #f2f2f2; }\n.page-top .nav {\n    list-style: none;\n    padding: 18px 30px;\n    float: left;\n    font-size: 12px; }\n.page-top .nav li {\n    position: relative;\n    display: initial;\n    padding-right: 20px; }\n.page-top .nav a {\n    color: #5A5A5A; }\n.page-top .nav a:hover {\n    color: #464545; }\n.page-top .nav a.current {\n    color: #5A5A5A;\n    padding-bottom: 22px;\n    border-bottom: 1px solid #5A5A5A; }\n.page-top .information {\n    float: right;\n    padding-top: 12px;\n    padding-right: 20px; }\n.page-top .information .avatar {\n    float: right; }\n.page-top .information .avatar img {\n    width: 32px;\n    height: 32px;\n    border-radius: 300px; }\n.page-top .information .back_btn {\n    float: left;\n    padding-top: 5px;\n    margin-right: -10px; }\n.page-top .information .back_btn li {\n    display: initial;\n    padding-right: 40px; }\n\n.sidebar {\n    width: 30%;\n    -webkit-background-size: cover;\n    background-size: cover;\n    background-color: #fff;\n    height: 100%;\n    transition: 0.8s;\n    top: 0;\n    left: 0;\n    position: fixed;\n    border-right: 1px solid #f2f2f2; }\n.sidebar .logo-title {\n    text-align: center;\n    padding-top: 240px; }\n.sidebar .logo-title .description {\n    font-size: 14px;\n    color: #565654; }\n.sidebar .logo-title .logo {\n    margin: 0 auto; }\n.sidebar .logo-title .title h3 {\n    text-transform: uppercase;\n    font-size: 2rem;\n    font-weight: bold;\n    letter-spacing: 2px;\n    line-height: 1;\n    margin: 0; }\n.sidebar .logo-title .title a {\n    text-decoration: none;\n    color: #464646;\n    font-weight: bold; }\n.sidebar .social-links {\n    list-style: none;\n    padding: 0;\n    font-size: 14px;\n    text-align: center; }\n.sidebar .social-links i {\n    margin-right: 3px; }\n.sidebar .social-links li {\n    display: inline;\n    padding: 0 4px;\n    line-height: 0; }\n.sidebar .social-links a {\n    color: #565654; }\n\n.post {\n    background-color: #FFF;\n    margin: 30px; }\n.post .post-title h1 {\n    text-transform: uppercase;\n    font-size: 30px;\n    letter-spacing: 5px;\n    line-height: 1; }\n.post .post-title h2 {\n    text-transform: uppercase;\n    letter-spacing: 1px;\n    font-size: 28px;\n    line-height: 1;\n    font-weight: 600;\n    color: #5f5f5f; }\n.post .post-title h3 {\n    text-transform: uppercase;\n    letter-spacing: 1px;\n    line-height: 1;\n    font-weight: 600;\n    color: #464646;\n    font-size: 22px;\n    margin: 0; }\n.post .post-title a {\n    text-decoration: none;\n    letter-spacing: 1px;\n    color: #5f5f5f;\n    font-family: Open Sans; }\n.post .post-content a {\n    text-decoration: none;\n    letter-spacing: 1px;\n    color: #4786D6; }\n.post .post-content h3 {\n    color: #5F5F5F;\n    font-size: 22px;\n    font-weight: 600;\n    font-family: Open Sans; }\n.post .post-content h4 {\n    color: #5F5F5F;\n    font-size: 16px;\n    font-family: Open Sans; }\n.post .post-content img {\n    max-width: 100%;\n    min-width: 700px;\n}\n.post .post-footer {\n    padding: 0 0 30px 0;\n    border-bottom: 1px solid #FFD8C9; }\n.post .post-footer .meta {\n    max-width: 100%;\n    height: 25px;\n    color: #bbbbbb; }\n.post .post-footer .meta .info {\n    float: left;\n    font-size: 12px; }\n.post .post-footer .meta .info .date {\n    margin-right: 5px; }\n.post .post-footer .meta a {\n    text-decoration: none;\n    color: #bbbbbb; }\n.post .post-footer .meta i {\n    margin-right: 3px; }\n.post .post-footer .tags {\n    padding-bottom: 15px;\n    font-size: 13px; }\n.post .post-footer .tags ul {\n    list-style-type: none;\n    display: inline;\n    margin: 0;\n    padding: 0; }\n.post .post-footer .tags ul li {\n    list-style-type: none;\n    margin: 0;\n    padding-right: 5px;\n    display: inline; }\n.post .post-footer .tags a {\n    text-decoration: none;\n    color: rgba(0, 0, 0, 0.44);\n    font-weight: 400; }\n.post .post-footer .tags a:hover {\n    text-decoration: none; }\n\n.pagination {\n    margin: 30px;\n    padding: 0px 0 56px 0;\n    border-bottom: 1px solid #f2f2f2; }\n.pagination ul {\n    list-style: none;\n    margin: 0;\n    padding: 0;\n    height: 13px; }\n.pagination ul li {\n    margin: 0 2px 0 2px;\n    display: inline;\n    line-height: 1; }\n.pagination ul li a {\n    text-decoration: none; }\n.pagination .pre {\n    float: left; }\n.pagination .next {\n    float: right; }\n\n.like-reblog-buttons {\n    float: right; }\n\n.like-button {\n    float: right;\n    padding: 0 0 0 10px; }\n\n.reblog-button {\n    float: right;\n    padding: 0; }\n\n#install-btn {\n    position: fixed;\n    bottom: 0px;\n    right: 6px; }\n\n#disqus_thread {\n    margin: 30px;\n    border-bottom: 1px solid #f2f2f2; }\n\n.footer {\n    clear: both;\n    text-align: center;\n    font-size: 10px;\n    margin: 0 auto;\n    bottom: 0;\n    position: absolute;\n    width: 100%;  }\n.footer a {\n    color: #A6A6A6; }\n\n.footer span {\n    color: #888;\n}\n\n.archive {\n    width: 100%; }\n\n.list-with-title {\n    font-size: 14px;\n    margin: 30px;\n    padding: 0; }\n.list-with-title li {\n    list-style-type: none;\n    padding: 0; }\n.list-with-title .listing-title {\n    font-size: 24px;\n    color: #666666;\n    font-weight: 600;\n    line-height: 2.2em; }\n.list-with-title .listing {\n    padding: 0; }\n.list-with-title .listing .listing-post {\n    padding-bottom: 5px; }\n.list-with-title .listing .listing-post .post-time {\n    float: right;\n    color: #C5C5C5; }\n.list-with-title .listing .listing-post a {\n    color: #8F8F8F; }\n.list-with-title .listing .listing-post a:hover {\n    color: #464545; }\n\n.share {\n    padding-left: 30px;\n    display: flex;\n    width: 100%;\n    height: 60px;\n    display: -webkit-box; }\n\n.evernote {\n    width: 32px;\n    height: 32px;\n    border-radius: 300px;\n    background-color: #3E3E3E;\n    margin-right: 5px; }\n.evernote a {\n    color: #fff;\n    padding: 11px;\n    font-size: 12px; }\n.evernote a:hover {\n    color: #ED6243;\n    padding: 11px; }\n\n.weibo {\n    width: 32px;\n    height: 32px;\n    border-radius: 300px;\n    background-color: #ED6243;\n    margin-right: 5px; }\n.weibo a {\n    color: #fff;\n    padding: 9px; }\n.weibo a:hover {\n    color: #BD4226; }\n\n.twitter {\n    width: 32px;\n    height: 32px;\n    border-radius: 300px;\n    background-color: #59C0FD;\n    margin-right: 5px; }\n.twitter a {\n    color: #fff;\n    padding: 9px; }\n.twitter a:hover {\n    color: #4B9ECE; }\n\n.about {\n    margin: 30px; }\n.about h3 {\n    font-size: 22px; }\n\n.comment-count {\n    color: #666; }\n\n.tab-community {\n    color: #666; }\n\n.read_more {\n    font-size: 14px; }\n\n.back-button {\n    padding-top: 30px;\n    max-width: 100px;\n    padding-left: 40px;\n    float: left; }\n\na.btn {\n    color: #868686;\n    font-weight: 400; }\n\n.btn {\n    display: inline-block;\n    position: relative;\n    outline: 0;\n    color: rgba(0, 0, 0, 0.44);\n    background: transparent;\n    font-size: 14px;\n    text-align: center;\n    text-decoration: none;\n    cursor: pointer;\n    border: 1px solid rgba(0, 0, 0, 0.15);\n    white-space: nowrap;\n    font-weight: 400;\n    font-style: normal;\n    border-radius: 999em; }\n\n.btn:hover {\n    display: inline-block;\n    position: relative;\n    outline: 0px;\n    color: #464545;\n    background: transparent;\n    font-size: 14px;\n    text-align: center;\n    text-decoration: none;\n    cursor: pointer;\n    border: 1px solid #464545;\n    white-space: nowrap;\n    font-weight: 400;\n    font-style: normal;\n    border-radius: 999em; }\n\n[role=\"back\"] {\n    padding: 0.5em 1.25em;\n    line-height: 1.666em; }\n\n[role=\"home\"] {\n    padding: 0.5em 1.25em;\n    line-height: 1.666em; }\n\n[role=\"navigation\"] {\n    padding: 0.5em 1.25em;\n    line-height: 1.666em; }\n\n[role=\"tags\"] {\n    padding: 6px 12px; }\n\n.menu {\n    float: right;\n    padding-top: 30px; }\n.menu .btn-down {\n    margin: 0px; }\n.menu .btn-down li {\n    list-style: none;\n    width: 100px; }\n.menu .btn-down li a {\n    display: inline-block;\n    position: relative;\n    padding: 0.5em 1.25em;\n    outline: 0;\n    color: rgba(0, 0, 0, 0.44);\n    background: transparent;\n    font-size: 14px;\n    text-align: center;\n    text-decoration: none;\n    cursor: pointer;\n    border: 1px solid rgba(0, 0, 0, 0.15);\n    white-space: nowrap;\n    font-weight: 400;\n    font-style: normal;\n    border-radius: 999em;\n    margin-top: 5px; }\n.menu .btn-down li a:hover {\n    position: relative;\n    padding: 0.5em 1.25em;\n    outline: 0;\n    color: #fff;\n    background: #3CBD10;\n    font-size: 14px;\n    text-align: center;\n    text-decoration: none;\n    cursor: pointer;\n    border: 1px solid rgba(0, 0, 0, 0.15);\n    white-space: nowrap;\n    font-weight: 400;\n    font-style: normal;\n    border-radius: 999em;\n    margin-top: 5px; }\n.menu .btn-down div {\n    position: absolute;\n    visibility: hidden;\n    width: 100px;\n    float: right; }\n\n@media screen and (max-width: 414px) {\n    .sidebar {\n        width: 100%;\n        position: absolute;\n        border-right: none;   }\n    .sidebar .logo-title {\n        padding-top: 100px;   }\n    .sidebar .logo-title .title img {\n        width: 100px;   }\n    .sidebar .logo-title .title h3 {\n        font-size: 20px;   }\n    .page-top {\n        display: none;   }\n    .content {\n        margin-top: 360px;\n        width: 100%;\n        overflow: hidden;   }\n    .footer {\n        display: none;   }\n    .share {\n        display: flex;\n        display: -webkit-box;   }\n}\n\n.profile h2 {\n    margin: 20px 0;\n    font-family: 'Montserrat', sans-serif;\n    font-size: 16px;\n    text-transform: uppercase;\n    letter-spacing: 5px;\n    color: #109289;\n}\n\n.cate-list {\n    margin: 20px auto;\n    text-transform: uppercase;\n    text-align: center;\n    color: #109289;\n    width: 80%;\n    font-size: 0.85em;\n    font-family: 'Lato', \"Open Sans\", \"PingFang SC\", \"Microsoft YaHei\", sans-serif;\n    -webkit-font-smoothing: antialiased;\n    -moz-osx-font-smoothing: grayscale;\n}\n\n.cate-list .cate-title {\n    width: 48%;\n}\n\n.cate-list .cate-title a {\n    display: inline-block;\n    margin: 5px 0;\n    text-decoration: none;\n    color: dimgrey;\n}\n\n.meta .info a:hover {\n    color: #FF7838;\n}\n\n.post-nav {\n    margin: 30px 0;\n}\n\n.comment_container {\n    margin: 30px;\n}"
  },
  {
    "path": "theme/blog/layout/archive.tpl",
    "content": "{{ define \"content\" }}\n    {{ range .archive }}\n    <div class=\"archive animated fadeInDown\">\n        <div class=\"list-with-title\">\n            <div class=\"listing-title\">{{ .YearStr }}</div>\n            <ul class=\"listing\">\n                {{ range .Months }}\n                <div class=\"listing-item\">\n                    {{ range .Posts }}\n                    <div class=\"listing-post\"><a href=\"{{ .Url }}\" title=\"{{ .Title }}\">{{ .Title }}</a>\n                        <div class=\"post-time\"><span class=\"date\">{{ .CreatedAt | format }}</span>\n                        </div>\n                    </div>\n                    {{ end }}\n                </div>\n                {{ end }}\n            </ul>\n        </div>\n    </div>\n    {{ end }}\n{{ end }}"
  },
  {
    "path": "theme/blog/layout/category.tpl",
    "content": "{{ define \"content\" }}\n<div class=\"archive animated fadeInDown\">\n    <div class=\"list-with-title\">\n        {{ range .categoryList }}\n        <div class=\"listing-title\">\n            <a href=\"{{ .Url }}\">\n                {{ .Name }}({{ .Count }})\n            </a>\n        </div>\n        {{ end }}\n    </div>\n</div>\n{{ end }}"
  },
  {
    "path": "theme/blog/layout/home.tpl",
    "content": "{{ define \"content\" }}\n    {{ range .postList }}\n    <div class=\"post animated fadeInDown\">\n        <div class=\"post-title\">\n            <h3><a style=\"color: #0077FF\" href=\"{{ .Url }}\">{{ .Title }}</a>\n            </h3>\n        </div>\n        <div class=\"post-content\">\n            <div class=\"p_part\">\n                {{ .Summary | unescaped }}\n            </div>\n        </div>\n        <div class=\"post-footer\">\n            <div class=\"meta\">\n                <div class=\"info\">\n                    <i class=\"fa fa-calendar\"></i>\n                    <span class=\"date\">{{ .CreatedAt | format }}</span>\n                    &nbsp;&nbsp;\n                    <i class=\"fa fa-folder-open\"></i>\n                    {{ range .Category }}\n                    <a href=\"/category/{{ . }}\">{{ . }}</a>&nbsp;\n                    {{ end }}\n                    &nbsp;&nbsp;\n                    <i class=\"fa fa-tags\"></i>\n                    {{ range .Tags }}\n                    <a href=\"/tag/{{ . }}\">{{ . }}</a>&nbsp;\n                    {{ end }}\n                </div>\n            </div>\n        </div>\n    </div>\n    {{ end }}\n{{ end }}"
  },
  {
    "path": "theme/blog/layout/main.tpl",
    "content": "<!DOCTYPE html>\n<html lang=\"zh-CN\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n    <meta name=\"keywords\" content=\"{{ .keywords }}\" />\n    <meta name=\"description\" content=\"{{ .description }}\" />\n    <link href=\"https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css\" rel=\"stylesheet\">\n    <link href=\"https://cdn.bootcss.com/highlight.js/9.15.8/styles/solarized-dark.min.css\" rel=\"stylesheet\">\n    <link href=\"/assets/css/basic.css\" rel=\"stylesheet\">\n    <link href=\"/assets/css/style.css\" rel=\"stylesheet\">\n    <title>{{.title}}</title>\n</head>\n<style type=\"text/css\">\n    h1,h2,h3 {\n        font-size: 22px;\n    }\n    ul li {\n        list-style: none;\n    }\n</style>\n<body style=\"zoom: 1;\">\n<!---left-start--->\n<div class=\"sidebar\">\n    <div class=\"logo-title\">\n        <div class=\"title animated fadeInDown\">\n            <img src=\"{{ .avatar }}\" style=\"width:127px;border-radius: 50%;\">\n            <hgroup>\n                <h1 class=\"header-author\"><a href=\"https://happy.zj.cn/\">{{ .title }}</a></h1>\n            </hgroup>\n            <div class=\"description animated fadeInDown\">\n                <p>{{ .subtitle }}</p>\n            </div>\n        </div>\n    </div>\n    <ul class=\"social-links animated fadeInDown\">\n        <li><a href=\"{{ .github }}\"><i class=\"fa fa-github\"></i></a>\n        </li>\n    </ul>\n    <div class=\"cate-list animated fadeInDown\">\n        分类：\n        {{ range .categoryList }}\n        <span class=\"cate-title\">\n                <a href=\"{{ .Url }}\">\n                    {{ .Name }}\n                </a>&nbsp;\n            </span>\n        {{ end }}\n    </div>\n    <div class=\"footer\">\n        <!--footer-->\n        <span>© HappyNewYear's Blog 2018 - 2024. &nbsp;&nbsp; 浙ICP备2023011627号-1</span>\n        <br>\n        <span>Powered by <a href=\"https://lacerate\">Lacerate</a>. </span>\n    </div>\n</div>\n<!---left-end--->\n<!---right-start--->\n<div class=\"main\">\n    <div class=\"page-top animated fadeInDown\">\n        <div class=\"nav\">\n            <li><a href=\"/\">主页</a>\n            </li>\n            <li><a href=\"/archive\">归档</a>\n            </li>\n            <li><a href=\"/about.html\">关于我</a>\n            </li>\n        </div>\n        <div class=\"information\">\n            <div class=\"back_btn\">\n            </div>\n            <div class=\"avatar\"><img src=\"{{ .avatar }}\">\n            </div>\n        </div>\n    </div>\n    <div class=\"autopagerize_page_element\">\n        <div class=\"content\">\n            {{ template \"content\" . }}\n            <div class=\"pagination\">\n                <ul class=\"clearfix\">\n                </ul>\n            </div>\n        </div>\n    </div>\n</div>\n<!----right-end---->\n<script src=\"https://cdn.bootcss.com/jquery/2.1.4/jquery.min.js\"></script>\n<script src=\"https://cdn.bootcss.com/twitter-bootstrap/3.4.1/js/bootstrap.min.js\"></script>\n<script src=\"https://cdn.bootcss.com/highlight.js/9.15.8/highlight.min.js\"></script>\n<script src=\"https://cdn.bootcss.com/highlight.js/9.15.8/languages/go.min.js\"></script>\n<script type=\"text/javascript\">\n    $(document).ready(function() {\n        $('pre code').each(function(i, block) {\n            hljs.highlightBlock(block);\n        });\n    });\n</script>\n</body>\n</html>"
  },
  {
    "path": "theme/blog/layout/page.tpl",
    "content": "{{ define \"content\" }}\n<div class=\"archive animated fadeInDown\">\n    <div class=\"list-with-title\">\n        <div class=\"listing-title\">{{ .pageTitle }}({{ .count }})</div>\n        <ul class=\"listing\">\n            {{ range .content }}\n            <div class=\"listing-item\">\n                <div class=\"listing-post\"><a href=\"{{ .Url }}\" title=\"{{ .Title }}\">{{ .Title }}</a>\n                    <div class=\"post-time\">\n                        <span class=\"date\">{{ .CreatedAt | format }}</span>\n                    </div>\n                </div>\n            </div>\n            {{ end }}\n        </ul>\n    </div>\n</div>\n{{ end }}\n"
  },
  {
    "path": "theme/blog/layout/post.tpl",
    "content": "{{ define \"content\" }}\n<div class=\"post-page\">\n    <div class=\"post animated fadeInDown\">\n        <div class=\"post-title\">\n            <h3>{{ .post.Title }}\n            </h3>\n        </div>\n        <div class=\"post-content\" id=\"content\">\n            {{ .post.Content | unescaped }}\n            <nav class=\"article-nav\" id=\"state\">\n                <span class=\"label label-important\">PERMANENT LINK:</span>\n                <a href=\"https://happy.zj.cn{{.post.Url}}\">https://happy.zj.cn{{.post.Url}}</a>\n            </nav>\n        </div>\n        <div class=\"post-footer\">\n            <div class=\"meta\">\n                <div class=\"info\">\n                    <i class=\"fa fa-calendar\"></i>\n                    <span class=\"date\">{{ .post.CreatedAt | format }}</span>\n                    &nbsp;&nbsp;\n                    <i class=\"fa fa-folder-open\"></i>\n                    {{ range .post.Category }}\n                    <a href=\"/category/{{ . }}\">{{ . }}</a>&nbsp;\n                    {{ end }}\n                    &nbsp;&nbsp;\n                    <i class=\"fa fa-tags\"></i>\n                    {{ range .post.Tags }}\n                    <a href=\"/tag/{{ . }}\">{{ . }}</a>&nbsp;\n                    {{ end }}\n                </div>\n            </div>\n        </div>\n    </div>\n    <!--评论-->\n</div>\n{{ end }}"
  },
  {
    "path": "theme/blog/layout/tag.tpl",
    "content": "{{ define \"content\" }}\n<div class=\"archive animated fadeInDown\">\n    <div class=\"list-with-title\">\n        {{ range .tagList }}\n        <div class=\"listing-title\">\n            <a href=\"{{ .Url }}\">\n                {{ .Name }}({{ .Count }})\n            </a>\n        </div>\n        {{ end }}\n    </div>\n</div>\n{{ end }}"
  }
]