added sitemap, rss feeds
This commit is contained in:
parent
9c7fe3bce4
commit
518533fde0
@ -15,7 +15,7 @@ class DocType():
|
|||||||
"""save file by its name"""
|
"""save file by its name"""
|
||||||
self.doc.name = website.utils.page_name(self.doc.title)
|
self.doc.name = website.utils.page_name(self.doc.title)
|
||||||
|
|
||||||
def on_update(self):
|
def validate(self):
|
||||||
"""write/update 'Page' with the blog"""
|
"""write/update 'Page' with the blog"""
|
||||||
p = website.utils.add_page(self.doc.title)
|
p = website.utils.add_page(self.doc.title)
|
||||||
|
|
||||||
|
@ -5,84 +5,106 @@
|
|||||||
{
|
{
|
||||||
'creation': '2012-01-27 12:24:03',
|
'creation': '2012-01-27 12:24:03',
|
||||||
'docstatus': 0,
|
'docstatus': 0,
|
||||||
'modified': '2012-01-27 12:24:03',
|
'modified': '2012-02-07 12:59:01',
|
||||||
'modified_by': 'Administrator',
|
'modified_by': u'Administrator',
|
||||||
'owner': 'Administrator'
|
'owner': u'Administrator'
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocType
|
# These values are common for all DocType
|
||||||
{
|
{
|
||||||
'colour': 'White:FFF',
|
'_last_update': u'1327647244',
|
||||||
|
'colour': u'White:FFF',
|
||||||
'doctype': 'DocType',
|
'doctype': 'DocType',
|
||||||
'module': 'Website',
|
'module': u'Website',
|
||||||
'name': '__common__',
|
'name': '__common__',
|
||||||
'section_style': 'Simple',
|
'section_style': u'Simple',
|
||||||
'show_in_menu': 0,
|
'show_in_menu': 0,
|
||||||
'version': 1
|
'version': 2
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocField
|
# These values are common for all DocField
|
||||||
{
|
{
|
||||||
'doctype': 'DocField',
|
'doctype': u'DocField',
|
||||||
'name': '__common__',
|
'name': '__common__',
|
||||||
'parent': 'Blog',
|
'parent': u'Blog',
|
||||||
'parentfield': 'fields',
|
'parentfield': u'fields',
|
||||||
'parenttype': 'DocType',
|
'parenttype': u'DocType'
|
||||||
'permlevel': 0
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocPerm
|
# These values are common for all DocPerm
|
||||||
{
|
{
|
||||||
'create': 1,
|
'doctype': u'DocPerm',
|
||||||
'doctype': 'DocPerm',
|
|
||||||
'name': '__common__',
|
'name': '__common__',
|
||||||
'parent': 'Blog',
|
'parent': u'Blog',
|
||||||
'parentfield': 'permissions',
|
'parentfield': u'permissions',
|
||||||
'parenttype': 'DocType',
|
'parenttype': u'DocType',
|
||||||
'permlevel': 0,
|
'read': 1
|
||||||
'read': 1,
|
|
||||||
'write': 1
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocType, Blog
|
# DocType, Blog
|
||||||
{
|
{
|
||||||
'doctype': 'DocType',
|
'doctype': 'DocType',
|
||||||
'name': 'Blog'
|
'name': u'Blog'
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
# DocPerm
|
||||||
{
|
{
|
||||||
'doctype': 'DocPerm',
|
'create': 1,
|
||||||
'role': 'Website Manager'
|
'doctype': u'DocPerm',
|
||||||
|
'permlevel': 0,
|
||||||
|
'role': u'Website Manager',
|
||||||
|
'write': 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
# DocPerm
|
||||||
{
|
{
|
||||||
'doctype': 'DocPerm',
|
'create': 1,
|
||||||
'role': 'Blogger'
|
'doctype': u'DocPerm',
|
||||||
|
'permlevel': 0,
|
||||||
|
'role': u'Blogger',
|
||||||
|
'write': 1
|
||||||
|
},
|
||||||
|
|
||||||
|
# DocPerm
|
||||||
|
{
|
||||||
|
'doctype': u'DocPerm',
|
||||||
|
'permlevel': 1,
|
||||||
|
'role': u'All'
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
# DocField
|
||||||
{
|
{
|
||||||
'doctype': 'DocField',
|
'doctype': u'DocField',
|
||||||
'fieldname': 'title',
|
'fieldname': u'title',
|
||||||
'fieldtype': 'Data',
|
'fieldtype': u'Data',
|
||||||
'label': 'Title'
|
'label': u'Title',
|
||||||
|
'permlevel': 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
# DocField
|
||||||
{
|
{
|
||||||
'doctype': 'DocField',
|
'doctype': u'DocField',
|
||||||
'fieldname': 'published',
|
'fieldname': u'published',
|
||||||
'fieldtype': 'Check',
|
'fieldtype': u'Check',
|
||||||
'label': 'Published'
|
'label': u'Published',
|
||||||
|
'permlevel': 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
# DocField
|
||||||
{
|
{
|
||||||
'doctype': 'DocField',
|
'doctype': u'DocField',
|
||||||
'fieldname': 'content',
|
'fieldname': u'content',
|
||||||
'fieldtype': 'Code',
|
'fieldtype': u'Code',
|
||||||
'label': 'Content'
|
'label': u'Content',
|
||||||
|
'permlevel': 0
|
||||||
|
},
|
||||||
|
|
||||||
|
# DocField
|
||||||
|
{
|
||||||
|
'doctype': u'DocField',
|
||||||
|
'fieldname': u'content_html',
|
||||||
|
'fieldtype': u'Text',
|
||||||
|
'label': u'Preview',
|
||||||
|
'permlevel': 1
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -8,6 +8,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="web-side-section">
|
<div class="web-side-section">
|
||||||
<p><a href="#!blog">All Blogs</a></p>
|
<p><a href="#!blog">All Blogs</a></p>
|
||||||
|
<h4>Subscribe</h4>
|
||||||
|
<p>
|
||||||
|
<img src="images/feed.png" style="margin-right: 4px; margin-bottom: -4px">
|
||||||
|
<a href="rss.xml" target="_blank">RSS Feed</a>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div style="clear: both"></div>
|
<div style="clear: both"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -5,9 +5,17 @@
|
|||||||
<div class="web-main-section">
|
<div class="web-main-section">
|
||||||
</div>
|
</div>
|
||||||
<div class="web-side-section">
|
<div class="web-side-section">
|
||||||
|
<!-- for later
|
||||||
<h4>Get Updates</h4>
|
<h4>Get Updates</h4>
|
||||||
|
<p>
|
||||||
<input name="blog-subscribe">
|
<input name="blog-subscribe">
|
||||||
<button class="btn" id="blog-subscribe">Subscribe</button>
|
<button class="btn" id="blog-subscribe">Subscribe</button>
|
||||||
|
</p>-->
|
||||||
|
<h4>Subscribe</h4>
|
||||||
|
<p>
|
||||||
|
<img src="images/feed.png" style="margin-right: 4px; margin-bottom: -4px">
|
||||||
|
<a href="rss.xml" target="_blank">RSS Feed</a>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div style="clear: both"></div>
|
<div style="clear: both"></div>
|
||||||
</div>
|
</div>
|
||||||
|
BIN
images/feed.png
Executable file
BIN
images/feed.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 691 B |
18
rss.xml
Executable file
18
rss.xml
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import cgi, cgitb, os, sys
|
||||||
|
cgitb.enable()
|
||||||
|
|
||||||
|
# import libs
|
||||||
|
sys.path.append('lib/py')
|
||||||
|
|
||||||
|
import webnotes
|
||||||
|
import webnotes.auth
|
||||||
|
|
||||||
|
if __name__=='__main__':
|
||||||
|
webnotes.http_request = webnotes.auth.HTTPRequest()
|
||||||
|
from webnotes.cms import feed
|
||||||
|
xml = feed.generate()
|
||||||
|
print 'Content-Type: text/xml'
|
||||||
|
print
|
||||||
|
print xml
|
19
sitemap.xml
Executable file
19
sitemap.xml
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import cgi, cgitb, os, sys
|
||||||
|
cgitb.enable()
|
||||||
|
|
||||||
|
# import libs
|
||||||
|
sys.path.append('lib/py')
|
||||||
|
|
||||||
|
import webnotes
|
||||||
|
import webnotes.auth
|
||||||
|
|
||||||
|
if __name__=='__main__':
|
||||||
|
webnotes.http_request = webnotes.auth.HTTPRequest()
|
||||||
|
domain = os.environ.get('HTTP_HOST')
|
||||||
|
protocol = os.environ.get('HTTPS') and 'https://' or 'http://'
|
||||||
|
from webnotes.cms import sitemap
|
||||||
|
print 'Content-Type: text/xml'
|
||||||
|
print
|
||||||
|
print sitemap.generate(protocol + domain + '/')
|
@ -1 +1 @@
|
|||||||
359
|
360
|
Loading…
x
Reference in New Issue
Block a user