Giter VIP home page Giter VIP logo

yorekliu.github.io's Introduction

Yorek's Blog

前往博客🚀🚀🚀

基于Material for MkDocs

  • mkdocs分支
    博客的源文件,包括CNAME等
  • master分支
    生成的网站源文件
  1. 在mkdocs分支上进行blog的写作
  2. 调用serve.sh脚本进行本地预览
  3. 写作完毕后先提交到repo
  4. 然后调用根目录的deploy.sh脚本进行发布,构建的产物将会push到master分支。

常见问题

  1. 操作流程

    • fork项目或者随便怎么样
    • 安装python环境、pip、并配置好python的环境变量,之后跟随Getting started进行安装
    • 目前使用了git-revision-date-localizedmkdocs-minify-plugin两个插件,使用pip install <插件名>安装上述插件
    • 在mkdocs分支上写作,执行mkdocs serve --dirtyreload进行写作时的动态实时预览
    • 写完之后commit并push一下,随后调用deploy.sh脚本进行博客的发布
  2. FAQ

若出现如下报错

Config value: 'plugins'. Error: The "git-revision-date-localized" plugin is not installed

请查阅对应repo上面的安装介绍https://github.com/timvink/mkdocs-git-revision-date-localized-plugin
目前来看,安装mkdocs-git-revision-date-localized-plugin即可

下面的问题同样是插件问题

Config value: 'plugins'. Error: The "minify" plugin is not installed

执行pip install mkdocs-minify-plugin安装插件

执行mkdocs serve时出错

ERROR   -  Error reading page 'android\3rd-library\glide1.md': 'NoneType' object has no attribute 'end'
...
markdown\htmlparser.py", line 95, in line_offset
    return re.match(r'([^\n]*\n){{{}}}'.format(self.lineno-1), self.rawdata).end()
AttributeError: 'NoneType' object has no attribute 'end'

仔细看堆栈时markdown插件报错,将其降级到3.2.1版本即可:

pip uninstall markdown
pip install -v markdown==3.2.1

下面命令是常用的pip命令:

## 列出所有安装的包
$ pip list
Package                                   Version
----------------------------------------- ----------
Babel                                     2.9.0
click                                     7.1.2
future                                    0.18.2
gitdb                                     4.0.5
GitPython                                 3.1.12
htmlmin                                   0.1.12
importlib-metadata                        3.4.0
Jinja2                                    2.11.2
joblib                                    1.0.0
jsmin                                     2.2.2
livereload                                2.6.3
lunr                                      0.5.8
Markdown                                  3.2.1
MarkupSafe                                1.1.1
mkdocs                                    1.1.2
mkdocs-git-revision-date-localized-plugin 0.8
mkdocs-material                           6.2.5
mkdocs-material-extensions                1.0.1
mkdocs-minify-plugin                      0.4.0
nltk                                      3.5
pip                                       21.0
Pygments                                  2.7.4
pymdown-extensions                        8.1
pytz                                      2020.5
PyYAML                                    5.3.1
regex                                     2020.11.13
setuptools                                47.1.0
six                                       1.15.0
smmap                                     3.0.4
tornado                                   6.1
tqdm                                      4.56.0
typing-extensions                         3.7.4.3
zipp                                      3.4.0

## 输出指定包的相关信息
$ pip show markdown
Name: Markdown
Version: 3.2.1
Summary: Python implementation of Markdown.
Home-page: https://Python-Markdown.github.io/
Author: Manfred Stienstra, Yuri takhteyev and Waylan limberg
Author-email: [email protected]
License: BSD License
Location: c:\users\liuya\appdata\local\programs\python\python37\lib\site-packages
Requires: setuptools

yorekliu.github.io's People

Contributors

yorekliu avatar dependabot[bot] avatar

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.