[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$f34mj4xkrkvldn":3},{"_id":4,"slug":5,"title":6,"subtitle":7,"kind":8,"cards":9,"tags":58,"categories":60,"source":62,"lang":65,"author":66,"audioState":69,"stats":70,"publishedAt":73,"renderer":74},"6aba93c7ca21c797c7e9a0a7","php-markdown-and-no-dependencies-984c43aa","PHP, markdown and no dependencies","I’ve been thinking about building a travel site called romantic-weekend.com, focused on romantic weekend destinations in Europe and the United States.","news",[10,13,18,23,28,33,38,43,48,53],{"headline":6,"body":11,"imageUrl":12,"sourceImageUrl":12},"I’ve been thinking about building a travel site called romantic-weekend.com, focused on romantic weekend destinations in Europe and the United States. The basic idea is deliberately simple: people search Google for things like “romantic weekend in Paris”, “romantic weekend in Rome”, “romantic getaway in Napa Valley” or “romantic weekend in France”, and they land directly on a highly focused destination page. The site would contain broader landing pages for regions and countries, such as Europe, France, Italy and the United States, alongside individual destination pages for places like Paris, Venice, New York and San Francisco. Because I expect most visitors to arrive through Google rather than navigate from the homepage, each destination page needs to work well on its own, while still belonging to a clear overall structure.","https:\u002F\u002Fmedia2.dev.to\u002Fdynamic\u002Fimage\u002Fwidth=1200,height=627,fit=cover,gravity=auto,format=auto\u002Fhttps%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjy2v3zjg75vewqullrbx.png",{"headline":14,"body":15,"imageUrl":16,"images":17},"The more I thought about the technical side","The more I thought about the technical side of the project, the less interested I became in using a traditional CMS. Romantic-weekend.com is not meant to be a complicated application. It does not need user accounts, comments, dashboards, workflows, permissions or a complex database model. At its core, it is an editorial website made up of structured pages. That made me wonder whether the simplest possible architecture might also be the best one: PHP for the site engine, Markdown files for the content, the filesystem for the hierarchy and ordinary PHP templates for the output. I imagine the content directory looking something like this:","\u002Fapi\u002Fmedia\u002Fposts\u002Fphp-markdown-and-no-dependencies-984c43aa\u002F1.webp",{"local":16},{"headline":19,"body":20,"imageUrl":21,"images":22},"The nice thing about this structure is that","The nice thing about this structure is that the filesystem itself describes the site. A file at \u002Fcontent\u002Feurope\u002Ffrance\u002Fparis.md naturally becomes the page \u002Feurope\u002Ffrance\u002Fparis\u002F, while \u002Fcontent\u002Feurope\u002Ffrance\u002Findex.md becomes \u002Feurope\u002Ffrance\u002F. I don’t need a database table that says Paris belongs to France and France belongs to Europe, because the location of the file already tells me that. I also don’t need to repeat the URL, the parent page, the country and the region in every content file. PHP can derive most of that automatically from the path. A Paris page could then be very simple:","\u002Fapi\u002Fmedia\u002Fposts\u002Fphp-markdown-and-no-dependencies-984c43aa\u002F2.webp",{"local":21},{"headline":24,"body":25,"imageUrl":26,"images":27},"The Markdown file only describes the content. PHP","The Markdown file only describes the content. PHP handles everything around it: the URL, breadcrumbs, metadata, templates, related destinations, canonical URLs, sitemap entries and navigation. That separation is important to me because I want the content files to stay readable even if the site becomes quite large. If romantic-weekend.com eventually contains hundreds of destinations, I still want adding a new one to be as simple as creating a new Markdown file in the correct directory.","\u002Fapi\u002Fmedia\u002Fposts\u002Fphp-markdown-and-no-dependencies-984c43aa\u002F3.webp",{"local":26},{"headline":29,"body":30,"imageUrl":31,"images":32},"For example, adding Lyon should ideally mean creating","For example, adding Lyon should ideally mean creating \u002Fcontent\u002Feurope\u002Ffrance\u002Flyon.md and nothing else. The France page should automatically discover it. The sitemap should automatically include it. The breadcrumb should automatically become “Europe › France › Lyon”. A “More romantic weekends in France” section should automatically be able to link to it. The system should understand the hierarchy without me having to maintain the same information in five different places.","\u002Fapi\u002Fmedia\u002Fposts\u002Fphp-markdown-and-no-dependencies-984c43aa\u002F4.webp",{"local":31},{"headline":34,"body":35,"imageUrl":36,"images":37},"That is also why I like the idea","That is also why I like the idea of country and region pages being proper content pages rather than just technical category archives. \u002Feurope\u002F could target searches around romantic weekend destinations in Europe. \u002Feurope\u002Ffrance\u002F could target romantic weekends in France. \u002Fusa\u002Fcalifornia\u002F could target romantic weekend getaways in California. These pages could contain their own editorial introductions, recommendations and internal links, while PHP automatically inserts the relevant child destinations. This gives the site a clear SEO structure without forcing visitors to navigate through every level before reaching the page they actually want.","\u002Fapi\u002Fmedia\u002Fposts\u002Fphp-markdown-and-no-dependencies-984c43aa\u002F5.webp",{"local":36},{"headline":39,"body":40,"imageUrl":41,"images":42},"My first instinct for handling Markdown was to","My first instinct for handling Markdown was to use a mature package such as league\u002Fcommonmark. That would certainly work, and for many projects it would be the sensible choice. But romantic-weekend.com made me question whether I really need a complete Markdown implementation at all. I control every content file myself. There are no users pasting arbitrary Markdown into a form. I do not need to support every edge case in the CommonMark specification. In practice, the editorial content probably only needs headings, paragraphs, bold and italic text, links, lists, blockquotes and maybe images.","\u002Fapi\u002Fmedia\u002Fposts\u002Fphp-markdown-and-no-dependencies-984c43aa\u002F6.webp",{"local":41},{"headline":44,"body":45,"imageUrl":46,"images":47},"That means I could write a deliberately small","That means I could write a deliberately small Markdown parser instead of pulling in a dependency. The distinction matters: I would not be trying to write a standards-compliant Markdown parser. I would be defining a small markup format for this specific website that happens to use familiar Markdown syntax. If the site supports #, ##, **bold**, [links](...) and simple lists, that is the specification. Anything more complicated simply does not belong in the content format unless I consciously decide to add it later.","\u002Fapi\u002Fmedia\u002Fposts\u002Fphp-markdown-and-no-dependencies-984c43aa\u002F7.webp",{"local":46},{"headline":49,"body":50,"imageUrl":51,"images":52},"The same goes for the metadata block at","The same goes for the metadata block at the top of each file. I do not need a complete YAML parser just to read three or four simple values. A lightweight parser that reads key: value lines is probably enough. That keeps the project extremely portable. In the simplest version, the entire runtime dependency stack could be nothing more than PHP itself.","\u002Fapi\u002Fmedia\u002Fposts\u002Fphp-markdown-and-no-dependencies-984c43aa\u002F8.webp",{"local":51},{"headline":54,"body":55,"imageUrl":56,"images":57},"That idea appeals to me more than I","That idea appeals to me more than I expected. The Markdown files become the database. Git becomes the version history. The directory tree becomes the taxonomy. PHP becomes the rendering engine. If I move the site to another server, I copy the project and it works. There is no database dump to import, no CMS installation to upgrade and no long dependency tree that needs to be restored before the site can even render a page.","\u002Fapi\u002Fmedia\u002Fposts\u002Fphp-markdown-and-no-dependencies-984c43aa\u002F9.webp",{"local":56},[59],"dev",[61],"Technology",{"name":63,"url":64},"Dev.to","https:\u002F\u002Fdev.to\u002Fandbjo\u002Fphp-markdown-and-no-dependencies-1d6e","en",{"handle":67,"displayName":68},"spots","Spots","queued",{"views":71,"likes":72,"saves":72,"shares":72,"completions":72,"opens":72,"skips":72,"depthSum":72},3,0,"2026-09-28T16:20:23.650Z","local"]