åèªããã¬ããïŒ ããªãã¯åæªã§ããïŒ
ã©ã®ãããªããæ¯ãç§ãã¡ã«ããªãããããããŸãããïŒ
©ãããŒãã»ã¯ãªã¹ãã¹
奜ããªãã®ããããŸãããããã¯ããªãã®æã«æã€ã®ãçŽ æŽãããã§ãã圌ãã¯ã·ã³ãã«ã§ã圌ãã¯ç解ã§ããŸãã 圌ãã®å šçæã¯éããŸãããã圌ãèªèº«ã¯å¿åŽã«æ²ãã§ããããäœåºŠãäœåºŠã圌ãã«æ»ã£ãŠããŸããã ããã¯ããããªã¢ã«ã¯ãŒã«ãã®ãªããžã§ã¯ãã ãã«é©çšãããããã§ã¯ãããŸããã ã¢ã»ã³ãã©ãŒã§æžãããšã«èå³ãããããã°ã©ããŒããŸãã¯ãã·ã³ã³ãŒãã«çŽæ¥èå³ãããããã°ã©ããŒã¯ãåžžã«ã·ã³ãã«ããããããªãºã ãã¬ããã奜ãã§ãã 幞ããªããšã«ãããã¯ã¢ã»ã³ãã©ãŒã®æ¹ãç°¡åã§ããã£ãšè¥ãã§ãã
SSIãã¯ãããžãŒã¯ãã³ã³ãã³ãã®äžéšããµãŒããŒã«ãã£ãŠãã®å Žã§å«ãŸããå¥ã®ãã¡ã€ã«ã«åãåºããããµã€ããäœæããããšãäžåºŠã«èš±å¯ããŸããïŒãããŠçŸåšèš±å¯ããŸãïŒã éåžžãããããŒããµã€ãããŒãããã¿ãŒã®å¥ã ã®ãã¡ã€ã«ãåãåºãããŸããã ã·ã³ãã«ãªæ§é ã®éåžžã®ãµã€ãã§ã¯ãããã§ååã§ããã å©ç¹ã¯ãããã°ã©ãã³ã°ãªãã§CMSæ©èœãå®è£ ãããã·ã³ãã«ã§é«éãã€ä¿¡é Œæ§ã®é«ããœãªã¥ãŒã·ã§ã³ã䜿çšãããããšã§ãã ãšã«ãããæå°éã®æè¡ã¹ã¿ãã¯ã¯å¥œå¥å¿isçã§ãã
ãã€ã³ã¯ã«ãŒãžã§ã³ãã®å žåçãªãµã€ãããŒãžã¯æ¬¡ã®ããã«ãªããŸããã
<html> <head> <title> </title> </head> <body> <div id="header"><!--#include virtual="/header.html" --></div> <div id="sidebar"><!--#include virtual="/sidebar.html" --></div> <div id="footer"><!--#include virtual="/footer.html" --></div> </body> </html>
ããããå€ãã®ããŒãžã§äœæ¥ãããšãäžäŸ¿ãçããŸããã CMSã¯ãããã€ãã®è³ªåãåé€ããä»ã®è³ªåãæããããããã§ãã èå³æ·±ã解決çã¯ãããŒã¿ããŒã¹ãåäžã®htmlãã¡ã€ã«ã®åœ¢åŒã§ä¿åããããšã§ãããŒãžã¯ã¿ã°H1ãH2ãH3ã§ç€ºãããŠããŸããã ãã®å ŽåãããŒãžã®ãã¹ãã§æå®ãããã¿ã°ã®çªå·ã CMSimple cmsimple.orgã§ãã®ã¢ã€ãã¢ã芳å¯ããŸãããã誰ãã以åã«ãããæãã€ããå¯èœæ§ããããŸãã ããããããã®ã¢ã€ãã¢ã«åºã¥ããŠå€ãã®CMSãäœæãããŠããŸãïŒãããŠãç§ã¯èªåã§è©ŠããŠã¿ãŸãããããã§ã«ããã«ãããŸãïŒã
ãã®ãœãªã¥ãŒã·ã§ã³ã®äž»ãªæ¬ ç¹ã¯ã倧ããªhtmlãã¡ã€ã«ãè£è¿ãå¿ èŠãããããšã§ãã ã€ã³ããã¯ã¹ãäœæããæ©äŒã¯ãã¡ãããããŸãããæŠããŠããã¯ããã»ã©èå³æ·±ããã®ã§ã¯ãããŸããã 1ã€ã®ãã¡ã€ã«ã§æ°åã®èšäºãç·šéããããšãšãæ°åã®èšäºãç·šéããããšã®1ã€ã§ãã ãã®ãããªãšã³ãžã³ã¯å°èŠæš¡ãªãµã€ãã«é©ããŠããããšã¯åœç¶ã®ããšãšèããŠãããSDLãè¡æãã¯é¢ä¿ãããŸãããæè¡ã«ã€ããŠè©±ãåã£ãŠããŸãã
HTMLã®SSIãšDB
ãã¡ãã·ã§ã³ã®ãã³ãã¯äœã§ããïŒ æã¯ããããïŒ
ãããã¯ã®ç¥æ¯ã®ãã¬ããµãŒã¯å®¶ã«ç»ããŸãïŒ
SSIãæãåºããŠããã®ãã¯ãããžãŒã䜿çšããŠåæ§ã®ã¢ãããŒããå®è£ ããããšã¯å¯èœã§ããïŒ ããã«èšã£ãŠãã£ãã htmlãã¡ã€ã«ã§ãå€ããµã€ãããŒã¿ããŒã¹ã«ãªãå€æ°ãäœæã§ããŸãã
<!--#set var="db" value="Your html db">
ãã®ããŒã¿ããŒã¹ããéžæãè¡ãæ¹æ³ãåŠã¶ããšã¯æ®ã£ãŠããŸãã ãããè¡ãã«ã¯ãã¯ãšãªæååããµã€ãã«ä¿åããQUERY_STRINGå€æ°ã䟿å©ã§ãã htaccessã§revitesãèšå®ããæ£èŠè¡šçŸããµããŒãããæ¡ä»¶åŒæ©èœã䜿çšããããšã§ïŒããŒãããžãŒã«ã€ããŠã¯ç³ãèš³ãããŸããïŒããµãŒããŒã¯ããŒã¿ããŒã¹ããç®çã®èšäºãéžæã§ããŸãã
æ®å¿µãªããã SSIã«ã¯ã«ãŒãããªããããããŒã¿ããŒã¹ããœãŒãããŠããŒãžã®ãªã¹ããå«ããµã€ãããŒãäœæããããšã¯ã§ããŸãããæåã§è¡ãå¿ èŠããããŸãã äžäŸ¿ã§ããããããã¯SSIã®å¶éã§ãã ãŸãã次ã®ãããªãµã€ãã®ã³ã³ãã³ããå€æ°ã«å ¥ããæ©èœãæ¬åœã«äžè¶³ããŠããŸããã
<!--#set var="db" file="db.html">
ãã®ãããªãªãã·ã§ã³ã䜿çšãããšãããŒã¿ããŒã¹ãå¥ã®ãã¡ã€ã«ã«é 眮ã§ãããããããšã³ãžã³ãã®ã³ãŒããããã¯ãªãŒã³ã§èªã¿ããããªããŸãã ãããã£ãŠãã麺ã³ãŒãããç§ãã¡ã®ãã¹ãŠã§ãã
å®éšã®ããã«ãææ¡ããããœãªã¥ãŒã·ã§ã³ãè©Šãããã®ç°¡åãªãµã€ããäœæããããšã«ããŸããã éžæãããããŒãã¯ãã«ã³ãã®ã©ãã³ã¢ã¡ãªã«ãã³ã¹ã§ãïŒä»¥äžã®ãœãŒã¹ïŒã 第äžå°è±¡-ãµã€ãã¯é«éã§ãã ããšã³ãžã³ããšããŒã¿ããŒã¹ã®ãµã€ãºã¯10ãããã€ãããããã«è¶ ãããããããã¯é©ãããšã§ã¯ãããŸããã ããããã©ã¹ãšããŠæžããŸãã ããã«ãããŒã¿ããŒã¹ã®ãµã€ãºããããšãã°ã¡ã¬ãã€ãã«ãªããŸã§ãããã¯ãã®ãŸãŸã§ãã åæã«ãã¡ãã¥ãŒãæåã§äœæããå¿ èŠãããããã倧èŠæš¡ãªãµã€ãã®ã¹ã«ã«ããããã£ãšæ©ãåæ¢ããŸãã ããã«ãããŒã¿ããŒã¹å ã®äœããã³ããŒããå ŽåãäºéåŒçšç¬ŠãåäžåŒçšç¬Šã«çœ®ãæããããšãå¿ããªãã§ãã ããã
ç°åžžã§è€éãªãã®ã¯ãããŸããã ããã¯å¯èœãªè§£æ±ºçã§ãã ãªãã€ãã®ãããã§ãæ€çŽ¢ãšã³ãžã³ãããŒãžå šäœãã€ã³ããã¯ã¹ããã®ã§ã¯ãªããåå¥ã«ã€ã³ããã¯ã¹ãä»ããããšãéèŠã§ãã ããªãã¯ç¢ºãã«ããã§èª°ãé©ããªãã§ããããããããèšåãã䟡å€ããããŸãã ãŸãããµãŒããŒã«å°ããªè² è·ããã©ã¹ãšããŠæžã蟌ã¿ãŸãã å°èŠæš¡ãªãµã€ãã«ãšã£ãŠæãéèŠãªèŠå ã§ã¯ãããŸããããããããŠãã ããã èšè¿°åãåºå®ãããå Žå-ãããåé¡ã§ã¯ãããŸãããèšäºãšã³ããªã®ããŒã¯ã¢ããã«å¥ã®ã¿ã°ãå ¥åããã ãã§ãã
åäœäŸã確èªããã«ã¯ããããã®ãã¡ã€ã«ããµã€ãã§äœæããå¿ èŠããããŸãã
.htaccess
AddDefaultCharset utf-8 AddType text/html .html AddHandler server-parsed .html DirectoryIndex rumba.shtml?query=start RewriteEngine on RewriteRule ^([a-zA-Z0-9-]+)\.html$ rumba.shtml?query=$1
rumba.shtml
<!--#set var="rumba_title" value="" --> <!--#set var="rumba_content" value="" --> <!--#set var="rumba_menu" value="" --> <!--#set var="rumba_error_title" value=" " --> <!--#set var="rumba_error_text" value="<h2>404</h2> " --> <!--#set var="rumba_menu" value="<ul> <li><a href='./'></a></li> <li><a href='./history.html'> </a></li> <li><a href='./cha-cha-cha.html'> --</a></li> <li><a href='./types.html'> </a></li> <li><a href='./emotion.html'> </a></li> <li><a href='./hits.html'> </a></li> </ul>" --> <!--#set var="rumba_db" value="<articles> <article id='start'> <h2> â </h2> <text> <a href='https://ru.wikipedia.org/wiki/'>Ì</a> (. rumba) â : <ol> <li> , . rumba Guaguanco. rumba Yambu rumba Columbia. , .</li> <li> , . - ( â , , -- ). - .</li> </ol> </text> </article> <article id='history'> <h2> </h2> <text> 19- . «Rumba», , 1807 â «rumboso orquestra», «rumbo» «» ( â «», ). - , '' , . </text> </article> <article id='cha-cha-cha'> <h2> --</h2> <text> <p> --, - , ( , ), . . , , , , (: , , , â ). -- , , , (, , â , â «--» «--»).</p> <p> -- . , , «», , , -- . «Guantanamera» --, .</p> <p> , , . , - , . . , . , .</p> </text> </article> <article id='types'> <h2> </h2> <text> <p> XIX , (Guaguanco), , , . . - - « ».</p> <p>- , . , (Papilote, Mama'buela, Gavilan)</p> <p> , . , â . , . , (clave), , 3-2. , . , . (Rumba Son).</p> </text> </article> <article id='emotion'> <h2> </h2> <text> . , . , « â ». . , â , , . , , , . </text> </article> <article id='hits'> <h2> </h2> <text> <ul> <li>La Media Vuelta â (Eydie Gorme)</li> <li>Manana</li> <li>Cantinero de Cuba</li> <li>Reflection â </li> <li>Fairy tale â </li> <li>Don't Know Why â </li> <li>Falling Into You â Celine Dion</li> <li>When the blue bird sings</li> <li>Gipsy Kings â La Rumba-De Nicolas</li> <li>Gipsy Kings â Una Rumba Por Aqui</li> <li>Gipsy Kings â Rumba Del Stud</li> </ul> </text> </article> </articles>" --> <!--#if expr="$QUERY_STRING = /^query=([a-zA-Z0-9-]+)/" --> <!--#set var="rumba_query" value="$1" --> <!--#if expr="${rumba_db} = /<article id='${rumba_query}'>[\\s\\S]*?<h2>(.*)<\/h2>[\\s\\S]*?<text>([\\s\\S]*?)<\/text>[\\s\\S]*?<\/article>/" --> <!--#set var="rumba_title" value="$1" --> <!--#set var="rumba_r1" value="$1" --> <!--#set var="rumba_r2" value="$2" --> <!--#set var="rumba_content" value="${rumba_content}<h2>${rumba_r1}</h2>${rumba_r2}" --> <!--#else --> <!--#set var="rumba_title" value="${rumba_error_title}" --> <!--#set var="rumba_content" value="${rumba_error_text}" --> <!--#endif --> <!--#else --> <!--#set var="rumba_title" value="${rumba_error_title}" --> <!--#set var="rumba_content" value="${rumba_error_text}2" --> <!--#endif --> <html> <head> <title><!--#echo encoding="none" var="rumba_title" --></title> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <link rel="stylesheet" href="twocolumn.css"> </head> <body> <br/> <div id="header"><h1>- </h1></div> <div id="sidebar"><!--#echo encoding="none" var="rumba_menu" --></div> <div id="content"><!--#echo encoding="none" var="rumba_content" --></div> </body> </html>
twocolumn.css
body { margin: 0 auto; width: 640px; font:17px/20px Arial,Helvetica,sans-serif; overflow-y: scroll; } a { color: #777; } #header { padding: 10px; text-align: center; } #content { margin-left: 230px; } #content h2{ color: #E6B03E; } #sidebar { padding: 10px; background: #B44E29; float: left; width: 180px; } #sidebar ul { padding: 0px; } #sidebar li { padding: 5px; list-style-type: none; list-style-position: inside; } #sidebar a { color: #fff; text-decoration: none; } #sidebar a:hover { color: #ccc; text-decoration: none; }
XMLã®SSIãšDB
äžä¿çãªåœ¢ã®ãã®ãã·ã£ã³ããªã¢ã,ãå£åãä»ãçšçå°ã
é ã®çŽ æŽãããæºåž¯é»è©±ããã£ãŒããã-ãçŽ æŽãããã...
SSIèšèªã®ããããªãºã ã§ã¯ãå€ãã®ããšãæããã«ããããšã¯ã§ããŸããã ããããå€ã«åºãæ¹æ³ã¯ïŒ htmlãèŠãŠå°ãç®ã现ãããšãxhtmlã®ããã«ãªããŸãããç®ãã€ã¶ã£ãŠã¿ããš... SSIãšXMLã亀差ãããããšããŠããããšã«æ°ã¥ããŸããã ãã®ãã©ãŒãããã奜ããªäººãããã°ãæ¿ããå«ããªäººãããŸããããå± å Žæããããã è©ŠããŠã¿ãŸãããïŒ
åã®äŸã®html-baseããxmlãã¡ã€ã«ãäœæããã®ã«2åããããŸãã GoogleãYandexãRamblerã®æ€çŽ¢ãšã³ãžã³ã«ãã£ãŒããéä¿¡ã§ããŸãããMailã¯éä¿¡ã§ããŸããïŒxmlãã¡ã€ã«ã®ã€ã³ããã¯ã¹äœæãéå§ããã«ã¯mail.ruããå§ãããŸãïŒã æ€çŽ¢ãšã³ãžã³ã¯ããã¡ã€ã«ã1ããŒãžãšããŠèªèãããã®ããã«èæ ®ããŸãã å€ãã®ããŒãžããã以åã®ããŒãžã§ã³ã®èŠ³ç¹ããã¯ãããã¯ãã€ãã¹ã§ããå¯èœæ§ãé«ããªããŸãããã·ã³ã°ã«ããŒãžã¢ããªã±ãŒã·ã§ã³ïŒ SPAãŸã㯠1ããŒãžã¢ããªã±ãŒã·ã§ã³ïŒã®æŠå¿µãããããããã®xmlããŒãžã«ã¯çåæš©ããããŸã*ã
ãã ããxmlãã¡ã€ã«ã¯ãµã€ããšããŸã䌌ãŠããªãããã蚪åè ã«ãã®åœ¢åŒã§è¡šç€ºããã®ã¯åççã§ã¯ãããŸããã ããã¯ãXSLTå€æãæ¥ç¶ããå¿ èŠãçããå Žæã§ãã ããã¯éåžžã®xslãã¡ã€ã«ã§ããã以åã®ããŒãžã§ã³ã®ãšã³ãžã³ãšåæ§ã«ãSSIèŠæ±ã䜿çšããŠQUERY_STRINGãä»ããŠåä¿¡ããxmlãã¡ã€ã«ãå€æããŸãã ãã®çµæã蚪åè ã«éŠŽæã¿ã®ãããã¶ã€ã³ããŒãžãäœæãããŸãã ã¯ã©ã€ã¢ã³ãã§XSLTå€æãè¡ãããããšãã€ãŸãã ãµãŒããŒã§ã¯ãªããã©ãŠã¶ã«ãã£ãŠäœæãããŸãã
ãã¯ã³ã¿ããæäœãã§ã¯ãããŒãžã®ãªã¹ããå«ããµã€ãã¡ãã¥ãŒãèªåçã«çæãããããšãéèŠã§ãã ããã«ããã®ãããã¿ã€ããšã³ãžã³ã«èšäºã®ã»ã¯ã·ã§ã³ïŒã«ããŽãªïŒãšã¿ã°ïŒã¿ã°ïŒãè¿œå ããã®ã¯éåžžã«ç°¡åã§ãã ãã®ã¿ã¹ã¯ã¯xslã§çŽæ¥èŠæ±ãããå¿ èŠã«å¿ããŠå€ãã®ããšã空æ³ããããšãã§ããŸãã
SSIãšã³ãžã³SPAã®XSLTããŒãžã§ã³ã®ãµã€ããåŒã³åºããããããã¯SEOã®èŠ³ç¹ããéèŠã§ãã ããã¯ãæ€çŽ¢ãšã³ãžã³ã1ã€ã®ããŒãžã衚瀺ããããšãæå³ãïŒPSã¯ããã«å€ãã®ããšãã§ãããããèªåŒµããŠããŸãïŒã1ããŒãžã®Webãµã€ããšããŠå®£äŒããå¿ èŠããããŸãã ããã¯ããªããã€ãã¹ã§ãããäºçŽãå¿ èŠã§ãã xslãã¡ã€ã«ã¯ãå€æäžã«ã³ã³ãã³ããå€æŽã§ããŸãã ããã¯é¢çœãã§ãã SEOã®èŠ³ç¹ãããPSå°çšã®ããã¹ãããµã€ãã«è¿œå ããå¿ èŠããããšããŸãã ããã¿ãŒã®å¥¥ãŸã§æŒã蟌ãããšãã§ããŸããã蚪åè ã«èŠããªãããšãã§ããŸãã ãããã©ããŸã§é²ãã¹ããããããè¡ãã¹ããã©ããã¯å¥ã®è°è«ã®ãããã¯ã§ãããããã§ã®äŒè©±ã¯æè¡çãªå®çŸå¯èœæ§ã«ã€ããŠã®ã¿ã§ãã
ã¯ã©ã€ã¢ã³ãã®å€æã«ã€ããŠïŒãµãŒããŒããã¯ã©ã€ã¢ã³ãã«è² è·ã転éãããšããè°è«ãç¹ã«èæ ®ããŸããã§ããã誰ããããããã©ã¹ãšèãã誰ããããããããã®ç¯çŽã ãšèšãã§ãããã ç§ã®æèŠã§ã¯ãå¯èœã§ããã°ãµãŒããŒäžã§ãã¹ãŠãå®è¡ããæ¹ãè¯ããšèããŠããŸãããããã§ãªãå Žåã¯éžæè¢ã¯å€§ãããããŸããã æ®å¿µãªããããã©ãŠã¶ãŒã«ã¯XSLTå®è£ ã®ããã€ãã®æ©èœïŒæ©èœãŸãã¯ãã°ïŒããããxslãéçºããéã«ç¥ã£ãŠæ€èšããå¿ èŠããããŸãã ãŸããApacheã§ã¯ãªãNginxã䜿çšããããšããããšã¯ææãªããã§ãããã®å Žåã ngx_http_xslt_moduleã¢ãžã¥ãŒã«ã䜿çšãããªãã·ã§ã³ããããŸããåæã«ããµã€ããSPAãããµãŒããŒåŽã§XSLTå€æãå®è¡ãããã«ãããŒãžãµã€ãã«å€ããããšãã§ããŸãã
åäœäŸã確èªããã«ã¯ããããã®ãã¡ã€ã«ããµã€ãã§äœæããå¿ èŠããããŸãã
.htaccess
AddDefaultCharset utf-8 AddType text/xml .xml AddHandler server-parsed .xml AddType text/xsl .xsl AddHandler server-parsed .xsl DirectoryIndex rumba.xml?query=start RewriteEngine on RewriteRule ^([a-zA-Z0-9-]+)\.html$ rumba.xml?query=$1 [L]
rumba.xml
<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="rumba.xsl?<!--#echo encoding="none" var="QUERY_STRING" -->"?> <html> <head> <title>- </title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name="Description" content=" "/> </head> <body> <h1>- </h1> <article id='start'> <h2> â </h2> <text> <a title=' ' rel='canonical' href='https://ru.wikipedia.org/wiki/'>Ì</a> (. rumba) â : <ol> <li> , . rumba Guaguanco. rumba Yambu rumba Columbia. , .</li> <li> , . - ( â , , -- ). - .</li> </ol> </text> </article> <article id='history'> <h2> </h2> <text> 19- . «Rumba», , 1807 â «rumboso orquestra», «rumbo» «» ( â «», ). - , '' , . </text> </article> <article id='cha-cha-cha'> <h2> --</h2> <text> <p> --, - , ( , ), . . , , , , (: , , , â ). -- , , , (, , â , â «--» «--»).</p> <p> -- . , , «», , , -- . «Guantanamera» --, .</p> <p> , , . , - , . . , . , .</p> </text> </article> <article id='types'> <h2> </h2> <text> <p> XIX , (Guaguanco), , , . . - - « ».</p> <p>- , . , (Papilote, Mama'buela, Gavilan)</p> <p> , . , â . , . , (clave), , 3-2. , . , . (Rumba Son).</p> </text> </article> <article id='emotion'> <h2> </h2> <text> . , . , « â ». . , â , , . , , , . </text> </article> <article id='hits'> <h2> </h2> <text> <ul> <li>La Media Vuelta â (Eydie Gorme)</li> <li>Manana</li> <li>Cantinero de Cuba</li> <li>Reflection â </li> <li>Fairy tale â </li> <li>Don't Know Why â </li> <li>Falling Into You â Celine Dion</li> <li>When the blue bird sings</li> <li>Gipsy Kings â La Rumba-De Nicolas</li> <li>Gipsy Kings â Una Rumba Por Aqui</li> <li>Gipsy Kings â Rumba Del Stud</li> </ul> </text> </article> </body> </html>
rumba.xsl
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <!--#if expr="$QUERY_STRING = /^query=([a-zA-Z0-9-]+)/" --> <!--#set var="rumba_query" value="$1" --> <!--#else --> <!--#set var="rumba_query" value="error" --> <!--#endif --> <xsl:param name="query"><!--#echo encoding="none" var="rumba_query" --></xsl:param> <xsl:template match="/"> <html> <head> <xsl:apply-templates select="/html/head"/> <link rel="stylesheet" href="twocolumn.css"/> </head> <body> <div id="header"> <xsl:apply-templates select="/html/body" mode="header"/> </div> <div id="sidebar"> <ul> <xsl:apply-templates select="/html/body/article"/> </ul> </div> <div id="content"> <xsl:choose> <xsl:when test="count(/html/body/article[@id = $query]) = '0'"> <xsl:apply-templates select="/html/body" mode="error"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="/html/body" mode="page"/> </xsl:otherwise> </xsl:choose> </div> </body> </html> </xsl:template> <xsl:template match="/html/head"> <title><xsl:value-of select="/html/body/article[@id = $query]/h2"/></title> <xsl:copy-of select="meta"/> </xsl:template> <xsl:template match="body" mode="header"> <xsl:copy-of select="h1"/> </xsl:template> <xsl:template match="/html/body/article"> <xsl:choose> <xsl:when test="@id = 'start'"> <li><a href="./"></a></li> </xsl:when> <xsl:otherwise> <li><a href="{@id}.html" rel="nofollow"><xsl:value-of select="h2"/></a></li> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="/html/body" mode="page"> <xsl:for-each select="/html/body/article[@id = $query]"> <xsl:copy-of select="h2"/> <div> <xsl:copy-of select="text"/> </div> </xsl:for-each> </xsl:template> <xsl:template match="/html/body" mode="error"> <h2> 404</h2> </xsl:template> </xsl:stylesheet>
twocolumn.css
body { margin: 0 auto; width: 640px; font:17px/20px Arial,Helvetica,sans-serif; overflow-y: scroll; } a { color: #777; } #header { padding: 10px; text-align: center; } #content { margin-left: 230px; } #content h2{ color: #E6B03E; } #sidebar { padding: 10px; background: #B44E29; float: left; width: 180px; } #sidebar ul { padding: 0px; } #sidebar li { padding: 5px; list-style-type: none; list-style-position: inside; } #sidebar a { color: #fff; text-decoration: none; } #sidebar a:hover { color: #ccc; text-decoration: none; }
䞻芳ççµè«
誰ãã-ã¡ãªã¿ã«-ç§ãã¡ã®å¹Žã«ã€ããŠèšããŸãïŒ
ããããããã¹ãŠãããç°¡åã ã£ã...äž»ããç§ãã¡ã¯ãããæã¿ãŸãïŒ
説æãããŠãããœãªã¥ãŒã·ã§ã³ãSSIã«é©çšããããšã¯ã確ãã«åºç¯å²ã«ããã䜿çšã«ã¯é©ããŠããŸãããããããçŽç²ã«æè¡çãªèŠ³ç¹ããèŠããšããããã¯é©çšã§ããŸããå®éãéåžžã«ã·ã³ãã«ã§ä¿¡é Œæ§ã®é«ããœãªã¥ãŒã·ã§ã³ã§ãããèŠããŠããå¿ èŠã¯ãããŸããããããã«ä»£ãããã®ã¯ãJavaScriptãPHPãªã©ã䜿çšããææ°ã®CMSããã³SPAã§ããããããããµã€ãã®äœæã«ãã£ãŠããããããã¿ã¹ã¯ã解決ããŸãã
ã¡ãªã¿ã«ãPHPãšJavaScriptã®äž¡æ¹ã§xsltå€æãå®è£ ããããšã¯ããªãå¯èœã§ãïŒä»ã®èšèªã§ãééããªãã§ãããïŒãããµãŒããŒãããå ŽåããŸãã¯å ±æãããŠããå Žåã§ããæå°éã®æè¡ã¹ã¿ãã¯ãäžçš®ã®çŠæ¬²çã§æå°éã®ãªãã·ã§ã³ãæã€SSIã䜿çšãããœãªã¥ãŒã·ã§ã³ãæ€èšããŸãããã¹ãã£ã³ã°ãš...ããã ãã§ããAjaxãªãã§ããŒã¿ãä¿åããJSã®ããŒãžã§ã³ã¯èæ ®ããŸããã§ããïŒãã®ãªãã·ã§ã³ã¯ååšããã ãã§ãªãã2000幎代ã®åãã«ç§ãäžåºŠäœ¿çšããããšããããŸãããAngularJSãæèŒããè¿ä»£çãªSPAã«æ¬è³ªçã«è¿ããã®ã§ããããã®ããŒãã«é¢ããèšäºã¯ååã«ãããšæããŸãã
äžèšã®äŸãããµã€ããæ§ç¯ããããªãå Žåã¯ãSSI HTMLããã³SSI XMLãžã®ãªã³ã¯ãã芧ãã ããã
* SPAãš1ããŒãžãšããçšèªã¯ç§ãšå€å°åãã§ããããããã¯ãã¡ããç°ãªããã®ã§ãã