diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index 5c81737..9431b30 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -2126,10 +2126,6 @@ video { margin-left: 1rem; } -.ml-auto { - margin-left: auto; -} - .mr-1 { margin-right: 0.25rem; } @@ -3811,9 +3807,6 @@ body { .md\:inline-block { display: inline-block; } - .md\:inline { - display: inline; - } .md\:hidden { display: none; } diff --git a/data/icons.yaml b/data/icons.yaml index 8bbc493..d8eae72 100644 --- a/data/icons.yaml +++ b/data/icons.yaml @@ -27,6 +27,8 @@ cards: hamburger-menu: markdown: +folder-tree: +card: # Icons from heroicons v1 outlined https://github.com/tailwindlabs/heroicons/tree/v1 academic-cap: diff --git a/exampleSite/content/about/index.md b/exampleSite/content/about/index.md index cfc49b5..78db974 100644 --- a/exampleSite/content/about/index.md +++ b/exampleSite/content/about/index.md @@ -1,5 +1,6 @@ --- title: About +toc: false --- This is the about page. diff --git a/exampleSite/content/blog/_index.md b/exampleSite/content/blog/_index.md index 9873cf8..59db226 100644 --- a/exampleSite/content/blog/_index.md +++ b/exampleSite/content/blog/_index.md @@ -1,3 +1,3 @@ --- -title: "Hextra Blog" +title: "Blog" --- diff --git a/exampleSite/content/blog/markdown.md b/exampleSite/content/blog/markdown.md index 8653d96..782786f 100644 --- a/exampleSite/content/blog/markdown.md +++ b/exampleSite/content/blog/markdown.md @@ -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. -## Headings +## Basic Syntax -The following HTML `

`—`

` elements represent six levels of section headings. `

` is the highest section level while `

` is the lowest. - -# 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. - -#### Blockquote without attribution - -> Tiam, ad mint andaepu dandae nostion secatur sequo quae. -> **Note** that you can use *Markdown syntax* within a blockquote. - -#### Blockquote with attribution - -> Don't communicate by sharing memory, share memory by communicating.
-> — Rob Pike[^1] - -[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. - -## Tables - -Tables aren't part of the core Markdown spec, but Hugo supports them out-of-the-box. - - Name | Age ---------|------ - Bob | 27 - Alice | 23 - -#### Inline Markdown within tables - -| Italics | Bold | Code | -| -------- | -------- | ------ | -| *italics* | **bold** | `code` | - -## Code Blocks - -### Code block with triple backticks +### Headings ``` -def say_hello(): - print("Hello!") +# Heading 1 +## Heading 2 +### Heading 3 +#### Heading 4 +##### Heading 5 +###### Heading 6 ``` +## Heading 2 +### Heading 3 +#### Heading 4 +##### Heading 5 +###### Heading 6 -```python -def say_hello(): - print("Hello!") +### Emphasis + +```text +*This text will be italic* +_This will also be italic_ + +**This text will be bold** +__This will also be bold__ + +_You **can** combine them_ ``` -### Code block with filename +*This text will be italic* -```python {filename="hello.py"} -def say_hello(): - print("Hello!") -``` +_This will also be italic_ -### Code block highlight with line numbers +**This text will be bold** -```python {linenos=table,hl_lines=[1, 2],linenostart=1} -def say_hello(): - print("Hello!") +__This will also be bold__ -def main(): - say_hello() -``` +_You **can** combine them_ -```python {linenos=table,hl_lines=[1, 2],linenostart=1,filename="hello.py"} -def say_hello(): - print("Hello!") +### Lists -def main(): - say_hello() -``` - -## 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
prevail! - John-->>Alice: Great! - John->>Bob: How about you? - Bob-->>John: Jolly good! -``` - -## List Types - -#### Ordered List - -1. First item -2. Second item -3. Third item - -#### Unordered List - -* List item -* Another item -* And another item - -#### Nested list - -* Fruit - * Apple - * Orange - * Banana -* Dairy - * Milk - * Cheese - -## Math - -[KaTeX](https://github.com/KaTeX/KaTeX) is a fast math typesetting library for the web. It uses javascript for client-side rendering. - -### Inline +#### Unordered ``` -This $\int\limits_1^\infty \frac{1}{k}\,dk$ is inline. +* Item 1 +* Item 2 + * Item 2a + * Item 2b ``` -This $\int\limits_1^\infty \frac{1}{k}\,dk$ is inline. +* Item 1 +* Item 2 + * Item 2a + * Item 2b -### Separate Paragraph +#### Ordered ``` -$$f(x) = \int_{-\infty}^\infty \hat f(\xi)\,e^{2 \pi i \xi x} \,d\xi$$ +1. Item 1 +2. Item 2 +3. Item 3 + 1. Item 3a + 2. Item 3b ``` -$$f(x) = \int_{-\infty}^\infty \hat f(\xi)\,e^{2 \pi i \xi x} \,d\xi$$ +### Images +```markdown +![GitHub Logo](https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png) +``` -## Other Elements — abbr, sub, sup, kbd, mark +![GitHub Logo](https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png) -GIF is a bitmap image format. +### Links -H2O +```markdown +[Hugo](https://gohugo.io) +``` -Xn + Yn = Zn +[Hugo](https://gohugo.io) -Press CTRL+ALT+Delete to end the session. +### Blockquotes -Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. +```markdown +As Newton said: + +> If I have seen further it is by standing on the shoulders of Giants. +``` + +> If I have seen further it is by standing on the shoulders of Giants. + +### Inline Code + +```markdown +Inline `code` has `back-ticks around` it. +``` + +Inline `code` has `back-ticks around` it. + +### Code Blocks + +#### Syntax Highlighting + +````markdown +```go +func main() { + fmt.Println("Hello World") +} +``` +```` + +```go +func main() { + fmt.Println("Hello World") +} +``` + +### Tables + +```markdown +| Syntax | Description | +| --------- | ----------- | +| Header | Title | +| Paragraph | Text | +``` + +| Syntax | Description | +| --------- | ----------- | +| Header | Title | +| Paragraph | Text | + +## References + +- [Markdown Syntax](https://www.markdownguide.org/basic-syntax/) +- [Hugo Markdown](https://gohugo.io/content-management/formats/#markdown) diff --git a/exampleSite/content/docs/advanced/_index.md b/exampleSite/content/docs/advanced/_index.md index b846769..7c29185 100644 --- a/exampleSite/content/docs/advanced/_index.md +++ b/exampleSite/content/docs/advanced/_index.md @@ -3,8 +3,11 @@ linkTitle: Advanced title: Advanced Topics --- +This section covers some advanced topics of the theme. + + + {{< 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 >}} diff --git a/exampleSite/content/docs/advanced/customization.md b/exampleSite/content/docs/advanced/customization.md index aeeaeaa..1050946 100644 --- a/exampleSite/content/docs/advanced/customization.md +++ b/exampleSite/content/docs/advanced/customization.md @@ -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. + + + ## 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! diff --git a/exampleSite/content/docs/advanced/multi-language.md b/exampleSite/content/docs/advanced/multi-language.md index a207db7..d1a6292 100644 --- a/exampleSite/content/docs/advanced/multi-language.md +++ b/exampleSite/content/docs/advanced/multi-language.md @@ -5,6 +5,8 @@ weight: 1 Hextra supports creating site with multiple languages using Hugo's [multilingual mode](https://gohugo.io/content-management/multilingual/). + + ## Enable Multi-language To make our site multi-language, we need to tell Hugo the supported languages. We need to add to the site configuration file: @@ -63,6 +65,16 @@ documentation: Documentation blog: Blog ``` +## Translate Strings + +To translate strings on the other places, we need to add the translation to the corresponding i18n file: + +```yaml {filename="i18n/fr.yaml"} +readMore: Lire la suite +``` + +A list of strings used in the theme can be found in the `i18n/en.yaml` file. + ## Read More - [Hugo Multilingual Mode](https://gohugo.io/content-management/multilingual/) diff --git a/exampleSite/content/docs/guide/shortcodes/_index.md b/exampleSite/content/docs/guide/shortcodes/_index.md index 8861e67..2cafed0 100644 --- a/exampleSite/content/docs/guide/shortcodes/_index.md +++ b/exampleSite/content/docs/guide/shortcodes/_index.md @@ -3,13 +3,16 @@ title: Shortcodes weight: 9 --- -Hextra provides a variety of built-in components based on [Hugo Shortcodes](https://gohugo.io/content-management/shortcodes/). +[Hugo Shortcodes](https://gohugo.io/content-management/shortcodes/) are simple snippets inside your content files calling built-in or custom templates. + +Hextra provides a collection of beautiful shortcodes to enhance your content. {{< cards >}} {{< card link="callouts" title="Callouts" icon="warning" >}} - {{< card link="cards" title="Cards" >}} - {{< card link="filetree" title="FileTree" >}} + {{< card link="cards" title="Cards" icon="card" >}} + {{< card link="filetree" title="FileTree" icon="folder-tree" >}} + {{< card link="icon" title="Icon" icon="badge-check" >}} {{< card link="steps" title="Steps" icon="one" >}} {{< card link="tabs" title="Tabs" icon="collection" >}} {{< /cards >}} diff --git a/exampleSite/content/docs/guide/shortcodes/cards.md b/exampleSite/content/docs/guide/shortcodes/cards.md index 8da5bea..c1536b0 100644 --- a/exampleSite/content/docs/guide/shortcodes/cards.md +++ b/exampleSite/content/docs/guide/shortcodes/cards.md @@ -7,7 +7,6 @@ linkTitle: Cards {{< cards >}} {{< card link="/" title="Callout" icon="warning" >}} - {{< card link="/" title="GitHub" icon="github" >}} {{< card link="/" title="No Icon" >}} {{< /cards >}} @@ -21,7 +20,6 @@ linkTitle: Cards ``` {{}} {{}} - {{}} {{}} {{}} ``` diff --git a/exampleSite/hugo_stats.json b/exampleSite/hugo_stats.json index 3e5d7e4..9a88fdb 100644 --- a/exampleSite/hugo_stats.json +++ b/exampleSite/hugo_stats.json @@ -2,7 +2,6 @@ "htmlElements": { "tags": [ "a", - "abbr", "article", "aside", "blockquote", @@ -33,7 +32,6 @@ "li", "link", "main", - "mark", "meta", "nav", "ol", @@ -502,7 +500,6 @@ "transition-colors", "transition-opacity", "transition-transform", - "typesetting-article", "underline", "underline-offset-2", "w-3.5", diff --git a/layouts/blog/list.html b/layouts/blog/list.html index 54807c9..49e4f5e 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -4,6 +4,7 @@

{{ .Title }}

+
{{ .Content }}
{{ range .Pages.ByDate }}