My New Hugo Site

  1. Bash
    1. Filters
      1. grep
      2. Sed
      3. jq
    2. Shellspec
  2. Design
  3. Architectural Patterns
    1. Systemd
    2. Message Broker
    3. JSON-RPC
  4. Go
    1. Concurrency
    2. Web Applications
    3. Compound Data
    4. Json
    5. Go vs Erlang
  5. Prolog Cookbook
  6. Documentation
    1. Hugo
      1. Go Html Template
      2. Table of Contents
    2. HTML
    3. CSS
      1. Color
      2. Style Guides
      3. Layout
    4. Mathjax
  7. Visualization
    1. D3
      1. Venn Diagrams
    2. SVG
    3. Visjs
      1. Network
  8. Data
    1. Yaml
    2. Events
      1. JSON-LD
    3. JSON
      1. jCal
    4. SQL
  9. JavaScript

HTML

Content categories

display

html block
├── head none Metadata
│   ├── title none
│   └── link none
└── body block Flow
    ├── header block

block

inline-block

table

none

flex

Not set by default for any elements

grid

Not set by default for any elements

Semantic Elements

w3schools

html
├── head
└── body
    ├── header
    ├── nav
    ├── main
    └── footer

By convention, I use HTML’s section to correspond with Hugo’s section, ie subdirectories or branches, while HTML’s article are Hugo’s single page. The corresponding URL structure is ‘/section/article’

  1. Mozilla
    1. Basics
    2. Forms
tidy \
  -indent \
  --indent-spaces 2 \
  -quiet \
  --tidy-mark no \
  index.html

Sending forms through JavaScript

Fetch Living Standard

Fetch API

Using Fetch

Simple example:

fetch('http://example.com/movies.json')
  .then(response => response.json())
  .then(data => console.log(data));

Response Object

With the optional init second parameter:

const data = { username: 'example' };

fetch('https://example.com/profile', {
  method: 'POST', // or 'PUT'
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(data),
})
.then(response => response.json())
.then(data => {
  console.log('Success:', data);
})
.catch((error) => {
  console.error('Error:', error);
});

FormData instead of JSON

HTMLFormElement

const form = new FormData(document.getElementById('login-form'));
fetch('/login', {
  method: 'POST',
  body: form
});