Фикс урлов для блога
This commit is contained in:
parent
11bb56301c
commit
6e81c3dca4
6 changed files with 12 additions and 12 deletions
14
README.md
14
README.md
|
@ -1,5 +1,5 @@
|
|||
[![Go Report Card](https://goreportcard.com/badge/github.com/n0x1m/hugoext)](https://goreportcard.com/report/github.com/n0x1m/hugoext)
|
||||
[![GoDoc](https://godoc.org/github.com/n0x1m/hugoext?status.svg)](https://godoc.org/github.com/n0x1m/hugoext)
|
||||
[![Go Report Card](https://goreportcard.com/badge/gitrepo.ru/neonxp/hugoext)](https://goreportcard.com/report/gitrepo.ru/neonxp/hugoext)
|
||||
[![GoDoc](https://godoc.org/gitrepo.ru/neonxp/hugoext?status.svg)](https://godoc.org/gitrepo.ru/neonxp/hugoext)
|
||||
|
||||
# hugoext
|
||||
|
||||
|
@ -37,7 +37,7 @@ unmodified.
|
|||
|
||||
## Example Use
|
||||
|
||||
Using the [md2gmi](https://github.com/n0x1m/md2gmi) command line utility to convert markdown to
|
||||
Using the [md2gmi](https://gitrepo.ru/neonxp/md2gmi) command line utility to convert markdown to
|
||||
gemtext. Executed from the hugo directory:
|
||||
|
||||
```
|
||||
|
@ -57,21 +57,21 @@ page = ":filename"
|
|||
### Installation
|
||||
|
||||
```
|
||||
go install github.com/n0x1m/hugoext@latest
|
||||
go install gitrepo.ru/neonxp/hugoext@latest
|
||||
```
|
||||
|
||||
To use the gemini file server and markdown to gemtext converter in the examples below, also install
|
||||
these:
|
||||
|
||||
```
|
||||
go install github.com/n0x1m/md2gmi@latest
|
||||
go install github.com/n0x1m/gmifs@latest
|
||||
go install gitrepo.ru/neonxp/md2gmi@latest
|
||||
go install gitrepo.ru/neonxp/gmifs@latest
|
||||
```
|
||||
|
||||
### Development
|
||||
|
||||
To test the extension in a similar fashion to the hugo workflow, use a server to host the static
|
||||
files. Here an example for a Gemlog using [gmifs](https://github.com/n0x1m/gmifs) in a makefile:
|
||||
files. Here an example for a Gemlog using [gmifs](https://gitrepo.ru/neonxp/gmifs) in a makefile:
|
||||
|
||||
```makefile
|
||||
serve:
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/n0x1m/hugoext/hugo"
|
||||
"gitrepo.ru/neonxp/hugoext/hugo"
|
||||
)
|
||||
|
||||
type FileTree struct {
|
||||
|
|
2
go.mod
2
go.mod
|
@ -1,4 +1,4 @@
|
|||
module github.com/n0x1m/hugoext
|
||||
module gitrepo.ru/neonxp/hugoext
|
||||
|
||||
go 1.16
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@ func pageToPermalinkSlugElseTitle(m *PageMetadata, a string) (string, error) {
|
|||
|
||||
// pageToPermalinkFilename returns the URL-safe form of the filename
|
||||
func pageToPermalinkFilename(m *PageMetadata, _ string) (string, error) {
|
||||
return URLEscape(m.Filepath)
|
||||
return strings.ToLower(strings.ReplaceAll(m.Filepath, " ", "-")), nil
|
||||
}
|
||||
|
||||
func pageToPermalinkTitle(m *PageMetadata, _ string) (string, error) {
|
||||
|
|
2
main.go
2
main.go
|
@ -8,7 +8,7 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/n0x1m/hugoext/hugo"
|
||||
"gitrepo.ru/neonxp/hugoext/hugo"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -3,7 +3,7 @@ package main
|
|||
import (
|
||||
"time"
|
||||
|
||||
"github.com/n0x1m/hugoext/hugo"
|
||||
"gitrepo.ru/neonxp/hugoext/hugo"
|
||||
)
|
||||
|
||||
func NewContentFromMeta(meta map[string]interface{}) *hugo.PageMetadata {
|
||||
|
|
Loading…
Reference in a new issue