很多以前做过的事,细节步骤都不记得了,多写字吧,详细地记录下来,以后也有个回忆。
Octopress2.0 自动打开文件 插入本地图片 程序
添加功能:自动打开文件编辑
rake new_post["file name"] 后自动打开博客文件
编辑Rakefile文件,上面位置,添加定义:
1
| |
然后在new_post命令后面添加:
1 2 3 | |
插入本地图片
将图片放到octopress/source/images/下,然后在Markdown文件中可直接引用,用法:


前后行3个```显示代码,且有显示行数
1 2 3 4 5 | |
Octopress 2.0 Test on Ubuntu 20.04
rvm install 2.3.1
失败
.
cd octopress
.
ruby --version
.
rvm use 2.7.0
Required ruby-2.7.0 is not installed.
To install do: 'rvm install "ruby-2.7.0"'
记得是用2.7.0
.
dong@Ubuntu:~/octopress$ rvm install "ruby-2.7.0"
.
dong@Ubuntu:~/octopress$ ruby --version
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux]
.
dong@Ubuntu:~/octopress$ rake generate
Could not find rake-10.5.0 in any of the sources
Run `bundle install` to install missing gems.
.
dong@Ubuntu:~/octopress$ bundle install
Traceback (most recent call last):
4: from /home/dong/.rvm/rubies/ruby-2.7.0/bin/ruby_executable_hooks:22:in `<main>'
3: from /home/dong/.rvm/rubies/ruby-2.7.0/bin/ruby_executable_hooks:22:in `eval'
2: from /home/dong/.rvm/rubies/ruby-2.7.0/bin/bundle:23:in `<main>'
1: from /home/dong/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems.rb:294:in `activate_bin_path'
/home/dong/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems.rb:275:in `find_spec_for_exe': Could not find 'bundler' (1.17.3) required by your /home/dong/octopress/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:1.17.3`
.
dong@Ubuntu:~/octopress$ gem install bundler:1.17.3
Fetching bundler-1.17.3.gem
Successfully installed bundler-1.17.3
Parsing documentation for bundler-1.17.3
Installing ri documentation for bundler-1.17.3
Done installing documentation for bundler after 3 seconds
1 gem installed
.
dong@Ubuntu:~/octopress$ rake generate
Could not find rake-10.5.0 in any of the sources
Run `bundle install` to install missing gems.
.
dong@Ubuntu:~/octopress$ bundle install
.
dong@Ubuntu:~/octopress$ rake generate
rake aborted!
Gem::LoadError: You have already activated rake 13.0.1, but your Gemfile requires rake 10.5.0. Prepending `bundle exec` to your command may solve this.
/home/dong/octopress/Rakefile:2:in `<top (required)>'
(See full trace by running task with --trace)
提示失败,
但是可以加上bundle exec
dong@Ubuntu:~/octopress$bundle exec rake generate
很多警告,但是成了,
下面也一样:
bundle exec rake preview
Ubuntu 安装后wifi无法使用
原文件是ubuntu16.04安装了octopress2.0,升级到ubuntu18.04,新建此文件,可以运行,没报错,然后改成这个内容
首先利用rfkill命令查看目前无线传输设备的状态,rfkill是一个命令行工具,可使用它查询和更改系统中启用了RFKill的设备。
rfkill的常用方法为:
rfkill list all
# 获得设备列表
rfkill block [index|type]
# 通过索引或类型禁用设备
rfkill unblock [index|type]
# 通过索引或类型启用设备
当前设备状态如下:
rfkill list all
输出:
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: yes
1: acer-wireless: Wireless LAN
Soft blocked: no
Hard blocked: no
通过rfkill启用/禁用设备无法对硬件阻塞产生作用。
由于笔记本只有一个无线网卡,这两个模块应该是有冲突
使用命令lsmod | grep acer可以看出系统启动了acer_wmi模块
通过查找资料后,解决方法为禁用acer_wmi模块。
解决方法:
通过在/etc/modprobe.d/文件夹下,编辑blacklist.conf文件,最后一行添加内容: blacklist acer_wmi
sudo gedit /etc/modprobe.d/blacklist.conf
重启
wifi自动为打开状态,此时rfkill list all命令结果如下:
rfkill list all
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
版权声明:本文为CSDN博主「Monkey_D_Shuai」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/ls12165/article/details/68189943
Ubuntu 16.04 Install Octopress 2.0
ubuntu20.04安装了几次2.0都失败
ubuntu12.04已经无法安装系统本身的更新了,更别说安装其他软件
强迫症发作,于是有了这次:
列出大致步骤吧,主要是有些error要如何解决
侧边栏增加分类 Category
三步
Step 1
添加 category_list 插件
在 octopress\plugins\ 文件夹里面,新建一个文件,名为:category_list_tag.rb。并将下面的代码粘贴到里面。
module Jekyll
class CategoryListTag < Liquid::Tag
def render(context)
html = ""
categories = context.registers[:site].categories.keys
categories.sort.each do |category|
posts_in_category = context.registers[:site].categories[category].size
category_dir = context.registers[:site].config['category_dir']
category_url = File.join(category_dir, category.gsub(/_|\P{Word}/, '-').gsub(/-{2,}/, '-').downcase)
html << "<li class='category'><a href='/#{category_url}/'>#{category} (#{posts_in_category})</a></li>\n"
end
html
end
end
end
Liquid::Template.register_tag('category_list', Jekyll::CategoryListTag)
这个插件会向liquid注册一个名为category_list的tag,该tag就是以li的形式将站点所有的category组织起来。如果要将category加入到侧边导航栏,需要增加一个aside。
Step 2
增加 aside
在 octopress\source\_includes\asides\ 文件夹里面,新建一个文件,名为:category_list.html 。并粘贴下面的代码:
注意: 去掉 % 前面的2个 \
这里如果不加上\,markdown格式会显示category_list的内容。我是为了正确显示代码才加上的
<section>
<h1>Categories</h1>
<ul id="categories">
{\% category_list \%}
</ul>
</section>
Step 3
_config.yml 文件 ,修改 default_asides
打开 octopress\_config.yml 文件,修改里面的 default_asides 这一行,将 asides/category_list.html 添加进去。
default_asides: [asides/category_list.html, ......]
这里可以修改侧边栏的顺序
ok
没有正确路径或权限上传,push
代码如下:
dong@Ubuntu:~/octopress$ git push origin source
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
打开文件~/octopress/.git/config,查看
[remote "origin"]
url = git@github.com:haydnyau/haydnyau.github.io.git
我是改了几次,com.git和io.git搞错了
Octopress 3.0 脚本运行 Build Preview Deploy Push-posts .sh文件
preview.sh代码
#!/bin/sh
cd /home/dong/haydnyau
jekyll build #生成
jekyll serve
deploy.sh代码
#!/bin/sh
cd /home/dong/haydnyau
jekyll build
octopress deploy
(不行,这个会造成有些blog页面头尾显示不全)发布,并上传/_posts/源文件,deploy.sh 代码
#!/bin/sh
cd /home/dong/haydnyau
jekyll build
mv _posts/ _site/
octopress deploy
mv _site/_posts/ .
注意这个点 “.”
. 或者 ./ 表示当前目录
更改了文件_templates/post,以后若出错改回来
更改了/home/dong/haydnyau/_templates/post 增加了:
categories:
ps: {}里面有代码:
categories: {{ categories }}
因为格式问题没有显示,参见原文件
创建octopress3.0简单说明
注意,下面的有些步骤不适合
先到jekyll官网,用它的方法安装好本地博客,再看几个octopress3.0的教程,比如官方github的和博文1,Octopress 3 Arrives to Make Blog Generation Crazy Simple ,安装octopress,用它来上传blog,结合下面的前面几步,git,rvm,ruby,bundler,bundle install(or bundle)
重装octopress 2.0 博客失败
很多新旧的软件,依赖,都不兼容了
算了,世界在发展,有的旧事物必然被淘汰
毕竟连作者都不维护了
而且连3.0都不维护了
博文1,Octopress 3 Arrives to Make Blog Generation Crazy Simple