# Site title: Oharu's Blog subtitle: "Technical Solutions and Life Thoughts Blog built on Hexo" description: "Welcome to Oharu's blog. Here, I document solutions to daily technical issues and share my thoughts on life. This space is dedicated to sharing knowledge about technology and insights into my life." keywords: IT Jobs,Life in Japan,Developer,Tech Blog,Life Thoughts author: Oharu language: zh timezone: 'Japan'
# URL ## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project' url: http://example.com permalink: :year-:month-:day-:title.html permalink_defaults: pretty_urls: trailing_index: true # Set to false to remove trailing 'index.html' from permalinks trailing_html: true # Set to false to remove trailing '.html' from permalinks
# Writing new_post_name: :title.md # File name of new posts default_layout: post titlecase: false # Transform title into titlecase external_link: enable: true # Open external links in new tab field: site # Apply to the whole site exclude: '' filename_case: 0 render_drafts: false post_asset_folder: true relative_link: false future: true syntax_highlighter: highlight.js highlight: line_number: true auto_detect: false tab_replace: '' wrap: true hljs: false prismjs: preprocess: true line_number: true tab_replace: ''
# Home page setting # path: Root path for your blogs index page. (default = '') # per_page: Posts displayed per page. (0 = disable pagination) # order_by: Posts order. (Order by date descending by default) index_generator: path: '' per_page: 10 order_by: -date
# Category & Tag default_category: uncategorized category_map: tag_map:
# Metadata elements ## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta meta_generator: true
# Date / Time format ## Hexo uses Moment.js to parse and display date ## You can customize the date format as defined in ## http://momentjs.com/docs/#/displaying/format/ date_format: YYYY-MM-DD time_format: HH:mm:ss ## updated_option supports 'mtime', 'date', 'empty' updated_option: 'mtime'
# Pagination ## Set per_page to 0 to disable pagination per_page: 10 pagination_dir: page
# Include / Exclude file(s) ## include:/exclude: options only apply to the 'source/' folder include: exclude: ignore:
PS C:\Users\cwang84\Desktop\Typora\hexo-blog> hexo server INFO Validating config INFO Start processing INFO Hexo is running at http://localhost:4000/ . Press Ctrl+C to stop. INFO See you again
3. github actions部署
今后hexo文件夹更新commit后,blog即可在github actions的作用下自动更新
3-1 创建username.github.io 仓库(username:ouharu)
3-2 hexo-blog 文件夹 push 到 username.github.io
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/hexo-blog (main) $ git remote add origin https://github.com/ouharu/oharu.github.io.git git branch -M main git push -u origin main
Enumerating objects: 17, done. Counting objects: 100% (17/17), done. Delta compression using up to 12 threads Compressing objects: 100% (10/10), done. Writing objects: 100% (17/17), 27.90 KiB | 3.49 MiB/s, done. Total 17 (delta 0), reused 0 (delta 0), pack-reused0 (from 0) To https://github.com/ouharu/oharu.github.io.git * [newbranch] main -> main branch 'main'set up to track 'origin/main'.
原因:由于 Hexo 在生成 HTML 时,对 Markdown 标题生成的 id 属性和你期望的锚点链接不一致。生成toc采用vscode markdown all in one插件,基于 github/gitlab flavored markdown 规则,转换为html时toc与标题的href链接不一致