[{"data":1,"prerenderedAt":490},["ShallowReactive",2],{"project-44988271":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":34,"aspects":35,"strip":43,"post_text":46,"what":47,"said":69,"maker_in_thread":144,"shape":152,"grid":157,"attempts":452,"same_week":453,"maker_shows":44,"maker_hidden":482,"reader_version":483,"card":484},"44988271","xsl-website","JavaScript-free (X)HTML Includes","title","Show HN: JavaScript-free (X)HTML Includes","https:\u002F\u002Fgithub.com\u002FEvidlo\u002Fxsl-website","github.com","Evidlo",1755888450,2025,211,114,295,3837,8,"notable","dev_tools","static site templating","library",[24,25,26,27],"xslt","static site","html templating","xml includes","curious",0.024,{"positive":31,"neutral":32,"mixed":33,"critical":31},4,13,0,21,{"idea":36,"design":38,"docs":40,"execution":41,"performance":42},{"positive":31,"critical":37},2,{"positive":33,"critical":39},1,{"positive":33,"critical":33},{"positive":33,"critical":33},{"positive":33,"critical":39},[44,39,44,45,39,39,33,44,33,33,33,33,33,33,33,33,33,33,33,33,33,33,45,33,33,33,33,33,33,44,44,33,44,39,44,45,33,45,33,33],3,5,"(spoiler: its XSLT)\n\nI've been working on a little demo for how to avoid copy-pasting header\u002Ffooter boilerplate on a simple static webpage. My goal is to approximate the experience of Jekyll\u002FHugo but eliminate the need for a build step before publishing. This demo shows how to get basic templating features with XSL so you could write a blog post which looks like\n\n\n```\n  \u003C?xml version=\"1.0\"?>   \u003C?xml-stylesheet type=\"text\u002Fxsl\" href=\"\u002Ftemplate.xsl\"?>   \u003Cpage>       \u003Ctitle>My Article\u003C\u002Ftitle>       \u003Ccontent>           some content           \u003Cul>               \u003Cli>hello\u003C\u002Fli>               \u003Cli>hello",{"problem":48,"audience":54,"pricing":54,"motivation":55,"time_to_build":54,"stack":59,"openness":68,"stage":68,"team_size":68},{"value":49,"source":50,"evidence":51},"Avoiding copy-pasted header\u002Ffooter boilerplate on a simple static webpage without a build step.","maker",[52],{"id":53},"post",null,{"value":56,"source":50,"evidence":57},"Get Jekyll\u002FHugo-like templating without a build step, while XSLT support is still in browsers.",[58],{"id":53},[60,64],{"value":61,"source":50,"evidence":62},"XSLT",[63],{"id":53},{"value":65,"source":50,"evidence":66},"XML",[67],{"id":53},"unknown",{"praise":70,"objections":79,"requests":109,"questions":110,"alternatives":115},[71],{"value":72,"source":73,"evidence":74},"Declarative, non-JavaScript, no-build way to handle HTML components.","commenter",[75],{"id":76,"by":77,"text":78},"44991526","simpaticoder","It's kind of too bad XSLT didn't take off. It is quite complex, until you compare it to the complexity of what now solves this problem (e.g. a build step with React and webpack…",[80,91,98],{"value":81,"source":73,"evidence":82},"XSLT is hard to write and its syntax is awkward.",[83,87],{"id":84,"by":85,"text":86},"44994328","msylvest","I remember admiring the intent of XSLT when it was born. And how difficult it turned out to be to write; using XML framing makes it terse\u002Fverbose\u002Farcane, eg. when compared to the…",{"id":88,"by":89,"text":90},"44994900","DonHopkins","What's the whole point of bending over backwards to be \"JavaScript-free\" when the chosen alternative is using something as half-assedly hamstrung and counterintuitively crippled…",{"value":92,"source":73,"evidence":93},"Client-side includes may cause request waterfalls and flicker.",[94],{"id":95,"by":96,"text":97},"44991549","b_e_n_t_o_n","This works client side right? So when a user navigates to this page, it recursively fetches content from the server? And if you have nested includes it would waterfall? Even…",{"value":99,"source":73,"evidence":100},"XSLT security concerns in libxslt led to Google's removal push.",[101,105],{"id":102,"by":103,"text":104},"44992424","johncolanduoni","To be fair, some things should be legitimately considered to be removed from the standard. O.G. XHTML basically mandated that you accept XML logic bombs and we got over that.…",{"id":106,"by":107,"text":108},"44992022","shakna","Whilst I can't be certain, I've been hearing that part of Google's want to move away from XSLT is two-fold - and relates to the idea of the security problem. Partly, there's…",[],[111],{"value":112,"source":73,"evidence":113},"Does the browser wait for includes before showing the page?",[114],{"id":95,"by":96,"text":97},[116,123,130,137],{"value":117,"source":73,"evidence":118},"CSS stylesheet rendering of XML",[119],{"id":120,"by":121,"text":122},"44992355","bawolff","Since this seems to be about the recent proposal to remove xslt, i'd point out you can do the same thing with CSS https:\u002F\u002Fbawolff.net\u002Fcss-website\u002Findex.xml is Evidlo's example…",{"value":124,"source":73,"evidence":125},"SGML\u002FXML entities",[126],{"id":127,"by":128,"text":129},"44993928","tannhaeuser","This is how the simplest variant of SGML (or XML) entities have worked since 1986: ``` \u003C!doctype html [ \u003C!entity e system \"e.html\"> ]> \u003Chtml> \u003Ctitle>Hello, world!\u003C\u002Ftitle> \u003Cp>The…",{"value":131,"source":73,"evidence":132},"Server-side PHP XSLTProcessor",[133],{"id":134,"by":135,"text":136},"44993731","ulrischa","To overcome the two problems here (client side loading the template and ending browser support) you could throw in php in the mix and have a wonderful solution for templating…",{"value":138,"source":73,"evidence":139},"Server-side React rendering",[140],{"id":141,"by":142,"text":143},"44992785","AgentME","React supports rendering to HTML ahead of time (SSR) which doesn't need any client-side javascript, and this is a prominent feature of most frameworks using React. This feature…",{"comments":37,"answered":39,"key":145},[146,149],{"id":147,"text":148},"44993476","Thanks for the CSS example. By the way, the advanced\u002F folder has a slightly more complicated example that demonstrates template inheritance and \"slots\".",{"id":150,"text":151},"44993514","I was thinking it would be possible to compile a subset of Jinja2 (or your favorite equivalent) into XSL: https:\u002F\u002Fchatgpt.com\u002Fshare\u002F68a95439-ad54-800a-919f-23caecce4351 Thanks…",{"commenters":153,"max_depth":154,"maker_replies":37,"first_comment_mins":155,"lifespan_hours":156},61,10,291,104,[158,160,163,166,170,173,175,178,179,183,185,187,191,195,199,202,204,206,208,211,214,217,221,224,227,231,233,236,238,241,243,245,248,251,253,256,259,261,264,266,268,271,273,275,278,280,283,286,288,292,296,298,300,302,304,306,308,311,313,314,317,319,321,324,325,326,327,330,333,336,338,340,342,345,348,351,353,355,357,359,361,363,365,367,369,373,374,377,379,383,385,389,392,395,397,399,402,404,407,409,412,413,416,419,423,427,430,432,434,438,440,444,446,448],[127,33,44,159,128,33],"project\u002Fneutral\u002Fidea",[161,33,44,159,162,33],"44994539","myfonj",[164,33,33,165,89,33],"44994846","other\u002Fneutral\u002Fnone",[167,33,39,168,169,33],"44995153","project\u002Fcritical\u002Fidea","the_mitsuhiko",[171,33,33,172,121,33],"44996961","other\u002Fneutral\u002Fprivacy",[174,33,33,165,128,33],"44997546",[176,33,33,177,121,33],"44997823","commenter\u002Fneutral\u002Fprivacy",[120,39,44,159,121,33],[180,39,45,181,182,33],"44992644","project\u002Fpositive\u002Fidea","8organicbits",[147,39,33,184,11,39],"maker\u002Fneutral\u002Fdocs",[186,39,44,159,121,33],"44994023",[188,39,33,189,190,33],"44993479","commenter\u002Fneutral\u002Fnone","Pxtl",[192,39,39,193,194,33],"44993509","project\u002Fcritical\u002Fdesign","egeozcan",[196,39,44,197,198,33],"44996331","project\u002Fneutral\u002Fdesign","lelandfe",[200,39,39,168,201,33],"44993652","lenkite",[203,39,33,189,121,33],"44993974",[205,39,33,189,162,33],"44994658",[207,39,33,189,121,33],"44996917",[209,39,33,189,210,33],"44994722","em-bee",[212,39,44,213,210,33],"44994712","project\u002Fneutral\u002Fdocs",[215,37,33,165,216,33],"44991654","xnx",[218,37,33,219,220,33],"44992165","other\u002Fcritical\u002Fnone","lloydatkinson",[222,37,33,165,223,33],"44992418","abraham",[225,37,33,165,226,33],"44992725","bapak",[228,37,33,229,230,33],"44993016","other\u002Fneutral\u002Fidea","thayne",[232,37,33,165,216,33],"44993165",[234,37,33,165,235,33],"44993500","spankalee",[237,37,33,189,235,33],"44993490",[239,37,33,189,240,33],"44994097","MortyWaves",[242,37,33,189,235,33],"44994334",[244,44,33,165,107,33],"44991280",[246,44,33,165,247,33],"44991471","kome",[249,44,33,165,250,33],"44991489","notpushkin",[150,44,33,252,11,39],"maker\u002Fneutral\u002Fidea",[254,44,33,165,255,33],"44997703","bokchoi",[257,44,33,219,258,33],"44991500","SnuffBox",[260,44,33,165,250,33],"44991546",[262,44,33,165,263,33],"44992390","ekianjo",[265,44,33,165,223,33],"44992447",[267,44,33,189,263,33],"44993269",[269,44,33,189,270,33],"44995729","JW_00000",[272,44,33,189,250,33],"45034947",[274,44,33,165,103,33],"44992457",[276,44,33,165,277,33],"44992805","arccy",[279,44,33,165,250,33],"44992835",[281,44,33,165,282,33],"44992072","esrauch",[284,44,33,165,285,33],"44992210","chrismorgan",[287,44,33,219,103,33],"44992793",[289,44,33,290,291,33],"44994843","other\u002Fpositive\u002Fnone","sunaookami",[293,44,33,294,295,33],"44995506","commenter\u002Fcritical\u002Fnone","lucumo",[297,44,33,189,291,33],"44995699",[299,44,33,294,295,33],"44997557",[301,44,33,189,291,33],"45003873",[303,44,33,189,295,33],"45010850",[305,44,33,189,103,33],"44999267",[307,44,33,189,295,33],"45010844",[309,44,33,290,310,33],"44995108","ndriscoll",[312,44,33,165,263,33],"44992387",[102,44,33,165,103,33],[315,44,33,189,316,33],"44993872","Mikhail_Edoshin",[318,44,33,189,103,33],"44999283",[320,44,33,189,316,33],"45002173",[322,44,33,189,323,33],"44994991","TiredOfLife",[76,44,45,181,77,33],[106,44,33,165,107,33],[141,44,33,189,142,33],[328,44,33,189,329,33],"44993553","degamad",[331,44,33,189,332,33],"44994400","throwaway290",[334,44,33,229,335,33],"44993179","MrJohz",[337,44,33,189,121,33],"44993291",[339,44,33,189,285,33],"44992056",[341,44,33,165,107,33],"44992433",[343,44,33,189,344,33],"44992707","magicalist",[346,44,33,165,347,33],"44994409","troupo",[349,44,33,189,350,33],"44994698","afavour",[352,44,33,189,347,33],"44995040",[354,44,33,189,350,33],"44995443",[356,44,33,189,285,33],"44996704",[358,44,33,189,285,33],"44992775",[360,44,33,189,107,33],"44992983",[362,44,33,189,285,33],"44993718",[364,44,33,189,107,33],"44995009",[366,44,33,189,285,33],"44997300",[368,44,33,189,107,33],"45000619",[370,31,44,371,372,33],"44993067","project\u002Fneutral\u002Fexecution","mgr86",[134,45,44,159,135,33],[375,45,33,165,376,33],"44996872","Telemakhos",[378,45,33,165,135,33],"44997930",[380,381,33,290,382,33],"44996720",6,"Kuyawa",[384,381,33,229,382,33],"44997055",[386,387,33,165,388,33],"44991535",7,"raggi",[390,18,33,165,391,33],"44991303","basscomm",[95,393,44,394,96,33],9,"project\u002Fneutral\u002Fperformance",[396,393,44,394,121,33],"44991846",[398,393,44,394,344,33],"44992671",[400,393,39,401,96,33],"44993223","project\u002Fcritical\u002Fperformance",[403,393,33,229,316,33],"44993650",[405,393,44,394,406,33],"44993867","lelanthran",[408,393,44,394,121,33],"44994012",[410,393,45,181,411,33],"44992318","dweinus",[84,154,33,165,85,33],[414,154,33,165,415,33],"44994878","reacweb",[417,154,33,165,418,33],"45012808","vgr-land",[420,421,33,165,422,33],"44992220",11,"OCTAGRAM",[424,425,33,165,426,33],"44991822",12,"RebeccaTheDev",[428,425,33,165,429,33],"44994123","the_other",[431,425,33,165,376,33],"44994194",[433,32,45,181,210,33],"44994630",[435,436,33,219,437,33],"44994640",14,"mjaniczek",[439,436,33,165,135,33],"44997938",[441,442,33,165,443,33],"44994389",15,"postepowanieadm",[88,445,33,219,89,33],16,[447,445,33,165,316,33],"45002290",[449,450,33,165,451,33],"44994463",17,"cranberryturkey",[],[454,458,463,468,473,477],{"id":455,"name":456,"points":457,"category":20},"45014131","Base",693,{"id":459,"name":460,"points":461,"category":462},"45028002","BYTE magazine archive",423,"learning_science",{"id":464,"name":465,"points":466,"category":467},"45003420","Clearcam",233,"security_privacy",{"id":469,"name":470,"points":471,"category":472},"45039292","Animal Crossing Letter Generator",203,"creative",{"id":474,"name":475,"points":476,"category":20},"45024532","markdown-ui",202,{"id":478,"name":479,"points":480,"category":481},"44969622","DiffMem",198,"ai",false,"v2",{"id":485,"name":5,"line":6,"ai":482,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":486,"top":18,"kw":487,"maker":11,"domain":10,"tier":19,"attempts":33,"strip":488,"url":9,"mix":489,"praise":72,"objection":81,"sub":21},44988271,0.02,[24,25,26,27],"3135110300000000000000500000033031350500",[31,32,33,31],1793991128404]