[Moin-devel] CVS: MoinMoin Page.py,1.103,1.104 wikiutil.py,1.76,1.77

J?rgen Hermann jhermann at users.sourceforge.net
Thu Feb 14 14:18:14 EST 2002


Update of /cvsroot/moin/MoinMoin
In directory usw-pr-cvs1:/tmp/cvs-serv13824

Modified Files:
	Page.py wikiutil.py 
Log Message:
Add meta keywords generated from page title (Sunir's idea)


Index: Page.py
===================================================================
RCS file: /cvsroot/moin/MoinMoin/Page.py,v
retrieving revision 1.103
retrieving revision 1.104
diff -C2 -r1.103 -r1.104
*** Page.py	13 Feb 2002 21:13:52 -0000	1.103
--- Page.py	14 Feb 2002 22:17:49 -0000	1.104
***************
*** 47,55 ****
  
  
!     def split_title(self):
          """ Return a string with the page name split by spaces, if
              the user wants that.
          """
!         if not user.current.wikiname_add_spaces: return self.page_name
      
          # look for the end of words and the start of a new word,
--- 47,55 ----
  
  
!     def split_title(self, force=0):
          """ Return a string with the page name split by spaces, if
              the user wants that.
          """
!         if not force and not user.current.wikiname_add_spaces: return self.page_name
      
          # look for the end of words and the start of a new word,
***************
*** 58,66 ****
  
  
!     def _split_title_py16(self):
          """ Return a string with the page name split by spaces, if
              the user wants that.
          """
!         if not user.current.wikiname_add_spaces: return self.page_name
      
          # Provided by Magnus Lyckå
--- 58,66 ----
  
  
!     def _split_title_py16(self, force=0):
          """ Return a string with the page name split by spaces, if
              the user wants that.
          """
!         if not force and not user.current.wikiname_add_spaces: return self.page_name
      
          # Provided by Magnus Lyckå

Index: wikiutil.py
===================================================================
RCS file: /cvsroot/moin/MoinMoin/wikiutil.py,v
retrieving revision 1.76
retrieving revision 1.77
diff -C2 -r1.76 -r1.77
*** wikiutil.py	13 Feb 2002 21:13:52 -0000	1.76
--- wikiutil.py	14 Feb 2002 22:17:49 -0000	1.77
***************
*** 395,398 ****
--- 395,406 ----
          user_head = user_head + config.html_head_queries
      print "<html><head>%s<title>%s - %s</title>" % (user_head, cgi.escape(text), config.sitename)
+ 
+     # add keywords from page title
+     if keywords.has_key('pagename'):
+         words = Page(keywords['pagename']).split_title(force=1)
+         print '<meta name="KEYWORDS" content="%s">' % (
+             cgi.escape(string.replace(words, ' ', ', '), 1))
+ 
+     # link to CSS stylesheet
      css_url = user.current.valid and user.current.css_url or config.css_url
      if css_url and string.lower(css_url) != "none":





More information about the Moin-devel mailing list