diff --git a/_config.yml b/_config.yml index 68d2845..0dec88c 100644 --- a/_config.yml +++ b/_config.yml @@ -95,6 +95,18 @@ defaults: type: "pages" values: type: "page" + - + scope: + path: "/feed/*.xml" + values: + sitemap: + exclude: true + - + scope: + path: "/feed/**/*.xml" + values: + sitemap: + exclude: true # Custom Theme Config xaymar: @@ -141,7 +153,6 @@ xaymar: identifier: 'xaymars-blog' url: 'https://www.xaymar.com:pageurl' - ############################################################ # Jekyll-feed feed: @@ -154,6 +165,15 @@ feed: tags: path: "/feed/tag/" +############################################################ +# sitemap +sitemap: + exclude: + - "sitemap.xml" + - "feed.xml" + - "/feed/" + - "site.css.map" + ############################################################ # Site configuration for the Jekyll 3 Pagination Gem # The values here represent the defaults if nothing is set diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 0000000..a21c296 --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,65 @@ +--- +layout: null +sitemap: + exclude: true +--- + + + + {% for post in site.posts %} + {% unless post.published == false %} + + {{ site.url }}{{ post.url }} + {% if post.sitemap.lastmod %} + {{ post.sitemap.lastmod | date: "%Y-%m-%d" }} + {% elsif post.date %} + {{ post.date | date_to_xmlschema }} + {% else %} + {{ site.time | date_to_xmlschema }} + {% endif %} + {% if post.sitemap.changefreq %} + {{ post.sitemap.changefreq }} + {% else %} + monthly + {% endif %} + {% if post.sitemap.priority %} + {{ post.sitemap.priority }} + {% else %} + 0.5 + {% endif %} + + {% endunless %} + {% endfor %} + {% for page in site.pages %} + {% assign skip = false %} + {% for path in site.sitemap.exclude %} + {% assign path_len = path | size %} + {% assign test = page.name | slice: 0, path_len %} + {% if test == path %} + {% assign skip = true %} + {% endif %} + {% endfor %} + {% unless skip == true or page.sitemap.exclude == true %} + + {{ site.url }}{{ page.url | remove: "index.html" }} + {% if page.sitemap.lastmod %} + {{ page.sitemap.lastmod | date: "%Y-%m-%d" }} + {% elsif page.date %} + {{ page.date | date_to_xmlschema }} + {% else %} + {{ site.time | date_to_xmlschema }} + {% endif %} + {% if page.sitemap.changefreq %} + {{ page.sitemap.changefreq }} + {% else %} + monthly + {% endif %} + {% if page.sitemap.priority %} + {{ page.sitemap.priority }} + {% else %} + 0.3 + {% endif %} + + {% endunless %} + {% endfor %} + \ No newline at end of file