[{"data":1,"prerenderedAt":412},["ShallowReactive",2],{"content:\u002Fposts\u002F2023\u002Fuse-hexo-stellar-create-a-site":3,"surround:\u002Fposts\u002F2023\u002Fuse-hexo-stellar-create-a-site":401},{"id":4,"title":5,"body":6,"canonical":375,"categories":376,"date":378,"description":379,"draft":380,"extension":381,"image":375,"meta":382,"navigation":383,"path":384,"permalink":375,"readingTime":385,"recommend":375,"references":390,"seo":396,"sitemap":397,"stem":398,"tags":399,"type":375,"updated":378,"__hash__":400},"content\u002Fposts\u002F2023\u002Fuse-Hexo-Stellar-create-a-site.md","使用Hexo Stellar 主题搭建一个独立博客站点",{"type":7,"value":8,"toc":356},"minimark",[9,22,26,54,63,66,72,75,81,84,90,93,99,102,105,114,119,125,131,139,146,150,153,159,168,172,182,193,196,202,214,220,229,235,238,244,250,253,256,262,268,274,280,287,293,296,299,306,310,314,317,324,329,332,340,347,350,353],[10,11,12],"alert",{},[13,14,15,16,21],"p",{},"这里是使用",[17,18,20],"a",{"href":19},"","stellar创建个人站点","系列视频的文字部分，可以方便的粘贴一些配置项。",[23,24,25],"h2",{"id":25},"准备工作",[27,28,29,37,44],"ol",{},[30,31,32,33],"li",{},"安装 git 环境 ",[34,35,36],"code",{"code":36},"https:\u002F\u002Fgit-scm.com\u002Fdownload\u002Fwin",[30,38,39,40,43],{},"安装 nodejs 环境 ",[34,41,42],{"code":42},"https:\u002F\u002Fnodejs.org\u002Fen\u002F","\n记得去官网下载，下载这个是免费的",[30,45,46,47,53],{},"安装 hexo-cli\n我们可以访问",[17,48,52],{"href":49,"rel":50},"https:\u002F\u002Fhexo.io\u002Fzh-cn\u002F",[51],"nofollow","hexo 中文网","按照提示安装 hexo-cli",[55,56,61],"pre",{"className":57,"code":59,"language":60,"meta":19},[58],"language-bash","npm i -g hexo-cli\n","bash",[34,62,59],{"__ignoreMap":19},[23,64,65],{"id":65},"初始化项目",[55,67,70],{"className":68,"code":69,"language":60,"meta":19},[58],"hexo init stellar-blog && cd stellar-blog\n",[34,71,69],{"__ignoreMap":19},[13,73,74],{},"初次运行前，我们需要下载对应的依赖",[55,76,79],{"className":77,"code":78,"language":60,"meta":19},[58],"npm i\n",[34,80,78],{"__ignoreMap":19},[13,82,83],{},"依赖安装后，我们可以运行",[55,85,88],{"className":86,"code":87,"language":60,"meta":19},[58],"npm run server\n",[34,89,87],{"__ignoreMap":19},[13,91,92],{},"或者",[55,94,97],{"className":95,"code":96,"language":60,"meta":19},[58],"hexo server\n",[34,98,96],{"__ignoreMap":19},[13,100,101],{},"来启动 hexo 项目。运行成功后，我们可以看到一个网址，我们访问这个网址，如果出现了下面的这个页面，说明我们已经成功初始化了一个 hexo 博客。接下来我们就使用 hexo 提供的主题功能美化一下它吧。",[23,103,104],{"id":104},"主题配置",[13,106,107,108,113],{},"进入",[17,109,112],{"href":110,"rel":111},"https:\u002F\u002Fxaoxuu.com\u002Fwiki\u002Fstellar\u002F",[51],"stellar 主题官网","，按照它的提示进行如下步骤：",[27,115,116],{},[30,117,118],{},"安装主题",[55,120,123],{"className":121,"code":122,"language":60,"meta":19},[58],"npm i hexo-theme-stellar\n",[34,124,122],{"__ignoreMap":19},[27,126,128],{"start":127},2,[30,129,130],{},"在 stellar-blog\u002F_config.yml 文件中找到并修改：",[55,132,137],{"className":133,"code":135,"language":136,"meta":19},[134],"language-yml","theme: stellar\n","yml",[34,138,135],{"__ignoreMap":19},[13,140,141,142,145],{},"完成后，我们重新启动一下服务",[34,143,144],{"code":144},"npm run server","来看一下，发现网站已经变的和官网的页面差不多了，接下来来和我一起配置一下网站的其他内容吧。",[147,148,149],"h3",{"id":149},"配置网站基本信息",[13,151,152],{},"在 stellar-blog\u002F_config.yml 文件夹中找到对应的选项修改为您站点的内容",[55,154,157],{"className":155,"code":156,"language":136,"meta":19},[134],"title: 您的网站名称\navatar: 您的头像链接\nfavicon: 您的网站icon\n\n# 多语言\nlanguage:\n  - zh-CN\n",[34,158,156],{"__ignoreMap":19},[13,160,161,164,165],{},[34,162,163],{"code":163},"_config.yml"," 只是进行一些基础的配置，关于 stellar 主题的配置，我们需要在根目录下创建 ",[34,166,167],{"code":167},"_config.stellar.yml",[147,169,171],{"id":170},"_configstellaryml-文件配置","_config.stellar.yml 文件配置",[13,173,174,175,178,179,181],{},"我们可以去 ",[34,176,177],{"code":177},"node_modules\u002Fhexo-theme-stellar\u002F_config.yml"," 找到啊 stellar 项目的原始配置文件，复制到我们创建的",[34,180,167],{"code":167},"文件中。然后在此基础上进行改动",[13,183,184,185,188,189,192],{},"一般我们需要改动的只有",[34,186,187],{"code":187},"sidebar","部分和",[34,190,191],{"code":191},"footer","部分。",[13,194,195],{},"sidebar 部分我们需要配置网站的侧边栏",[55,197,200],{"className":198,"code":199,"language":136,"meta":19},[134],"sidebar:\n  menu:\n    post: '[btn.blog](\u002F)'\n    wiki: '[专栏](\u002Fwiki\u002F)'\n    notes: '[导航](\u002Fnotes\u002F)'\n    more: '[关于](\u002Fabout\u002F)'\n",[34,201,199],{"__ignoreMap":19},[13,203,204,205,209,210,213],{},"我们也可以在 sidebar 部分配置每个页面需要出现的小部件。",[17,206,208],{"href":207},"#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%B0%8F%E9%83%A8%E4%BB%B6","自定义的小部件","需要我们在 ",[34,211,212],{"code":212},"widgets.yml"," 文件中声明",[55,215,218],{"className":216,"code":217,"language":136,"meta":19},[134],"sidebar:\n  widgets:\n    # ### 自动生成的页面 ####\n    # 主页\n    home: search, welcome, recent, ad, tagcloud, timeline # for home\n    # 博客索引页\n    blog_index: search_blog, recent, ad, timeline # for categories\u002Ftags\u002Farchives\n    # 文档索引页\n    wiki_index: search_docs, recent, ad, timeline # for wiki\n    # 其它（404）\n    others: search, welcome, recent, timeline # for 404 and ...\n    # ### 手动创建的页面 ####\n    # 文章内页\n    post: toc, ghrepo, search, ghissues, ad # for pages using 'layout:post'\n    # 文档内页\n    wiki: search, ghrepo, toc, ad, ghissues, related # for pages using 'layout:wiki'\n    # 其它 layout:page 的页面\n    page: welcome, toc, ad # for custom pages using 'layout:page'\n",[34,219,217],{"__ignoreMap":19},[13,221,222,223,225,226],{},"当我们需要添加一个底部站点导航时，我们需要在",[34,224,191],{"code":191},"部分添加",[34,227,228],{"code":228},"sitemap",[55,230,233],{"className":231,"code":232,"language":136,"meta":19},[134],"footer:\n  sitemap:\n    博客:\n      - '[近期](\u002F)'\n      - '[分类](\u002Fcategories\u002F)'\n      - '[标签](\u002Ftags\u002F)'\n      - '[归档](\u002Farchives\u002F)'\n    专栏:\n      - '[vscode基础配置](\u002Fwiki\u002Fvscode\u002Findex.html)'\n      - '[typescript基础](\u002Fwiki\u002Ftypescript\u002Findex.html)'\n    更多:\n      - '[友链](\u002F)'\n      - '[关于本站](\u002Fabout\u002F)'\n      - '[文档站点](http:\u002F\u002Fdoc.weilog.me)'\n      - '[GitHub](https:\u002F\u002Fgithub.com\u002FWhbbit1999)'\n",[34,234,232],{"__ignoreMap":19},[147,236,237],{"id":237},"自定义小部件",[13,239,240,241,243],{},"在",[34,242,212],{"code":212},"文件中，我们可以定义一些小组件。官方定义的我们直接粘贴就行。这里我说一下自定义小组件",[55,245,248],{"className":246,"code":247,"language":136,"meta":19},[134],"ad:\n  layout: markdown\n  title: 可能是广告位吧🤨\n  content: |\n    [![sable-admin-ad.jpg](\u002Fassets\u002Fsable-admin-ad.jpg)](https:\u002F\u002Fgithub.com\u002FWhbbit1999\u002Fsable)\n",[34,249,247],{"__ignoreMap":19},[147,251,252],{"id":252},"创建独立页面",[13,254,255],{},"在 widgets.yml 中创建对应的 widgets",[55,257,260],{"className":258,"code":259,"language":136,"meta":19},[134],"Notes:\n  name: 笔记\n  title: 笔记\n  description: 一个隐藏项目：笔记\n  index: false\n  # sidebar: [toc]\n  tags: 知识库\n  sections:\n    日常问题解决方案: [100, 199]\n    移动端开发笔记: [200, 299]\n    前端学习笔记: [300, 399]\n    在线工具: [400, 499]\n",[34,261,259],{"__ignoreMap":19},[13,263,264,265,267],{},"添加后，可以在",[34,266,167],{"code":167},"中添加对应的 sidebar",[55,269,272],{"className":270,"code":271,"language":136,"meta":19},[134],"sidebar:\n  # ...\n  menu:\n    # ...\n    notes: '[笔记](\u002Fnotes\u002F)'\n",[34,273,271],{"__ignoreMap":19},[275,276,277],"blockquote",{},[13,278,279],{},"创建对应的文件夹（文件夹名需要对应路径），这里需要创建对应的 notes 文件夹",[13,281,282,283,286],{},"如果你有 wiki 页面并且不想让它出现在 wiki 页面中时，可以在",[34,284,285],{"code":285},"projects.yml","中添加",[55,288,291],{"className":289,"code":290,"language":136,"meta":19},[134],"Notes:\n  index: false\n",[34,292,290],{"__ignoreMap":19},[13,294,295],{},"接下来你就可以在对应的目录下书写对应的内容了。",[147,297,298],{"id":298},"添加友链",[13,300,301],{},[17,302,305],{"href":303,"rel":304},"https:\u002F\u002Fgithub.com\u002Fad-m\u002Fgithub-push-action\u002Fissues\u002F96#issuecomment-889984928",[51],"需要注意将 actions 的权限更改为可以写入内容",[23,307,309],{"id":308},"使用-github-pages-托管静态网站","使用 GitHub pages 托管静态网站",[23,311,313],{"id":312},"进阶部分使用-hexo-注入功能实现自定义功能","进阶部分——使用 hexo 注入功能实现自定义功能",[147,315,316],{"id":316},"代码块复制功能",[13,318,319],{},[17,320,323],{"href":321,"rel":322},"https:\u002F\u002Fwww.weilog.me\u002F2023\u002F01\u002F31\u002Fstellar%E4%B8%BB%E9%A2%98%E6%B7%BB%E5%8A%A0%E4%BB%A3%E7%A0%81%E5%9D%97%E5%A4%8D%E5%88%B6%E5%8A%9F%E8%83%BD\u002F",[51],"实现代码块复制功能",[275,325,326],{},[13,327,328],{},"目前该主题已支持通过配置实现代码复制功能",[147,330,331],{"id":331},"注入谷歌统计和百度统计",[55,333,338],{"className":334,"code":336,"language":337,"meta":19},[335],"language-js","\"use strict\"\n\n\u002F\u002F 百度统计和google 统计\nhexo.extend.injector.register(\"body_end\", function () {\n    return `\u003Cscript>\n  var _hmt = _hmt || [];\n  (function() {\n    var hm = document.createElement(\"script\");\n    hm.src = \"https:\u002F\u002Fhm.baidu.com\u002Fhm.js?31181a38d70c8faf2c5bed0d93cab07b\";\n    var s = document.getElementsByTagName(\"script\")[0];\n    s.parentNode.insertBefore(hm, s);\n  })();\n  \u003C\u002Fscript>\n\n  \u003Cscript async=\"async\" src=\"https:\u002F\u002Fwww.googletagmanager.com\u002Fgtag\u002Fjs?id=G-FTR5YKFFCM\">\u003C\u002Fscript>\n  \u003Cscript>\n  window.dataLayer = window.dataLayer || [];\n    function gtag(){dataLayer.push(arguments)};\n    gtag('js', new Date());\n    gtag('config', 'G-FTR5YKFFCM');\n  \u003C\u002Fscript>\n  `\n})\n","js",[34,339,336],{"__ignoreMap":19},[13,341,342,343,346],{},"这些只是 stellar 主题的基础使用，更多进阶部分您可以访问 stellar 主题页面中的",[17,344,345],{"href":19},"探索号","进行查看",[23,348,349],{"id":349},"结语",[13,351,352],{},"结合官方文档，您应该可以很轻松的使用 stellar 主题来搭建一个你自己的站点了。不妨先去试试！！！",[13,354,355],{},"如果您遇到什么问题可以在本期视频下方或者文章下方评论，我们可以一起解决问题。",{"title":19,"searchDepth":357,"depth":357,"links":358},4,[359,360,361,369,370,374],{"id":25,"depth":127,"text":25},{"id":65,"depth":127,"text":65},{"id":104,"depth":127,"text":104,"children":362},[363,365,366,367,368],{"id":149,"depth":364,"text":149},3,{"id":170,"depth":364,"text":171},{"id":237,"depth":364,"text":237},{"id":252,"depth":364,"text":252},{"id":298,"depth":364,"text":298},{"id":308,"depth":127,"text":309},{"id":312,"depth":127,"text":313,"children":371},[372,373],{"id":316,"depth":364,"text":316},{"id":331,"depth":364,"text":331},{"id":349,"depth":127,"text":349},null,[377],"代码","2023-01-31 00:48:42","如何使用 stellar 主题做一个自己的独立站点呢？",false,"md",{},true,"\u002Fposts\u002F2023\u002Fuse-hexo-stellar-create-a-site",{"text":386,"minutes":387,"time":388,"words":389},"7 min read",6.195,371700,1239,[391,394],{"title":392,"link":393},"Stellar","https:\u002F\u002Fxaoxuu.com\u002Fwiki\u002Fstellar\u002Fpages\u002F",{"title":395,"link":49},"hexo",{"title":5,"description":379},{"loc":384},"posts\u002F2023\u002Fuse-Hexo-Stellar-create-a-site",[395],"z0-l63I5jJkFsL5xLK7fEjpv7wi6xe2IRAGbg70f_Uc",[402,407],{"title":403,"path":404,"stem":405,"date":406,"type":375,"children":-1},"GitHub status 获取GitHub项目信息","\u002Fposts\u002F2023\u002Fgithub-status-get-github-project-info","posts\u002F2023\u002FGitHub-status-get-GitHub-project-info","2023-01-22 21:58:46",{"title":408,"path":409,"stem":410,"date":411,"type":375,"children":-1},"stellar主题添加代码块复制功能","\u002Fposts\u002F2023\u002Fstellar-theme-code-copy","posts\u002F2023\u002Fstellar-theme-code-copy","2023-01-31 13:07:10",1789642594945]