Skip to content

Commit c55645d

Browse files
authored
Merge pull request #9 from jakewies/default-content
2 parents 26a8558 + 1be7bd5 commit c55645d

File tree

3 files changed

+126
-2
lines changed

3 files changed

+126
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ git init
2323
**3. Add `hugo-theme-codex` as a submodule**
2424

2525
```
26-
git submodule add https://github.com/jakewies/hugo-theme-codex themes/codex
26+
git submodule add https://github.com/jakewies/hugo-theme-codex.git themes/codex
2727
```
2828

2929
**4. List `"codex"` as the name of your theme in `config.toml`**
@@ -34,7 +34,13 @@ git submodule add https://github.com/jakewies/hugo-theme-codex themes/codex
3434
theme = "codex"
3535
```
3636

37-
See the contents of the [example site](https://github.com/jakewies/hugo-theme-codex/tree/master/exampleSite) for more details.
37+
**5. Start the server**
38+
39+
```
40+
hugo server -D
41+
```
42+
43+
You should now see some default content.
3844

3945
### Configuring the Home Page
4046

content/_index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
heading: "Hi, I'm Codex"
3+
subheading: "A minimal blog theme for hugo."
4+
handle: "hugo-theme-codex"
5+
---

content/blog/how-to-use-codex.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
title: "How To Use Codex"
3+
date: 2020-06-04T09:19:29-04:00
4+
slug: "how-to-use-codex"
5+
description: "Explaining how to get up and running with the Codex theme for Hugo."
6+
keywords: ["gohugo", "hugo", "go", "blog"]
7+
draft: false
8+
tags: ["hugo"]
9+
stylesheet: "post.css"
10+
---
11+
12+
[Codex](https://github.com/jakewies/hugo-theme-codex) is a minimal blog theme for [Hugo](https://gohugo.io/).
13+
14+
## Getting Started
15+
16+
**1. Start a new `hugo` site**
17+
18+
```
19+
hugo new site my-new-site
20+
cd my-new-site
21+
```
22+
23+
**2. Initialize project with `git`**
24+
25+
```
26+
git init
27+
```
28+
29+
**3. Add `hugo-theme-codex` as a submodule**
30+
31+
```
32+
git submodule add https://github.com/jakewies/hugo-theme-codex.git themes/codex
33+
```
34+
35+
**4. List `"codex"` as the name of your theme in `config.toml`**
36+
37+
```
38+
# config.toml
39+
40+
theme = "codex"
41+
```
42+
43+
**5. Start the server**
44+
45+
```
46+
hugo server -D
47+
```
48+
49+
You should now see some default content.
50+
51+
### Configuring the Home Page
52+
53+
The site's home page can be configured by creating a `content/_index.md` file. This file can use the following frontmatter:
54+
55+
```
56+
---
57+
heading: "Hi, I'm Codex"
58+
subheading: "A minimal blog theme for hugo."
59+
handle: "hugo-theme-codex"
60+
---
61+
```
62+
63+
If you would rather override the about page's layout with your own, you can do so by creating a `layouts/index.html`. You can find the `index.html` file that `hugo-theme-codex` uses [here](https://github.com/jakewies/hugo-theme-codex/blob/master/layouts/index.html).
64+
65+
### Configuring Social Icons
66+
67+
Social Icons are optional. As of right now we support Twitter and GitHub, but more can be supported in the future. To show any of these icons, just provide the value in the `[params]` section of `config.toml`.
68+
69+
```
70+
# config.toml
71+
72+
[params]
73+
twitter = "hugo-theme-codex"
74+
github = "jakewies/hugo-theme-codex"
75+
```
76+
77+
If either of these options are given, `hugo-theme-codex` will render the social icon in the footer.
78+
79+
See the contents of the [example site](https://github.com/jakewies/hugo-theme-codex/tree/master/exampleSite) for more details.
80+
81+
You can also create additional social icons by replicating the code in `partials/social-icons.html`. For example, to add an email social icon, you can add the follwing:
82+
83+
```
84+
<a class="social-icons__icon social-icons__icon--email" href="mailto:youremail@example.com"></a>
85+
```
86+
Note that you also need to add the following css in corresponding css files where social icons are displayed, i.e. `about.css` and `post.css`:
87+
88+
```
89+
.social-icons__icon--email {
90+
background-image: url("/icons/email.svg");
91+
}
92+
```
93+
94+
### Creating a blog post
95+
96+
You can create a new blog post page by going to the root of your project and typing:
97+
98+
```
99+
hugo new blog/:blog-post.md
100+
```
101+
102+
Where `:blog-post.md` is the name of the file of your new post.
103+
104+
The theme supports KaTeX which renders math typesetting in markdown document. Simply turn on by `math: true` in your post.
105+
106+
### Tags
107+
108+
Right now `hugo-theme-codex` uses the `tags` taxonomy for blog posts. You can view all the blog posts of a given tag by going to `/tags/:tag-name`, where `:tag-name` is the name of your tag.
109+
110+
### Favicon
111+
112+
To update favicon of the site, replace the one in `static/favicon.ico` with your own.
113+

0 commit comments

Comments
 (0)