Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pilcrowOnPaper committed May 10, 2024
1 parent a303574 commit a15bf10
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
1 change: 1 addition & 0 deletions docs/malta.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"description": "Malta is a CLI tool to generate documentation sites with markdown.",
"domain": "https://malta.pilcrowonpaper.com",
"twitter": "@pilcrowonpaper",
"asset_hashing": true,
"sidebar": [
{
"title": "Basics",
Expand Down
11 changes: 7 additions & 4 deletions docs/pages/basics/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@ Create `malta.config.json` in the project root.

// optional
"twitter": "@pilcrowonpaper", // twitter account associated with the project
"sidebar" [], // see 'Sidebar' page
"logo": "logo.svg", //for sidebar (must be the name of a file in the same dir)
"og_logo": "og_logo.png" // square image of OG (must be the name of a file in the same dir)
"sidebar": [], // see 'Sidebar' page
"asset_hashing": true // default: false - hashes the filenames for easy caching
}
```

You can also add a `favicon.ico` next to the config.
You can also add the following files next to the config file:

- `favicon.ico`
- `logo.[EXTENSION]`: Adds logo to the sidebar
- `og-logo.[EXTENSION]`: Square image for OG

## Create `pages` directory

Expand Down
18 changes: 9 additions & 9 deletions src/commands/build/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ import (
)

var config struct {
Name string `json:"name"`
Description string `json:"description"`
Domain string `json:"domain"`
Twitter string `json:"twitter"`
Sidebar []SidebarSectionConfig `json:"sidebar"`
Bundle bool `json:"bundle"`
Name string `json:"name"`
Description string `json:"description"`
Domain string `json:"domain"`
Twitter string `json:"twitter"`
Sidebar []SidebarSectionConfig `json:"sidebar"`
AssetHashing bool `json:"asset_hashing"`
}

var markdownFilePaths []string
Expand Down Expand Up @@ -103,15 +103,15 @@ func BuildCommand() int {

mainCSSFileName, markdownCSSFileName := "main.css", "markdown.css"

if config.Bundle && logoFileName != "" {
if config.AssetHashing && logoFileName != "" {
logoFileName = getHashedFileName(logoFile, logoFileName)
}

if config.Bundle && ogLogoFileName != "" {
if config.AssetHashing && ogLogoFileName != "" {
ogLogoFileName = getHashedFileName(ogLogoFile, ogLogoFileName)
}

if config.Bundle {
if config.AssetHashing {
mainCSSFileName = getHashedFileName(mainCSS, mainCSSFileName)
markdownCSSFileName = getHashedFileName(markdownCSS, markdownCSSFileName)
}
Expand Down

0 comments on commit a15bf10

Please sign in to comment.