[Slashdotjp-dev 1543] [1074] * Add HTML "<meta name=description>" into sevaral pages

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 3月 16日 (月) 20:36:56 JST


Revision: 1074
          http://svn.sourceforge.jp/view?root=slashdotjp&view=rev&rev=1074
Author:   tach
Date:     2009-03-16 20:36:56 +0900 (Mon, 16 Mar 2009)

Log Message:
-----------
 * Add HTML "<meta name=description>" into sevaral pages
   - index.pl: add data "meta_desc" and title of first 5 articles

Modified Paths:
--------------
    slashjp/trunk/debian/changelog
    slashjp/trunk/themes/slashcode/htdocs/index.pl


-------------- next part --------------
Modified: slashjp/trunk/debian/changelog
===================================================================
--- slashjp/trunk/debian/changelog	2009-03-16 07:39:30 UTC (rev 1073)
+++ slashjp/trunk/debian/changelog	2009-03-16 11:36:56 UTC (rev 1074)
@@ -2,10 +2,10 @@
 
   * Add HTML "<meta name=description>" into sevaral pages
     - article.pl: already inserted, change content to introtext
+    - index.pl: add data "meta_desc" and title of first 5 articles
 
+ -- Taku YASUI <tach****@osdn*****>  Mon, 16 Mar 2009 11:36:00 +0000
 
- -- Taku YASUI <tach****@osdn*****>  Mon, 16 Mar 2009 07:36:54 +0000
-
 slash (2.5.0.233-7) unstable; urgency=low
 
   * Fix slow query on getStoryByTime()

Modified: slashjp/trunk/themes/slashcode/htdocs/index.pl
===================================================================
--- slashjp/trunk/themes/slashcode/htdocs/index.pl	2009-03-16 07:39:30 UTC (rev 1073)
+++ slashjp/trunk/themes/slashcode/htdocs/index.pl	2009-03-16 11:36:56 UTC (rev 1074)
@@ -270,6 +270,11 @@
 #	$user->{currentSection} = $section->{section};
 	Slash::Utility::Anchor::getSkinColors();
 
+	my $meta_desc = getData('meta_desc');
+	foreach my $s (@{$stories}[0 .. 4]) {
+		$meta_desc .= $slashdb->getStory($s->{stoid}, 'title') . "\x{3002}" if ($s->{stoid});
+	}
+
 	# displayStories() pops stories off the front of the @$stories array.
 	# Whatever's left is fed to displaySlashboxes for use in the
 	# index_more block (aka Older Stuff).
@@ -292,7 +297,7 @@
 	);
 
 	my $title = getData('head', { skin => $skin_name });
-	header({ title => $title, link => $linkrel }) or return;
+	header({ title => $title, link => $linkrel }, '', { meta_desc => $meta_desc }) or return;
 
 	if ($form->{remark}
 		&& $user->{is_subscriber}



Slashdotjp-dev メーリングリストの案内
Back to archive index