1.将本地SSH添加到远程github 中,之后关联远程或push 出现以下错误:
fatal: Not a git repository (or any of the parent directories): .git
解决方案:执行 git init 。
git init
2.hexo g无法成功运行,出现以下错误:
TypeError: C:\Users\Maxence\Desktop\项目\MyBlog\Hexo\themes\vivia\layout\page.ejs:1
>> 1| <%- partial('_partial/article', {post: page, index: false}) %>
C:\Users\Maxence\Desktop\项目\MyBlog\Hexo\themes\vivia\layout\_partial\article.ejs:5
3|
4| <article id="<%= post.layout %>-<%= post.slug %>" class="h-entry article article-type-<%= post.layout %>" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
>> 5| <% if (is_post() || theme.home.style == 'detail') { %>
6| <%- partial('post/gallery') %>
7| <% } %>
8| <div class="article-inner">
Cannot read properties of undefined (reading 'style')
解决方案:将themes\vivia目录下的_config.vivia.yml或者_config.yml.example重命名为_config.yml。
3.使用主题vivia之后,本地部署成功,上传仓库发现被删除了。
解决方法:打开博客目录下的_config.yml文件,将repo地址由HTTPS改为SSH地址,并将branch: master修改为branch: main。