Git Product home page Git Product logo

livebug.github.io's People

Contributors

livebug avatar

Watchers

 avatar

livebug.github.io's Issues

Add Gitalk 评论组件

https://livebug.github.io/blogs/20231014-add-gitalk/

  1. 增加模板页在主题的目录下 themes/xxx/layouts/partials/gitalk.html 1{{ if .Site.Params.enableGitalk }} 2
    3 4<script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script> 5<script> 6 const gitalk = new Gitalk({ 7 clientID: '{{ .Site.Params.Gitalk.clientID }}', 8 clientSecret: '{{ .Site.Params.Gitalk.clientSecret }}', 9 repo: '{{ .Site.Params.Gitalk.repo }}', 10 owner: '{{ .Site.Params.Gitalk.owner }}', 11 admin: ['{{ .Site.Params.Gitalk.owner }}'], 12 id: location.pathname, // Ensure uniqueness and length less than 50 13 distractionFreeMode: false // Facebook-like distraction free mode 14 }); 15 (function () { 16 if (["localhost", "127.

linux 使用代理以及遇到的问题

https://livebug.github.io/blogs/20240225-linux-proxy-common-questions/?

前提 你得有一个代理 我的场景是wsl,使用主机打开的 clash 代理
clash for windows 支持端口代理,所以在wsl中需要科学上网的场景可以走这个代理提高访问速度
理论可行,实现优点曲折。
小插曲,wsl2的网络模式与wsl1不一致,本质上是两台机器,通过网络链接,所以需要知道windows的IP,在wsl网络里的IP,
1# windows下执行 ipconfig即可看到 2> ipconfig 3以太网适配器 vEthernet (WSL (Hyper-V firewall)): 4 5 连接特定的 DNS 后缀 . . . . . . . : 6 本地链接 IPv6 地址. . . . . . . . : fe80::e4ec:39b6:69cb:8afe%42 7 IPv4 地址 . . . . . . . . . . . . : 172.31.192.1 8 子网掩码 . . . . .

hugo new content 命令使用 & 自定义新增文章脚本

https://livebug.github.io/blogs/20231014-hugo-new-content/?

hugo new content
创建新的内容文件并自动设置日期和标题。它将根据提供的路径猜测要创建的文件类型。
1hugo new content [path] [flags] hugo 新建文章,基本就是路径加文件名的命令,并不能只写名字,自动补全时间戳这种,自己写一个吧
1# 基本新建命令 2hugo new blogs/xxxxx.md hugonew.sh 脚本
1post_name=$1 2post_name=echo $post_name | tr -s '' # 去除多余空格 3post_name= echo ${post_name} | sed 's/[ ]/-/g' # 替换空格为 - 4echo ${post_name} 5date_string=date +%Y%m%d # 日期字符串 6date_string=date +%Y%m%d%H%M%S # 毫秒字符串 7date 8hugo new blogs/${post_name}.md $@ 9cd content/blogs/ 10mv ${post_name}.md ${date_string}-${post_name}.md 执行 自动拼接日期串 可以自己替换为毫秒字符串
1sh hugonew.sh "tests dsds SDASD " 2tests-dsds-SDASD 3Sat Oct 14 22:19:43 CST 2023 4Content "/home/sharif/myblog/content/blogs/tests-dsds-SDASD.

hugo new content 命令使用 & 自定义新增文章脚本

https://livebug.github.io/blogs/20231014-hugo-new-content/

hugo new content
创建新的内容文件并自动设置日期和标题。它将根据提供的路径猜测要创建的文件类型。
1hugo new content [path] [flags] hugo 新建文章,基本就是路径加文件名的命令,并不能只写名字,自动补全时间戳这种,自己写一个吧
1# 基本新建命令 2hugo new blogs/xxxxx.md hugonew.sh 脚本
1post_name=$1 2post_name=echo $post_name | tr -s '' # 去除多余空格 3post_name= echo ${post_name} | sed 's/[ ]/-/g' # 替换空格为 - 4echo ${post_name} 5date_string=date +%Y%m%d # 日期字符串 6date_string=date +%Y%m%d%H%M%S # 毫秒字符串 7date 8hugo new blogs/${post_name}.md $@ 9cd content/blogs/ 10mv ${post_name}.md ${date_string}-${post_name}.md 执行 自动拼接日期串 可以自己替换为毫秒字符串
1sh hugonew.sh "tests dsds SDASD " 2tests-dsds-SDASD 3Sat Oct 14 22:19:43 CST 2023 4Content "/home/sharif/myblog/content/blogs/tests-dsds-SDASD.

使用 Github Actions 自动化发布博客

https://livebug.github.io/blogs/20230930-github-actions/

介绍背景:
博客网站myblog仓库底下有两个子库,一个子库是用来存储markdown文章的blogs仓库,一个是用来存储public内容的github pages库 livebug.github.io仓库
当博客网站样式更新提交,或者文章提交,触发myblog仓库的 actions ,执行完之后发布到pages仓库
开发myblog仓库的提交 actions 1# Sample workflow for building and deploying a Hugo site to GitHub Pages 2name: Deploy Hugo site to Pages 3 4on: 5 # Runs on pushes targeting the default branch 6 push: 7 branches: ["master"] 8 9 # Allows you to run this workflow manually from the Actions tab 10 workflow_dispatch: 11 12# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 13permissions: 14 contents: read 15 pages: write 16 id-token: write 17 18# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.

hugo new content 命令使用 & 自定义新增文章脚本

https://livebug.github.io/blogs/20231014-hugo-new-content/

hugo new content
创建新的内容文件并自动设置日期和标题。它将根据提供的路径猜测要创建的文件类型。
1hugo new content [path] [flags] hugo 新建文章,基本就是路径加文件名的命令,并不能只写名字,自动补全时间戳这种,自己写一个吧
1# 基本新建命令 2hugo new blogs/xxxxx.md hugonew.sh 脚本
1post_name=$1 2post_name=echo $post_name | tr -s '' # 去除多余空格 3post_name= echo ${post_name} | sed 's/[ ]/-/g' # 替换空格为 - 4echo ${post_name} 5date_string=date +%Y%m%d # 日期字符串 6date_string=date +%Y%m%d%H%M%S # 毫秒字符串 7date 8hugo new blogs/${post_name}.md $@ 9cd content/blogs/ 10mv ${post_name}.md ${date_string}-${post_name}.md 执行 自动拼接日期串 可以自己替换为毫秒字符串
1sh hugonew.sh "tests dsds SDASD " 2tests-dsds-SDASD 3Sat Oct 14 22:19:43 CST 2023 4Content "/home/sharif/myblog/content/blogs/tests-dsds-SDASD.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.