Posts

Showing posts with the label tutorial

How to Build a Next.js Portfolio (Step by Step, 2026)

Image
  Originally published at https://designtocodes.com on August 11, 2026. How to build a Next.js portfolio (step by step) Build a Next.js portfolio by scaffolding an App Router project, structuring routes for your home and project pages, serving images through next/image, adding SEO with the Metadata API, and deploying to Vercel. Next.js renders fast, server-rendered pages by default, so you fill in your work, and it loads fast and ranks. Here is the full guide, plus templates to start from. The 6 steps Scaffold — run create-next-app and choose the App Router. Structure routes — a home page, a projects list, and a page per project. Optimize images — use next/image with priority on the hero. Add SEO — use the Metadata API for titles, descriptions, and canonicals. Write case studies — problem, approach, result, links. Deploy — push to Vercel for HTTPS, a CDN, and automatic deploys. Which rendering method for which page Page Render method Why Home and project pages Stati...

How to Add Dark Mode to Any Website (CSS + React, No Library)

Image
  How to add dark mode to a website without a library To add dark mode to a website without a library, define your colors as CSS custom properties, override them under a [data-theme="dark"] selector, toggle that attribute with a few lines of JavaScript, and apply the saved theme before the page paints to avoid a flash. The pattern works in plain HTML, React, or any framework. Step 1: define colors as CSS variables :root{ --bg:#ffffff; --text:#1a1a1a } [data-theme="dark"]{ --bg:#0e1116; --text:#e8ecf3 } body{ background:var(--bg); color:var(--text) } Step 2: add the toggle On click, switch the data-theme attribute on the root element and save the choice to localStorage so it persists between visits. Step 3: prevent the white flash on load Apply the saved theme with a small inline script in the page head, before the stylesheet loads. This sets the correct theme before the first paint, which removes the flash-of-wrong-theme most implementations suffer from. Default ...

How to Fix the 500 Internal Server Error in WordPress & Elementor (2026)

Image
  What causes a 500 internal server error in WordPress The 500 internal server error in WordPress means the server hit a problem it could not explain. The four most common causes are a corrupted .htaccess file, an exhausted PHP memory limit, a plugin or theme conflict, and an outdated PHP version. Enabling debug logging first tells you which one applies. Step 1: enable WordPress debug logging Add the following to wp-config.php , then reload the page and open /wp-content/debug.log to see the real error: define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false ); Step 2: work through the four fixes in order Regenerate .htaccess — rename the file, then re-save Settings → Permalinks. Raise the PHP memory limit — add define('WP_MEMORY_LIMIT','512M'); (Elementor recommends 512M). Find the broken plugin — rename /wp-content/plugins , then re-enable one at a time. Update PHP — switch to PHP 8.1 or 8.2 in you...

Building a Yacht Charter Website with Next.js: An Easy Walkthrough

Image
  So you run a yacht charter business, and your current website is held together with duct tape and a contact form. You've heard developers talk about Next.js and you're wondering: is this actually for me? Short answer: yes, if you can either code a bit yourself or hire someone who can. Long answer: Here's what building a yacht charter site with Next.js actually looks like in 2026. What Next.js gives you Three things that matter for a yacht business: Speed. Pages load fast even with big yacht photos. Search rankings. Pages render on the server, so Google sees the content immediately. Flexibility. You can wire a real booking calendar that checks real availability — not a dumb form. The pages you'll need Homepage with a fleet preview Fleet listing Individual yacht pages with photos, specs, and booking calendar Destination or itinerary pages About + crew Contact Booking checkout Each yacht should have its own URL. This is huge for SEO — every yacht becomes a chance to r...