News
NEWeSAR for NBA Accreditation of Electronics & Communication Engineering Department Submitted to NBA – View Document(27 Feb 2026)NEWAdmissions Open for Academic Year 2026-27 – Apply Now via ACPDC Portal(1 Feb 2026)NEWGTU Winter Examination 2025 – Revised Timetable Published(25 Jan 2026)NEWGuest Faculty Recruitment 2026 – Applications Invited for Engineering Departments(20 Jan 2026)SSIP Grant 2025-26 – Submit Your Innovation Proposals by 28 February 2026(15 Jan 2026)Annual Technical Fest "INNOVATE 2026" – Registration Open for All Events(10 Jan 2026)GTU Semester 3 Examination Results Declared – Check Results on GTU Portal(5 Jan 2026)Library: 250+ New Technical Books Added – Available for Borrowing from 1 Feb 2026(2 Jan 2026)Holiday List for Year 2026 Published – View Official Calendar(1 Jan 2026)NEW(27 Feb 2026)NEW(1 Feb 2026)NEW(25 Jan 2026)NEW(20 Jan 2026)(15 Jan 2026)(10 Jan 2026)GTU Semester 3 Examination Results Declared – Check Results on GTU Portal(5 Jan 2026)(2 Jan 2026)(1 Jan 2026)

Code Syntax Guide

March 10, 2019
2 min read
Categories:

Inline Code

This is Inline Code

Only pre

This is pre text

Code block with backticks

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Example HTML5 Document</title>
    <meta
      name="description"
      content="Sample article showcasing basic Markdown syntax and formatting for HTML elements."
    />
  </head>
  <body>
    <p>Test</p>
  </body>
</html>

Code block with backticks and language specified

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Example HTML5 Document</title>
    <meta
      name="description"
      content="Sample article showcasing basic Markdown syntax and formatting for HTML elements."
    />
  </head>
  <body>
    <p>Test</p>
  </body>
</html>

Code block with backticks and language specified with line numbers

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Example HTML5 Document</title>
    <meta
      name="description"
      content="Sample article showcasing basic Markdown syntax and formatting for HTML elements."
    />
  </head>
  <body>
    <p>Test</p>
  </body>
</html>

Code block with line numbers and highlighted lines

  • PaperMod supports linenos=true or linenos=table
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Example HTML5 Document</title>
    <meta
      name="description"
      content="Sample article showcasing basic Markdown syntax and formatting for HTML elements."
    />
  </head>
  <body>
    <p>Test</p>
  </body>
</html>
  • With linenos=inline line might not get highlighted properly.
  • This issue is fixed with 045c084
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Example HTML5 Document</title>
    <meta
      name="description"
      content="Sample article showcasing basic Markdown syntax and formatting for HTML elements."
    />
  </head>
  <body>
    <p>Test</p>
  </body>
</html>

Code block indented with four spaces

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Example HTML5 Document</title>
</head>
<body>
  <p>Test</p>
</body>
</html>

Code block with Hugo's internal highlight shortcode

Example HTML5 Document

Test

Github Gist

Related Posts

Markdown Syntax Guide

March 11, 2019

This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated...

markdown
css
html
+1

This post demonstrates how to use Mermaid diagrams in Hugo. Mermaid lets you create diagrams and visualizations using text and code. ## Flowchart Ex...

mermaid
diagrams
markdown

Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-management/shortcodes/#use-hugos-built-in-shortcodes) for rich content, along...

markdown
shortcodes
privacy