Skip to content

Commit

Permalink
docs: add customization and update other pages
Browse files Browse the repository at this point in the history
chore: re-compile css and add icons
chore: update blog list layout
  • Loading branch information
imfing committed Aug 21, 2023
1 parent ce78845 commit 5821b02
Show file tree
Hide file tree
Showing 12 changed files with 172 additions and 139 deletions.
7 changes: 0 additions & 7 deletions assets/css/compiled/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -2126,10 +2126,6 @@ video {
margin-left: 1rem;
}

.ml-auto {
margin-left: auto;
}

.mr-1 {
margin-right: 0.25rem;
}
Expand Down Expand Up @@ -3811,9 +3807,6 @@ body {
.md\:inline-block {
display: inline-block;
}
.md\:inline {
display: inline;
}
.md\:hidden {
display: none;
}
Expand Down
2 changes: 2 additions & 0 deletions data/icons.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ cards: <svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor"
copy: <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" /></svg>
hamburger-menu: <svg fill="none" viewBox="0 0 24 24" stroke="currentColor"><g><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 8H20"></path></g><g><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16H20"></path></g></svg>
markdown: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M20.56 18H3.44C2.65 18 2 17.37 2 16.59V7.41C2 6.63 2.65 6 3.44 6h17.12c.79 0 1.44.63 1.44 1.41v9.18c0 .78-.65 1.41-1.44 1.41M6.81 15.19v-3.66l1.92 2.35l1.92-2.35v3.66h1.93V8.81h-1.93l-1.92 2.35l-1.92-2.35H4.89v6.38h1.92M19.69 12h-1.92V8.81h-1.92V12h-1.93l2.89 3.28L19.69 12Z"/></svg>
folder-tree: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path fill="currentColor" d="m 114.47781,81.538059 c 0,-13.785609 -11.07754,-24.923135 -24.78889,-24.923135 -13.711352,0 -24.788885,11.137526 -24.788885,24.923135 V 355.69254 c 0,27.49333 22.232532,49.84627 49.577775,49.84627 H 263.21112 V 355.69254 H 114.47781 V 181.2306 H 263.21112 V 131.38433 H 114.47781 Z M 288,206.15373 c 0,13.78561 11.07753,24.92314 24.78888,24.92314 h 173.5222 c 13.71135,0 24.78888,-11.13753 24.78888,-24.92314 v -99.69254 c 0,-13.785605 -11.07753,-24.923131 -24.78888,-24.923131 h -76.45822 c -6.58454,0 -12.85923,-2.648083 -17.50715,-7.321171 L 382.04283,63.936095 c -4.64791,-4.673088 -10.9226,-7.321171 -17.50715,-7.321171 h -51.7468 C 299.07753,56.614924 288,67.75245 288,81.538059 Z m 0,224.30821 c 0,13.78561 11.07753,24.92314 24.78888,24.92314 h 173.5222 c 13.71135,0 24.78888,-11.13753 24.78888,-24.92314 V 330.7694 c 0,-13.78561 -11.07753,-24.92313 -24.78888,-24.92313 h -76.45822 c -6.58454,0 -12.85923,-2.64808 -17.50715,-7.32117 l -10.30288,-10.35868 c -4.64791,-4.67309 -10.9226,-7.32117 -17.50715,-7.32117 h -51.7468 C 299.07753,280.84525 288,291.98278 288,305.76838 Z" style="stroke-width:0.776747" /></svg>
card: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15"><path fill="currentColor" fill-rule="evenodd" d="M14 11V4H1v7h13Zm1-7v7a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h13a1 1 0 0 1 1 1ZM2 5.25A.25.25 0 0 1 2.25 5h3.5a.25.25 0 0 1 .25.25v4.5a.25.25 0 0 1-.25.25h-3.5A.25.25 0 0 1 2 9.75v-4.5ZM7.5 7a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1h-3ZM7 9.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5ZM7.5 5a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1h-4Z" clip-rule="evenodd"/></svg>

# Icons from heroicons v1 outlined https://github.com/tailwindlabs/heroicons/tree/v1
academic-cap: <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path d="M12 14l9-5-9-5-9 5 9 5z"/><path d="M12 14l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14z"/><path stroke-linecap="round" stroke-linejoin="round" d="M12 14l9-5-9-5-9 5 9 5zm0 0l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14zm-4 6v-7.5l4-2.222"/></svg>
Expand Down
1 change: 1 addition & 0 deletions exampleSite/content/about/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: About
toc: false
---

This is the about page.
2 changes: 1 addition & 1 deletion exampleSite/content/blog/_index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
title: "Hextra Blog"
title: "Blog"
---
215 changes: 94 additions & 121 deletions exampleSite/content/blog/markdown.md
Original file line number Diff line number Diff line change
@@ -1,176 +1,149 @@
---
title: Markdown
math: true
title: Markdown Syntax Guide
date: 2020-01-01
authors:
- name: John Doe
link: https://example.com/johndoe
image: https://example.com/johndoe.png
- name: John Doe
link: https://example.com/johndoe
excludeSearch: true
---

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 with CSS in a Hugo theme.
This article offers a sample of basic Markdown syntax that can be used in Hugo content files.
<!--more-->

## Headings
## Basic Syntax

The following HTML `<h1>``<h6>` elements represent six levels of section headings. `<h1>` is the highest section level while `<h6>` is the lowest.
### Headings

# H1
## H2
### H3
#### H4
##### H5
###### H6

## Paragraph

Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat.

Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.

## Blockquotes

The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations.
```
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
```

#### Blockquote without attribution
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6

> Tiam, ad mint andaepu dandae nostion secatur sequo quae.
> **Note** that you can use *Markdown syntax* within a blockquote.
### Emphasis

#### Blockquote with attribution
```text
*This text will be italic*
_This will also be italic_
> Don't communicate by sharing memory, share memory by communicating.<br>
> — <cite>Rob Pike[^1]</cite>
**This text will be bold**
__This will also be bold__
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
_You **can** combine them_
```

## Tables
*This text will be italic*

Tables aren't part of the core Markdown spec, but Hugo supports them out-of-the-box.
_This will also be italic_

Name | Age
--------|------
Bob | 27
Alice | 23
**This text will be bold**

#### Inline Markdown within tables
__This will also be bold__

| Italics | Bold | Code |
| -------- | -------- | ------ |
| *italics* | **bold** | `code` |
_You **can** combine them_

## Code Blocks
### Lists

### Code block with triple backticks
#### Unordered

```
def say_hello():
print("Hello!")
* Item 1
* Item 2
* Item 2a
* Item 2b
```

* Item 1
* Item 2
* Item 2a
* Item 2b

```python
def say_hello():
print("Hello!")
```

### Code block with filename
#### Ordered

```python {filename="hello.py"}
def say_hello():
print("Hello!")
```
1. Item 1
2. Item 2
3. Item 3
1. Item 3a
2. Item 3b
```

### Code block highlight with line numbers

```python {linenos=table,hl_lines=[1, 2],linenostart=1}
def say_hello():
print("Hello!")
### Images

def main():
say_hello()
```markdown
![GitHub Logo](https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png)
```

```python {linenos=table,hl_lines=[1, 2],linenostart=1,filename="hello.py"}
def say_hello():
print("Hello!")
![GitHub Logo](https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png)

def main():
say_hello()
```
### Links

## Diagrams

[Mermaid](https://github.com/mermaid-js/mermaid#readme) is a JavaScript based diagramming and charting tool that takes Markdown-inspired text definitions and creates diagrams dynamically in the browser.

```mermaid
sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts <br/>prevail!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
```markdown
[Hugo](https://gohugo.io)
```

## List Types
[Hugo](https://gohugo.io)

#### Ordered List
### Blockquotes

1. First item
2. Second item
3. Third item
```markdown
As Newton said:

#### Unordered List
> If I have seen further it is by standing on the shoulders of Giants.
```

* List item
* Another item
* And another item
> If I have seen further it is by standing on the shoulders of Giants.
#### Nested list
### Inline Code

* Fruit
* Apple
* Orange
* Banana
* Dairy
* Milk
* Cheese
```markdown
Inline `code` has `back-ticks around` it.
```

## Math
Inline `code` has `back-ticks around` it.

[KaTeX](https://github.com/KaTeX/KaTeX) is a fast math typesetting library for the web. It uses javascript for client-side rendering.
### Code Blocks

### Inline
#### Syntax Highlighting

````markdown
```go
func main() {
fmt.Println("Hello World")
}
```
This $\int\limits_1^\infty \frac{1}{k}\,dk$ is inline.
```

This $\int\limits_1^\infty \frac{1}{k}\,dk$ is inline.

### Separate Paragraph
````

```go
func main() {
fmt.Println("Hello World")
}
```
$$f(x) = \int_{-\infty}^\infty \hat f(\xi)\,e^{2 \pi i \xi x} \,d\xi$$
```

$$f(x) = \int_{-\infty}^\infty \hat f(\xi)\,e^{2 \pi i \xi x} \,d\xi$$


## Other Elements — abbr, sub, sup, kbd, mark
### Tables

<abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format.

H<sub>2</sub>O
```markdown
| Syntax | Description |
| --------- | ----------- |
| Header | Title |
| Paragraph | Text |
```

X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>
| Syntax | Description |
| --------- | ----------- |
| Header | Title |
| Paragraph | Text |

Press <kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>Delete</kbd> to end the session.
## References

Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms, and other small creatures.
- [Markdown Syntax](https://www.markdownguide.org/basic-syntax/)
- [Hugo Markdown](https://gohugo.io/content-management/formats/#markdown)
5 changes: 4 additions & 1 deletion exampleSite/content/docs/advanced/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ linkTitle: Advanced
title: Advanced Topics
---

This section covers some advanced topics of the theme.

<!--more-->

{{< cards >}}
{{< card link="multi-language" title="Multi-language" icon="translate" >}}
{{< card link="deployment" title="Deployment" icon="server" >}}
{{< card link="customization" title="Customization" icon="pencil" >}}
{{< /cards >}}
52 changes: 51 additions & 1 deletion exampleSite/content/docs/advanced/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,56 @@ title: Customizing Hextra
linkTitle: Customization
---

Hextra offers some default customization options in the `hugo.yaml` config file to configure the theme.
This page describes the available options and how to customize the theme further.

<!--more-->

## Custom CSS

To add custom CSS, we need to create a file `assets/css/custom.css` in our site. Hextra will automatically load this file.
To add custom CSS, we need to create a file `assets/css/custom.css` in our site. Hextra will automatically load this file. For example, customize the font family of the content:

```css {filename="assets/css/custom.css"}
.content {
font-family: "Times New Roman", Times, serif;
}
```

### Primary Color

The primary color of the theme can be customized by setting the `--primary-hue` variable:

```css {filename="assets/css/custom.css"}
:root {
--primary-hue: 100deg;
}
```

### Syntax Highlighting

List of available syntax highlighting themes are available at [Chroma Styles Gallery](https://xyproto.github.io/splash/docs/all.html). The stylesheet can be generated using the command:

```bash
$ hugo gen chromastyles --style=github
```

To override the default syntax highlighting theme, we can add the generated styles to the custom CSS file.

## Custom Scripts

You may add custom scripts to the end of the head for every page by adding the following file:

```
layouts/partials/custom/head-end.html
```

## Custom Layouts

The layouts of the theme can be overridden by creating a file with the same name in the `layouts` directory of your site.
For example, to override the `single.html` layout for docs, create a file `layouts/docs/single.html` in your site.

For further information, refer to the [Hugo Templates](https://gohugo.io/templates/).

## Further Customization

Didn't find what you were looking for? Feel free to [open an issue](https://github.com/imfing/hextra/issues) or make a contribution to the theme!
Loading

0 comments on commit 5821b02

Please sign in to comment.