billryan / algorithm-exercise

Data Structure and Algorithm notes. 数据结构与算法/leetcode/lintcode题解/

Home Page:https://algorithm.yuanbin.me

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sitemap generation

billryan opened this issue · comments

Sitemap.xml is an optimization for search engine. Gitbook does not provide sitemap support now. I have little knowledge about Javascript, so I wrote a sitemap generation helper with Python.

Implementation details

  1. git ls-tree and git log, we can get the files in git repo and its latest modified time.
  2. filter .md source files and exclude/replace some special markdown files.
  3. replace .md with .html.
  4. generate sitemap.xml with Jinja2 template

algorithm-exercise/sitemap_gen.py

A better implementation fixed in GitbookIO/plugin-sitemap#3