Skip to content
Sign inJoin waitlist

Editing the site — Denzel HTML

Every page of Denzel’s HTML edition is a plain file you edit in a code editor: where everything is, and how to add a post, a category, an author or a page.

Double-click index.html: the site opens in your browser and every link between pages works, straight from the folder. To see it exactly as a host serves it (and to test the search results, the newsletter box and the 404 page), run a small local server from the folder:

Terminal window
npx serve .

npm start runs the same command. Then edit the files in a code editor and reload the browser to see the change.

index.html Home (the slider, Editor's Pick, Trending, Latest and the sidebar)
blog.html the Blog page (every post as a card)
404.html shown for addresses that don't exist
style-guide.html every component with its name (noindex; delete it if you don't want it)
blog/*.html one page per post (26)
category/*.html one page per category (5, with the default "uncategory")
author/*.html one page per author (6, with the default "admin")
assets/css/style.css the stylesheet (generated — see design.md)
assets/js/main.js the site's scripts (you rarely need to touch it)
assets/js/config.js your settings: form endpoint
assets/images/ post covers, category and author photos, the logo, the sidebar's background, the 404 picture
assets/fonts/ Noto Serif JP, Poppins
icon.svg, apple-icon.png, opengraph-image.png
sitemap.xml, robots.txt
src/css/style.css the stylesheet's source: colours, breakpoints, fonts

Pages and sections describes every page, section by section.

Find the words on the page and change them in the HTML. Keep the tags and classes around them, because they carry the layout. A card’s title looks like this:

<a href="blog/self-driving-cars-everything-you-need-to-know.html" class="font-serif text-2xl leading-[1.4] font-semibold …">
Self-Driving Cars: Everything You Need to Know
</a>

Change the words, leave the class. Long lines are wrapped onto several lines in the files, so when you search for a sentence, search for a few words of it. Ampersands are written &amp; (Blog &amp; Magazine Website) and some apostrophes &#39; (Editor&#39;s Pick); the demo also uses the typographic ’ (you won’t). Typing ' and " in text works too; & should stay &amp;.

A card’s title is written twice: in the link of the photo (aria-label="…", for screen readers) and in the visible link. Change both.

Dates are written twice as well: <time datetime="2023-09-14">Sep 14, 2023</time>. The datetime is the date in year-month-day form, for search engines; the text is what the visitor reads.

The header, the footer, the sidebar, your links and the search list are copied into every page. Change them once for all files with your editor’s Find in Files / Replace in Files (VS Code: Ctrl/Cmd + Shift + H):

Replace With
https://denzel-html-marcframe.vercel.app Your domain, e.g. https://www.yourmagazine.com (canonical links, share cards, sitemap.xml, robots.txt)
hello@example.com Your e-mail: the footer of every page (the visible text and the mailto: link)
https://facebook.com, https://twitter.com, https://instagram.com, https://pinterest.com Your profiles: the header (from tablet width), the phone menu, the “Denzel” box of the sidebar and the footer. Remove the <li> of a network you don’t use. The authors’ pages use the first three for each writer: write each writer’s own profiles there
Unveiling stories that intrigue and inspire, … Your footer’s introduction
Immerse yourself in a world of knowledge and creativity with every page turn. The line in the sidebar’s “Denzel” box
Join 89,000 subscribers! The newsletter’s line (or your real number)
Denzel. Theme by Marcframe. Your footer note; keep the <span data-current-year> before it for the year
aria-label="Denzel" Your name: the name of the logo links (header, sidebar and footer) and of the sidebar’s box, for screen readers
| Denzel</title> and | Denzel" in share tags | Your Name (the Home title, Denzel - Blog &amp; Magazine Website, has no suffix; a post’s title is its own)
>Denzel</a> The first crumb of the breadcrumbs (it leads Home)
content="Denzel" Your site’s name (application-name and og:site_name)
Denzel - blog and magazine website template A description of your share image (og:image:alt)

Include the .html, .xml and .txt files. Review each change before replacing all. The year in the footer updates itself (data-current-year).

Some blocks are copied into several pages. Change them in every copy (find and replace in files works for text):

Block Pages
Header, phone menu and search dialog (with the search list) Every page
Footer: the introduction and e-mail, “Celebration” (two posts) and the newsletter box Every page
The sidebar: the “Denzel” box, “Recent” (four posts) and “Explore Topics” (the four categories with their number of posts) Home, every post, category and author page
A post’s card Every list that shows it: Blog, its category’s page, its author’s page, and wherever it is picked (the slider, Editor’s Pick, Trending, Latest, Recent, Celebration, the Related Posts and More Articles of other posts)
A category’s or an author’s name and photo The cards and the post pages that name them, “Explore Topics” (categories), the search list

Search the folder for a post’s file name (self-driving-cars-everything-you-need-to-know) to find every card of it.

The header holds the logo, the menu (Home, All Post, Business, Technology, Economy, Fashion, Author), the four social links and “Search All”. Below desktop width the menu moves into the phone menu, opened by the “Menu” button, and the search button becomes a round icon. “Author” leads to author/anderson.html: point it at the writer you want, or at a page of your own.

“Search All” opens the search dialog. Its list of what can be found is not read from the pages: it is written into every page, as a list in the dialog, right after the header:

<div data-search hidden data-empty="No results found" data-list-id="search-results" role="dialog" … aria-label="Search All">
<script type="application/json" data-search-items>
[
{
"title": "Business",
"href": "/category/business.html",
"keywords": "The real test is not whether you avoid this failure, …"
},
…
]
</script>
  • There are 35 entries: the four categories, the 26 posts and the five writers (Uncategory and Admin are left out).
  • title is what the result shows and what is searched; href is the page’s address from the site’s root, with .html; keywords are more words to search (a category’s and an author’s description; a post’s excerpt, its category and its author’s name). A result matches when every word typed appears in its title or keywords.
  • The list is the same in all 41 pages. Edit it in one page, then copy the whole <script type="application/json" data-search-items>…</script> over the one in every other page (or make the same change with find and replace in files).
  • Keep it valid JSON: double quotes, a comma between entries and none after the last. If the list is broken, the search finds nothing (the browser’s console says why).

The dialog closes with Escape, by clicking outside it or by choosing a result; the arrow keys move through the results and Enter opens one. “No results found” is the dialog’s data-empty.

The row at the top of Home shows six featured posts: four at a time on desktops, two on tablets and one on phones, sliding one step every five seconds and starting over after the last. Each slide is a card with the photo, the title and the date.

<div data-post-slider data-count="6" role="region" aria-roledescription="carousel" aria-label="Featured posts" …>
<div data-slider-track …>
<div …><article>…</article></div> ← six slides
<div aria-hidden="true" inert data-copy="0" …><article>…</article></div> ← copies of the first four
  • After the six slides come copies of the first four (data-copy="0" to "3"), so that the loop has no gap. When you change a slide among the first four, change its copy too.
  • To show another number of posts, add or delete slides, set data-count to the new number and keep the copies equal to the first four slides. With four posts or fewer on a desktop the row stands still.
  • With “reduce motion” switched on in the visitor’s system, the row doesn’t move.
  • Editor’s Pick: one large card and two smaller ones, chosen by hand.
  • Trending: two columns, each a card with its excerpt and two small cards, chosen by hand.
  • Latest: the eight newest posts, with their category and excerpt, and “View More” (to the Blog page). When you add a post, put its card at the top and remove the eighth.
  • “View All” next to each title leads to the Blog page.

The slider, the picks, the sidebar’s “Recent” (four posts) and the footer’s “Celebration” (two posts) are chosen posts, not the newest: change them when you like.

Home, the category pages, the author pages and the posts have a sidebar (under the list on phones and tablets):

  • The “Denzel” box: the logo, a line and the social links over a background picture (widget-background.png).
  • Recent: four posts with their photo (round), author and date, and “View All”.
  • Explore Topics: the four categories with their photo and the number of their posts (8 Post). The numbers are text: change them when you add or remove a post.

Each category has its page in category/ (business.html …): the breadcrumb, the name, a description and a photo, then its posts newest first, each with its category, title, excerpt and photo. A category’s name and link also appear on its posts’ cards, in their breadcrumb, in the header’s menu, in “Explore Topics” and in the search list.

category/uncategory.html is the default category for posts you haven’t sorted yet. It has no posts in the demo (it says “No posts in this category yet.”), and no menu, card or search entry links to it; it is in the sitemap.

To add a category, copy category/fashion.html → category/travel.html, change its name, description, photo (category-travel.jpg, 800 × 533), its list of posts and its <head>; then add it to the header’s two menus (the one for desktops, and the phone menu) in every page, to “Explore Topics”, to the search list and to sitemap.xml. The category’s own page marks its menu link as the current page (adding a page).

Each author has a page in author/ (anderson.html …): the round photo, the breadcrumb “Articles by: Anderson”, the name, a short bio, their social links, then their posts newest first. A writer’s name and photo also appear on their cards and posts, and in “More Articles by …” at the foot of their posts.

author/admin.html is the default author: no photo, the bio “this is default author” and no posts (“No posts by this author yet.”). No card links to it.

To add an author, copy author/melvile.html → author/jane.html, change the photo (author-jane.jpg, 120 × 120), the name in the breadcrumb and the title, the bio, the social links, the list of posts and the <head>; then add an entry to the search list and a line to sitemap.xml.

  1. The page. Copy an existing one, e.g. blog/the-importance-of-fit-in-fashion-balancing-comfort-and-style.html → blog/finding-your-calm.html. Use lower-case words joined by - for the file name; it becomes the address. Edit:

    • the breadcrumb’s last crumb (the category, ../category/fashion.html), the title (<h1>), the author’s photo, name and link, and the date (datetime and text);
    • the cover photo (src, alt, width and height);
    • the text: paragraphs, headings and lists, copied from the post (the article’s text);
    • “Related Posts”: three other posts of the same category, newest first, and “More Articles by …”: three other posts by the same author (its title names the author; its “View All” leads to the author’s page);
    • the <head>: title, description, canonical, og:url, the og: and twitter: titles and descriptions, the share image (og:image, twitter:image: the cover’s full address), og:image:alt and article:published_time (the date).
  2. Blog. Copy a card in blog.html (an <article> with its photo, category, title, author and date), paste it at the top and edit its links, photo and texts.

  3. Its category’s page and its author’s page. Add a card at the top of their lists (copy one from the same page).

  4. Home. Add its card at the top of “Latest” and remove the eighth; put it in the slider, Editor’s Pick or Trending if you want it there.

  5. The sidebar and the footer, if it should be in “Recent” or “Celebration” (every page that has them).

  6. Explore Topics. Add one to its category’s number (8 Post → 9 Post) in every page with a sidebar.

  7. Related Posts and More Articles on the other posts of its category and author, where it should appear.

  8. The search list. Add an entry in every page:

    {
    "title": "Finding Your Calm",
    "href": "/blog/finding-your-calm.html",
    "keywords": "The excerpt of the post. Fashion Melvile"
    },
  9. The sitemap. Add a line to sitemap.xml:

    <url><loc>https://yourdomain.com/blog/finding-your-calm.html</loc></url>

To remove a post, do the reverse: delete the page, its cards, its search entry and its line in sitemap.xml, and lower its category’s number. Search the folder for the file name to catch any link left behind.

A post’s text sits in one <div> after the cover, and uses a few tags (copy them from a post):

Block HTML
Paragraph <p class="not-first:mt-5">
Heading <h3 class="font-serif text-[22px] leading-[1.4] font-bold text-ink [&_strong]:font-black not-first:mt-10">, or a smaller <h4 class="font-serif text-lg leading-[1.4] font-semibold …">
Bulleted list <ul class="list-none not-first:mt-2.5"> with <li class="relative ps-[2ch] before:absolute before:start-0 before:content-['•']"><p>…</p></li>
Numbered list <ol class="list-none not-first:mt-2.5"> with <li class="relative ps-[2ch] … before:content-[counter(list-item)'.']"><p>…</p></li>
List inside a list item <ul class="list-none"> with before:content-['◦'] on its items, after the item’s <p>
Bold <strong class="font-bold"> inside a paragraph, a heading or a list item

The demo’s posts number their headings in the text (1. <strong …>Regulatory Landscape…</strong>), and most list items open with a bold label. “The Digital Transformation of Financial Services” shows a numbered list with lists inside its items.

assets/images/ holds every photo. The easiest change is to replace a file with yours under the same name: every page that shows it updates. The download ships with grey placeholders that state the size each image was designed for (for example 1600 × 1067).

To use a new file instead, change the src: <img src="assets/images/my-photo.jpg" …>. In pages inside a folder (blog/…, category/…, author/…), the path starts with ../: src="../assets/images/my-photo.jpg". In 404.html it starts at the site’s root: src="/assets/images/…". The width and height on the <img> are the photo’s own size: write your photo’s, so that the browser keeps its space while it loads.

Every photo sits in a fixed frame and is cropped to fill it (object-cover), so a photo of other proportions works, but you lose the edges the frame cuts. The same cover shows in wide, square-ish and round frames across the cards, so keep the subject near the middle. Use photos at least as large as the demo’s:

Photos Files Demo size
A post’s cover (its cards, the slider, the top of its page, its share image) post-<first words of the slug>.jpg 1600 wide, 900 to 2000 tall (most 1600 × 1067)
A category’s photo (its page; round in “Explore Topics”) category-<slug>.jpg 800 × 533 (Fashion’s 800 × 552)
An author’s photo (round: their page, their cards and posts) author-<slug>.jpg 120 × 120
The sidebar’s “Denzel” box widget-background.png 360 × 232
The 404 picture not-found.jpg 800 × 600

A post’s cover is used in every card of that post; replacing the file changes them all. Use .jpg for photos and keep files small; compress them with Squoosh or TinyPNG. Write an alt text for every photo that carries meaning (the demo describes each one); leave it empty (alt="") for decorative ones.

logo.svg is the logo (Making it look like your brand).

Pages link to each other as blog.html, blog/<slug>.html, category/<slug>.html; from inside a folder, add ../ (../blog.html). Keep the .html: it’s what lets the site work from any host and from disk. Two exceptions start at the site’s root, because they are shown at any address: the links and images of 404.html (/blog.html), and the href of the search list (/blog/<slug>.html).

The social links lead to the networks’ home pages until you change them. The mailto: link opens the visitor’s mail app. “By signing up, you agree to our Privacy Policy” under the newsletter is plain text: write a privacy page and link it there if you collect e-mails (Forms).

  1. Copy a page close to what you want, e.g. category/fashion.html → about.html for a page with the sidebar, or 404.html for a plain one (then write its links and images without the leading /, and remove its <meta name="robots" content="noindex, nofollow">).
  2. Replace the sections inside <main> with the ones you want. Every block in the template can be copied from its page (or from style-guide.html) and pasted between <main …> and </main>.
  3. Update the <head> (title, description, canonical, og:url, and the og: and twitter: titles and descriptions).
  4. If you copied a page that is in the menu, the copy marks that page as the current one: in the header’s two menus (the one for desktops and the phone menu), the current page’s link carries aria-current="page" and the struck-through grey look (text-grey line-through); the others say text-ink hover:text-accent hover:underline. Give the old link the plain look and remove its aria-current.
  5. Link to it: in the two menus, copy the <li> of a neighbouring link and change its href and its text. Keep data-close-menu on the phone menu’s links: it closes the menu when the link is pressed. The header is the same in every page of a folder apart from the current-page mark, so once one page is done, copy it into the others (pages in blog/, category/ and author/ write ../ before each link, and 404.html writes its links from the root). Add the page to sitemap.xml.

Delete the file, remove its links from the menus, the cards, the sidebar, the footer and the search list of every page, and its line from sitemap.xml. Search the folder for the file name to catch any link left behind.

style-guide.html shows every component with its name, which is handy for copying a card or a button. It’s hidden from search engines and linked from nowhere. Delete it before publishing if you don’t want it online.