~nora/hugo-sandbox

98f1370d2a21a382ac86ee7f3ee80cfc64da197b — nora 4 months ago
Initial commit
A  => .gitignore +3 -0
@@ 1,3 @@
public/
resources/
.hugo_build.lock
\ No newline at end of file

A  => .gitmodules +4 -0
@@ 1,4 @@
[submodule "themes/congo"]
	path = themes/congo
	url = https://github.com/jpanther/congo.git
	branch = stable

A  => LICENSE +19 -0
@@ 1,19 @@
Copyright (c) 2024 nora

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

A  => README.md +56 -0
@@ 1,56 @@
## Hugo Sandbox

This is a sandbox to play with Hugo framework.

### Creating a new project

See [Hugo documentation](https://gohugo.io/getting-started/quick-start/) and [Congo theme documentation](https://jpanther.github.io/congo/docs/installation/).

Install the following tools.

    pacman -S git hugo hut

- [git](https://git-scm.com/): version control system
- [hugo](https://gohugo.io/): static site generator
- [hut](https://sr.ht/~emersion/hut/): deployment tool for sourcehut

Create a new project.

    hugo new site hugo-sandbox
    cd hugo-sandbox
    git init

Add a theme ([Congo theme](https://github.com/jpanther/congo)).

    git submodule add -b stable https://github.com/jpanther/congo.git themes/congo
    echo "theme = 'congo'" >> hugo.toml

Update theme.

    git submodule update --remote --merge

### Adding content

Add content.

    hugo new content pages/page.md

Commit and push changes with git.

### Testing

Run server (-D option include draft content).

    hugo server
    hugo server -D

You can find the website locally at <http://localhost:1313>.

### Publishing

Publish on [sourcehut pages](https://srht.site/).

    hugo
    hut pages publish -d nora.srht.site public

You can find the website at <https://nora.srht.site>.

A  => archetypes/default.md +5 -0
@@ 1,5 @@
+++
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
date = {{ .Date }}
draft = true
+++

A  => assets/icons/rss.svg +1 -0
@@ 1,1 @@
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>RSS</title><path fill="currentColor" d="M19.199 24C19.199 13.467 10.533 4.8 0 4.8V0c13.165 0 24 10.835 24 24h-4.801zM3.291 17.415c1.814 0 3.293 1.479 3.293 3.295 0 1.813-1.485 3.29-3.301 3.29C1.47 24 0 22.526 0 20.71s1.475-3.294 3.291-3.295zM15.909 24h-4.665c0-6.169-5.075-11.245-11.244-11.245V8.09c8.727 0 15.909 7.184 15.909 15.91z"/></svg>
\ No newline at end of file

A  => assets/icons/sourcehut.svg +1 -0
@@ 1,1 @@
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>SourceHut</title><path fill="currentColor" d="M12 0C5.371 0 0 5.371 0 12s5.371 12 12 12 12-5.371 12-12S18.629 0 12 0Zm0 21.677A9.675 9.675 0 0 1 2.323 12 9.675 9.675 0 0 1 12 2.323 9.675 9.675 0 0 1 21.677 12 9.675 9.675 0 0 1 12 21.677Z"/></svg>
\ No newline at end of file

A  => assets/img/icon.png +0 -0
A  => assets/img/icon.svg +4 -0
@@ 1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
  <rect width="16" height="16" x="0" y="0" rx="3" ry="3" fill="#2B2B2B"/>
  <rect width="13" height="3" x="1.5" y="6.5" rx="0.5" ry="0.5" transform="rotate(-45, 8, 8)" fill="#F03542"/>
</svg>
\ No newline at end of file

A  => config/_default/config.toml +14 -0
@@ 1,14 @@
# -- Site Configuration --
# Refer to the theme docs for more details about each of these parameters.
# https://jpanther.github.io/congo/docs/getting-started/

theme = "congo"
baseURL = "https://nora.nckm.eu/"
defaultContentLanguage = "en"

enableRobotsTXT = true
paginate = 10
summaryLength = 0

[outputs]
  home = ["HTML", "RSS", "JSON"]

A  => config/_default/languages.en.toml +25 -0
@@ 1,25 @@
languageCode = "en"
languageName = "English"
languageDirection = "ltr"
weight = 1

title = "NO/RA"
# copyright = "Copy, _right?_ :thinking_face:"

[params]
  dateFormat = "2 January 2006"

  # mainSections = ["section1", "section2"]
  description = "My awesome website"

[params.author]
   name = "nora"
   image = "img/icon.svg"
   headline = "I'm a developer"
   bio = "Un commentaire sur un de mes articles ? Commencez une discussion sur ma [liste de diffusion](https://lists.sr.ht/~nora/public-inbox)"
   links = [
     { email = "mailto:nora@nckm.eu" },
     { link = "https://nora.nckm.eu/" },
     { sourcehut = "https://sr.ht/~nora/" },
     { mastodon = "https://mamot.fr/@nora" },
   ]

A  => config/_default/markup.toml +13 -0
@@ 1,13 @@
# -- Markup --
# These settings are required for the theme to function.

[goldmark]
[goldmark.renderer]
  unsafe = true

[highlight]
  noClasses = false

[tableOfContents]
  startLevel = 2
  endLevel = 4

A  => config/_default/menus.en.toml +54 -0
@@ 1,54 @@
# -- Main Menu --
# The main menu is displayed in the header at the top of the page.
# Acceptable parameters are name, pageRef, page, url, title, weight.
#
# The simplest menu configuration is to provide:
#   name = The name to be displayed for this menu link
#   pageRef = The identifier of the page or section to link to
#
# By default the menu is ordered alphabetically. This can be
# overridden by providing a weight value. The menu will then be
# ordered by weight from lowest to highest.

[[main]]
  name = "Articles"
  pageRef = "posts"
  weight = 10

[[main]]
  name = "Contact"
  pageRef = "contact"
  weight = 20

[[main]]
  name = "RSS"
  url = "/index.xml"
  weight = 98
  [main.params]
    icon = "rss"
    showName = false

[[main]]
  identifier = "search"
  weight = 99
  [main.params]
    action = "search"

[[main]]
  identifier = "locale"
  weight = 100
  [main.params]
    action = "locale"

# -- Footer Menu --
# The footer menu is displayed at the bottom of the page, just before
# the copyright notice. Configure as per the main menu above.

[[footer]]
  name = "Categories"
  pageRef = "categories"
  weight = 10
[[footer]]
  name = "Tags"
  pageRef = "tags"
  weight = 20

A  => config/_default/module.toml +3 -0
@@ 1,3 @@
[hugoVersion]
  extended = true
  min = "0.87.0"

A  => config/_default/params.toml +96 -0
@@ 1,96 @@
# -- Theme Options --
# These options control how the theme functions and allow you to
# customise the display of your website.
#
# Refer to the theme docs for more details about each of these parameters.
# https://jpanther.github.io/congo/docs/configuration/#theme-parameters

colorScheme = "default"
defaultAppearance = "light" # valid options: light or dark
autoSwitchAppearance = true

enableSearch = true
enableCodeCopy = true
enableImageLazyLoading = true
enableImageWebp = true

# robots = ""
fingerprintAlgorithm = "sha256"

[header]
  layout = "hybrid" # valid options: basic, hamburger, hybrid, custom
  # logo = "img/logo.png"
  # logoDark = "img/dark-logo.png"
  showTitle = true

[footer]
  showCopyright = true
  showThemeAttribution = true
  showAppearanceSwitcher = true
  showScrollToTop = true

[homepage]
  layout = "profile" # valid options: page, profile, custom
  showRecent = false
  recentLimit = 5

[article]
  showDate = true
  showDateUpdated = true
  showAuthor = true
  showBreadcrumbs = false
  showDraftLabel = true
  # showEdit = true
  # editURL = "https://github.com/username/repo/"
  editAppendPath = true
  showHeadingAnchors = true
  showPagination = true
  invertPagination = false
  showReadingTime = true
  showTableOfContents = true
  showTaxonomies = true
  showWordCount = true
  showComments = false
  # sharingLinks = ["facebook", "twitter", "mastodon", "pinterest", "reddit", "linkedin", "email", "telegram", "line", "weibo"]

[list]
  showBreadcrumbs = false
  showSummary = false
  showTableOfContents = false
  showTaxonomies = false
  groupByYear = false
  paginationWidth = 1

[sitemap]
  excludedKinds = ["taxonomy", "term"]

[taxonomy]
  showTermCount = true

[fathomAnalytics]
  # site = "ABC12345"

[plausibleAnalytics]
  # domain = "blog.yoursite.com"
  # event = ""
  # script = ""

[verification]
  # google = ""
  # bing = ""
  # pinterest = ""
  # yandex = ""

[privacy]
  [privacy.disqus]
    disable = true
  [privacy.googleAnalytics]
    disable = true
  [privacy.instagram]
    disable = true
  [privacy.twitter]
    disable = true
  [privacy.vimeo]
    disable = true
  [privacy.youtube]
    disable = true
\ No newline at end of file

A  => content/posts/congo.md +40 -0
@@ 1,40 @@
+++
categories = ['Development']
title = 'Congo theme'
date = 2024-02-22T15:48:53+01:00
draft = true
+++

## CodeHilite

```python
# Comment
var = "Hello world!"
print(var)
```

## Alert

{{< alert >}}
**Warning!** This action is destructive!
{{< /alert >}}

{{< alert "mastodon" >}}
Don't forget to [follow me](https://mamot.fr/@nora) on Mastodon :thinking_face:.
{{< /alert >}}

## Badge and icon

{{< badge >}}
New article!
{{< /badge >}}

Send me an {{< icon "email" >}}.

## Mermaid

{{< mermaid >}}
graph LR;
A[Lemons]-->B[Lemonade];
B-->C[Profit]
{{< /mermaid >}}

A  => content/posts/content.md +40 -0
@@ 1,40 @@
+++
categories = ['Development']
title = 'External Content'
date = 2024-02-20T16:46:45+01:00
draft = true
+++

## Image

<img src="https://source.unsplash.com/mZnx9429i94" alt="Image"></img>

Photo by [Juanjo Jaramillo](https://unsplash.com/@juanjodev02) on [Unsplash](https://unsplash.com/)

[![Image](https://source.unsplash.com/mZnx9429i94 "Photo by Juanjo Jaramillo on Unsplash")](https://source.unsplash.com/mZnx9429i94/1920x1080)

![Image](https://source.unsplash.com/random/?code,python "Photo from Unsplash")

## Audio

<audio src="https://upload.wikimedia.org/wikipedia/commons/9/9b/Casio_vl1_rock1.ogg" controls></audio>

[Havelbaude](https://commons.wikimedia.org/wiki/File:Casio_vl1_rock1.ogg), [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0), via Wikimedia Commons

## Video

<video src="https://upload.wikimedia.org/wikipedia/commons/b/be/Am7_Percussive_Bass_Tapping.webm" controls preload="none"></video>

[Bob William](https://commons.wikimedia.org/wiki/File:Am7_Percussive_Bass_Tapping.webm), [CC BY 3.0](https://creativecommons.org/licenses/by/3.0), via Wikimedia Commons

<iframe width="560" height="315" title="Big Buck Bunny" src="https://www.youtube-nocookie.com/embed/aqz-KE-bpKQ?t=9" allowfullscreen></iframe>

{{< youtube id="aqz-KE-bpKQ?t=9" title="Big Buck Bunny" >}}

## Map

[![Map](/img/map.png)](https://www.openstreetmap.org/?mlat=48.38220&mlon=-4.37294#map=18/48.38220/-4.37294)

<iframe width="425" height="350" title="Map" src="https://www.openstreetmap.org/export/embed.html?bbox=-4.377424120903016%2C48.380582577028676%2C-4.368465542793275%2C48.3838247464713&amp;layer=mapnik&amp;marker=48.382203687563766%2C-4.3729448318481445"></iframe>

[Show larger map](https://www.openstreetmap.org/?mlat=48.38220&amp;mlon=-4.37294#map=18/48.38220/-4.37294)

A  => content/posts/test.md +359 -0
@@ 1,359 @@
+++
categories = ['Development']
title = 'Markdown Syntax'
date = 2024-02-19T15:18:19+01:00
draft = false
+++

## Overview

### Philosophy

Markdown is intended to be as easy-to-read and easy-to-write as is feasible.

Readability, however, is emphasized above all else. A Markdown-formatted
document should be publishable as-is, as plain text, without looking
like it's been marked up with tags or formatting instructions. While
Markdown's syntax has been influenced by several existing text-to-HTML
filters -- including [Setext](http://docutils.sourceforge.net/mirror/setext.html), [atx](http://www.aaronsw.com/2002/atx/), [Textile](http://textism.com/tools/textile/), [reStructuredText](http://docutils.sourceforge.net/rst.html),
[Grutatext](http://www.triptico.com/software/grutatxt.html), and [EtText](http://ettext.taint.org/doc/) -- the single biggest source of
inspiration for Markdown's syntax is the format of plain text email.

## Block Elements

### Paragraphs and Line Breaks

A paragraph is simply one or more consecutive lines of text, separated
by one or more blank lines. (A blank line is any line that looks like a
blank line -- a line containing nothing but spaces or tabs is considered
blank.) Normal paragraphs should not be indented with spaces or tabs.

The implication of the "one or more consecutive lines of text" rule is
that Markdown supports "hard-wrapped" text paragraphs. This differs
significantly from most other text-to-HTML formatters (including Movable
Type's "Convert Line Breaks" option) which translate every line break
character in a paragraph into a `<br />` tag.

When you *do* want to insert a `<br />` break tag using Markdown, you
end a line with two or more spaces, then type return.

### Headers

Markdown supports two styles of headers, [Setext] [1] and [atx] [2].

Optionally, you may "close" atx-style headers. This is purely
cosmetic -- you can use this if you think it looks better. The
closing hashes don't even need to match the number of hashes
used to open the header. (The number of opening hashes
determines the header level.)


### Blockquotes

Markdown uses email-style `>` characters for blockquoting. If you're
familiar with quoting passages of text in an email message, then you
know how to create a blockquote in Markdown. It looks best if you hard
wrap the text and put a `>` before every line:

> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
> 
> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
> id sem consectetuer libero luctus adipiscing.

Markdown allows you to be lazy and only put the `>` before the first
line of a hard-wrapped paragraph:

> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.

> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
id sem consectetuer libero luctus adipiscing.

Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by
adding additional levels of `>`:

> This is the first level of quoting.
>
> > This is nested blockquote.
>
> Back to the first level.

Blockquotes can contain other Markdown elements, including headers, lists,
and code blocks:

> ##### This is a header.
> 
> 1.   This is the first list item.
> 2.   This is the second list item.
> 
> Here's some example code:
> 
>     return shell_exec("echo $input | $markdown_script");

Any decent text editor should make email-style quoting easy. For
example, with BBEdit, you can make a selection and choose Increase
Quote Level from the Text menu.


### Lists

Markdown supports ordered (numbered) and unordered (bulleted) lists.

Unordered lists use asterisks, pluses, and hyphens -- interchangeably
-- as list markers:

*   Red
*   Green
*   Blue

is equivalent to:

+   Red
+   Green
+   Blue

and:

-   Red
-   Green
-   Blue

Ordered lists use numbers followed by periods:

1.  Bird
2.  McHale
3.  Parish

It's important to note that the actual numbers you use to mark the
list have no effect on the HTML output Markdown produces. The HTML
Markdown produces from the above list is:

If you instead wrote the list in Markdown like this:

1.  Bird
1.  McHale
1.  Parish

or even:

3. Bird
1. McHale
8. Parish

you'd get the exact same HTML output. The point is, if you want to,
you can use ordinal numbers in your ordered Markdown lists, so that
the numbers in your source match the numbers in your published HTML.
But if you want to be lazy, you don't have to.

To make lists look nice, you can wrap items with hanging indents:

*   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
    Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
    viverra nec, fringilla in, laoreet vitae, risus.
*   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
    Suspendisse id sem consectetuer libero luctus adipiscing.

But if you want to be lazy, you don't have to:

*   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
viverra nec, fringilla in, laoreet vitae, risus.
*   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
Suspendisse id sem consectetuer libero luctus adipiscing.

List items may consist of multiple paragraphs. Each subsequent
paragraph in a list item must be indented by either 4 spaces
or one tab:

1.  This is a list item with two paragraphs. Lorem ipsum dolor
    sit amet, consectetuer adipiscing elit. Aliquam hendrerit
    mi posuere lectus.

    Vestibulum enim wisi, viverra nec, fringilla in, laoreet
    vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
    sit amet velit.

2.  Suspendisse id sem consectetuer libero luctus adipiscing.

It looks nice if you indent every line of the subsequent
paragraphs, but here again, Markdown will allow you to be
lazy:

*   This is a list item with two paragraphs.

    This is the second paragraph in the list item. You're
only required to indent the first line. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit.

*   Another item in the same list.

To put a blockquote within a list item, the blockquote's `>`
delimiters need to be indented:

*   A list item with a blockquote:

    > This is a blockquote
    > inside a list item.

To put a code block within a list item, the code block needs
to be indented *twice* -- 8 spaces or two tabs:

*   A list item with a code block:

        <code goes here>

### Code Blocks

Pre-formatted code blocks are used for writing about programming or
markup source code. Rather than forming normal paragraphs, the lines
of a code block are interpreted literally. Markdown wraps a code block
in both `<pre>` and `<code>` tags.

To produce a code block in Markdown, simply indent every line of the
block by at least 4 spaces or 1 tab.

This is a normal paragraph:

    This is a code block.

Here is an example of AppleScript:

    tell application "Foo"
        beep
    end tell

A code block continues until it reaches a line that is not indented
(or the end of the article).

Within a code block, ampersands (`&`) and angle brackets (`<` and `>`)
are automatically converted into HTML entities. This makes it very
easy to include example HTML source code using Markdown -- just paste
it and indent it, and Markdown will handle the hassle of encoding the
ampersands and angle brackets. For example, this:

    <div class="footer">
        &copy; 2004 Foo Corporation
    </div>

Regular Markdown syntax is not processed within code blocks. E.g.,
asterisks are just literal asterisks within a code block. This means
it's also easy to use Markdown to write about Markdown's own syntax.

```
tell application "Foo"
    beep
end tell
```

## Span Elements

### Links

Markdown supports two style of links: *inline* and *reference*.

In both styles, the link text is delimited by [square brackets].

To create an inline link, use a set of regular parentheses immediately
after the link text's closing square bracket. Inside the parentheses,
put the URL where you want the link to point, along with an *optional*
title for the link, surrounded in quotes. For example:

This is [an example](http://example.com/ "Title") inline link.

[This link](http://example.net/) has no title attribute.

### Emphasis

Markdown treats asterisks (`*`) and underscores (`_`) as indicators of
emphasis. Text wrapped with one `*` or `_` will be wrapped with an
HTML `<em>` tag; double `*`'s or `_`'s will be wrapped with an HTML
`<strong>` tag. E.g., this input:

*single asterisks*

_single underscores_

**double asterisks**

__double underscores__

### Code

To indicate a span of code, wrap it with backtick quotes (`` ` ``).
Unlike a pre-formatted code block, a code span indicates code within a
normal paragraph. For example:

Use the `printf()` function.

## Extensions

### Definition lists

A definition list is a list of word with their description:

    Apple
    :   Pomaceous fruit of plants of the genus Malus in
        the family Rosaceae.

    Orange
    :   The fruit of an evergreen tree of the genus Citrus.

Rendered as:

Apple
:   Pomaceous fruit of plants of the genus Malus in
    the family Rosaceae.

Orange
:   The fruit of an evergreen tree of the genus Citrus.

### CodeHilite

The CodeHilite extension adds code syntax highlighting. The pygments package must be installed. Then a CSS style can be generated by:

    pygmentize -S default -f html -a .codehilite > styles.css

Indented code block must start with `:::language` and lines can be highlighted with `hl_lines` option: `:::python hl_lines="1 4"`.

Will result in:

    :::python hl_lines="1 4"
    # This line is emphasized
    var = "Hello world!"
    print(var)
    # This line is emphasized

Fenced code block must start with ` ``` `:

``` { .python hl_lines="1 4" }
# This line is emphasized
var = "Hello world!"
print(var)
# This line is emphasized
```

### Fenced Code Blocks and diagrams
You can define diagrams using a fenced code block with `mermaid` language:

    ```mermaid
    graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
    ```

Will be rendered as:

```mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```

----

A  => static/img/map.png +0 -0
A  => themes/congo +1 -0
@@ 1,1 @@
Subproject commit c89d4ac5b000ba06a20584079e7e7b67059607ea