Browse Source

Remove config.yml and add sitemap, robots.

zhixin 11 years ago
parent
commit
01810a564d
4 changed files with 41 additions and 1 deletions
  1. 8 0
      docs/_config.yml
  2. 1 1
      docs/_plugins/markdown-tag.rb
  3. 9 0
      docs/robots.txt
  4. 23 0
      docs/sitemap.xml

+ 8 - 0
docs/_config.yml

@@ -10,6 +10,14 @@ highlighter: rouge
 # Permalinks
 permalink: pretty
 
+# Server
+source:           docs
+destination:      _gh_pages
+host:             0.0.0.0
+port:             4000
+url:              http://bootstrap-table.wenzhixin.net.cn
+encoding:         UTF-8
+
 # Languages
 languages: ["en", "zh-cn", "fr"]
 languages_string: ["English", "简体中文", "French"]

+ 1 - 1
docs/_plugins/markdown-tag.rb

@@ -11,7 +11,7 @@ module Jekyll
     end
  
     def render(context)
-      tmpl = File.read File.join Dir.pwd, "_includes", @text
+      tmpl = File.read File.join context.registers[:site].source, "_includes", @text
       site = context.registers[:site]
       converter = site.getConverterImpl(Jekyll::Converters::Markdown)
       tmpl = (Liquid::Template.parse tmpl).render site.site_payload

+ 9 - 0
docs/robots.txt

@@ -0,0 +1,9 @@
+---
+---
+
+# www.robotstxt.org/
+
+# Allow crawling of all content
+User-agent: *
+Disallow:
+Sitemap: {{ site.url }}/sitemap.xml

+ 23 - 0
docs/sitemap.xml

@@ -0,0 +1,23 @@
+---
+---
+
+
+<?xml version="1.0" encoding="UTF-8"?>
+<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
+    <url>
+        <loc>{{ site.url }}/</loc>
+        <lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
+        <changefreq>daily</changefreq>
+        <priority>1.0</priority>
+    </url>
+    {% for page in site.html_pages %}
+    {% if page.layout != "home" %}
+    <url>
+        <loc>{{ site.url }}{{ page.url }}</loc>
+        <lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
+        <changefreq>weekly</changefreq>
+        <priority>0.7</priority>
+    </url>
+    {% endif %}
+    {% endfor %}
+</urlset>