Ask HN: Best way to create a landing page?
11–20 of 65 posts
Re: Ask HN: Best way to create a landing page?
#12Re: Ask HN: Best way to create a landing page?
#13Re: Ask HN: Best way to create a landing page?
#14In a somewhat similar situation I used PHP with `include`. The structure was something like this: - index.php - header.php - sidebar.php - footer.php - page-1.php - page-2.php ... In `header.php` I used variables for the title, description, etc. and then in each page I specified the values for those variables. This way each page had the same header HTML code, but with a different title, description and so on.
All my HTML is held in template .html files, with %%PLACEHOLDER%% text where the dynamic content should be, Then my index.php is the main 'app' loading in the templates to build the output, doing string replaces on the html, and then a single final 'echo' to send the result to the user at the end of the process.
I think this is called 'code behind' - I've just always had a problem with mixing code and layout in the same file.
Does anyone else do it like this?
Re: Ask HN: Best way to create a landing page?
#15You have nice static HTML pages with a CDN, super fast, and there's even a CMS option with NetlifyCMS, which works by creating git commits for you and then automatically pushes the new static version on Netlify. The basics in Netlify are free and there are nice add-ons where some are also free (e.g. forms).
Check out the template list here: https://templates.netlify.com
Re: Ask HN: Best way to create a landing page?
#16Re: Ask HN: Best way to create a landing page?
#17In a somewhat similar situation I used PHP with `include`. The structure was something like this: - index.php - header.php - sidebar.php - footer.php - page-1.php - page-2.php ... In `header.php` I used variables for the title, description, etc. and then in each page I specified the values for those variables. This way each page had the same header HTML code, but with a different title, description and so on.
I do my PHP in completely different way, which in turn was the way I did ASP back in the day, also in a weird way. All my HTML is held in template .html files, with %%PLACEHOLDER%% text where the dynamic content should be, Then my index.php is the main 'app' loading in the templates to build the output, doing string replaces on the html, and then a single final 'echo' to send the result to the user at the end of the…
Re: Ask HN: Best way to create a landing page?
#18No, you just said you don't need a CMS.
I would hand edit the HTML and deploy it on Netlify with a Parcel build step, at least that's what I've done.
parcel build *.html --public-url https://your.page
> I want it to be SEO optimized.It's a complex problem, it all boils down the template you use. I usually hunt hours for free HTML/CSS templates then get mad about them and create one from scratch using some CSS framework :)