Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added robots and sitemap #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pages/robots/page-robots.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
template: robots
protocol: all
published: true
name: Robots
url: /robots
---
# robots.txt for http://www.example.com/
User-agent: *
Disallow: /cyberworld/map/ # This is an infinite virtual URL space
Disallow: /tmp/ # these will soon disappear
Disallow: /foo.html
Sitemap: https://storename.lemonstand.com/sitemap
46 changes: 46 additions & 0 deletions pages/sitemap/page-sitemap.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
action: 'shop:products'
template: xml
protocol: all
published: true
name: Sitemap
url: /products.xml
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for product in products %}
<url>
{% set page_url = "https:#{site_url('/')}product/#{product.url_name}" %}
<loc>{{ page_url }}</loc>
<lastmod>{{ product.updated_at|date("Y-m-d\\TH:i:sP") }}</lastmod>
</url>
{% endfor %}

{% for post in cmsContent('blog') %}
<url>
{% set page_url = "#{post.permalink}" %}
<loc>{{ page_url }}</loc>
<lastmod>{{ post.published_on | date("Y-m-d\\TH:i:sP") }}</lastmod>
</url>
{% endfor %}

{% for url, code in pages %}
{% set page_url = "https:#{site_url('/')}#{url}" %}
{% if '/:' not in page_url %}
<url>
<loc>{{ page_url | replace({"m//": "m/"}) }}</loc>
<lastmod>{{ page.published_on | date("Y-m-d\\TH:i:sP") }}</lastmod>
</url>
{% endif %}
{% endfor %}

{% for category in categories %}
<url>
{% set page_url = "https:#{site_url('/')}/category/#{category.url_name}" %}
<loc>{{ page_url | replace({"m//": "m/"}) }}</loc>
<lastmod>{{ post.published_on | date("Y-m-d\\TH:i:sP") }}</lastmod>
</url>
{% endfor %}
</urlset>


4 changes: 4 additions & 0 deletions templates/robots.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
content_type: 'text/plain; charset=utf-8'
---
{{ page() }}
4 changes: 4 additions & 0 deletions templates/xml.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
content_type: 'text/xml; charset=utf-8'
---
{{ page() }}