mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-31 18:52:38 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| be2c634751 | |||
| 75c0f88289 | |||
| 18ce854626 | |||
| 69f5bad40f | |||
| 525bed9919 |
+2
-2
@@ -76,7 +76,7 @@ See https://xyproto.github.io/splash/docs/all.html for a preview of the availabl
|
||||
},
|
||||
withc: func(cmd *cobra.Command, r *rootCommand) {
|
||||
cmd.PersistentFlags().StringVar(&style, "style", "friendly", "highlighter style (see https://xyproto.github.io/splash/docs/)")
|
||||
cmd.PersistentFlags().StringVar(&highlightStyle, "highlightStyle", "bg:#ffffcc", "style used for highlighting lines (see https://github.com/alecthomas/chroma)")
|
||||
cmd.PersistentFlags().StringVar(&highlightStyle, "highlightStyle", "", "style used for highlighting lines (see https://github.com/alecthomas/chroma)")
|
||||
cmd.PersistentFlags().StringVar(&linesStyle, "linesStyle", "", "style used for line numbers (see https://github.com/alecthomas/chroma)")
|
||||
},
|
||||
}
|
||||
@@ -136,7 +136,7 @@ url: %s
|
||||
long: `Generate Markdown documentation for the Hugo CLI.
|
||||
This command is, mostly, used to create up-to-date documentation
|
||||
of Hugo's command-line interface for https://gohugo.io/.
|
||||
|
||||
|
||||
It creates one Markdown file per command with front matter suitable
|
||||
for rendering in Hugo.`,
|
||||
run: func(ctx context.Context, cd *simplecobra.Commandeer, r *rootCommand, args []string) error {
|
||||
|
||||
+2
-2
@@ -927,7 +927,7 @@ func (c *serverCommand) serve() error {
|
||||
|
||||
for i := range baseURLs {
|
||||
mu, listener, serverURL, endpoint, err := srv.createEndpoint(i)
|
||||
var srv *http.Server
|
||||
var srv *http.Server
|
||||
if c.tlsCertFile != "" && c.tlsKeyFile != "" {
|
||||
srv = &http.Server{
|
||||
Addr: endpoint,
|
||||
@@ -954,7 +954,7 @@ func (c *serverCommand) serve() error {
|
||||
mu.HandleFunc(u.Path+"/livereload.js", livereload.ServeJS)
|
||||
mu.HandleFunc(u.Path+"/livereload", livereload.Handler)
|
||||
}
|
||||
c.r.Printf("Web Server is available at %s (bind address %s)\n", serverURL, c.serverInterface)
|
||||
c.r.Printf("Web Server is available at %s (bind address %s) %s\n", serverURL, c.serverInterface, roots[i])
|
||||
wg1.Go(func() error {
|
||||
if c.tlsCertFile != "" && c.tlsKeyFile != "" {
|
||||
err = srv.ServeTLS(listener, c.tlsCertFile, c.tlsKeyFile)
|
||||
|
||||
@@ -330,7 +330,7 @@ The content.
|
||||
func TestBenchmarkBaseline(t *testing.T) {
|
||||
cfg := IntegrationTestConfig{
|
||||
T: t,
|
||||
TxtarString: benchmarkBaselineFiles(),
|
||||
TxtarString: benchmarkBaselineFiles(true),
|
||||
}
|
||||
b := NewIntegrationTestBuilder(cfg).Build()
|
||||
|
||||
@@ -346,7 +346,7 @@ func BenchmarkBaseline(b *testing.B) {
|
||||
b.Run("withrender", func(b *testing.B) {
|
||||
cfg := IntegrationTestConfig{
|
||||
T: b,
|
||||
TxtarString: benchmarkBaselineFiles(),
|
||||
TxtarString: benchmarkBaselineFiles(false),
|
||||
}
|
||||
builders := make([]*IntegrationTestBuilder, b.N)
|
||||
|
||||
@@ -363,7 +363,27 @@ func BenchmarkBaseline(b *testing.B) {
|
||||
b.Run("skiprender", func(b *testing.B) {
|
||||
cfg := IntegrationTestConfig{
|
||||
T: b,
|
||||
TxtarString: benchmarkBaselineFiles(),
|
||||
TxtarString: benchmarkBaselineFiles(false),
|
||||
BuildCfg: BuildCfg{
|
||||
SkipRender: true,
|
||||
},
|
||||
}
|
||||
builders := make([]*IntegrationTestBuilder, b.N)
|
||||
|
||||
for i := range builders {
|
||||
builders[i] = NewIntegrationTestBuilder(cfg)
|
||||
}
|
||||
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
builders[i].Build()
|
||||
}
|
||||
})
|
||||
|
||||
b.Run("skiprender leaf", func(b *testing.B) {
|
||||
cfg := IntegrationTestConfig{
|
||||
T: b,
|
||||
TxtarString: benchmarkBaselineFiles(false),
|
||||
BuildCfg: BuildCfg{
|
||||
SkipRender: true,
|
||||
},
|
||||
@@ -381,7 +401,7 @@ func BenchmarkBaseline(b *testing.B) {
|
||||
})
|
||||
}
|
||||
|
||||
func benchmarkBaselineFiles() string {
|
||||
func benchmarkBaselineFiles(leafBundles bool) string {
|
||||
|
||||
rnd := rand.New(rand.NewSource(32))
|
||||
|
||||
@@ -466,7 +486,12 @@ Aliqua labore enim et sint anim amet excepteur ea dolore.
|
||||
files += fmt.Sprintf("\n-- content/%s/%s/%s/_index.md --\n"+contentTemplate, lang, root, section, n, n, n)
|
||||
for k := 1; k < rnd.Intn(30)+1; k++ {
|
||||
n := n + k
|
||||
files += fmt.Sprintf("\n-- content/%s/%s/%s/p%d.md --\n"+contentTemplate, lang, root, section, n, n, n)
|
||||
ns := fmt.Sprintf("%d", n)
|
||||
if leafBundles {
|
||||
ns = fmt.Sprintf("%d/index", n)
|
||||
}
|
||||
file := fmt.Sprintf("\n-- content/%s/%s/%s/p%s.md --\n"+contentTemplate, lang, root, section, ns, n, n)
|
||||
files += file
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -398,7 +398,7 @@ func testSetupFunc() func(env *testscript.Env) error {
|
||||
goVersion := runtime.Version()
|
||||
|
||||
goVersion = strings.TrimPrefix(goVersion, "go")
|
||||
if !strings.HasSuffix(goVersion, ".0") {
|
||||
if strings.HasPrefix(goVersion, "1.20") {
|
||||
// Strip patch version.
|
||||
goVersion = goVersion[:strings.LastIndex(goVersion, ".")]
|
||||
}
|
||||
|
||||
@@ -16,4 +16,4 @@ checkfilecount $NUM_COMMANDS manpages
|
||||
hugo gen chromastyles -h
|
||||
stdout 'Generate CSS stylesheet for the Chroma code highlighter'
|
||||
hugo gen chromastyles --style monokai
|
||||
stdout 'color: #f8f8f2'
|
||||
stdout '/\* LineHighlight \*/ \.chroma \.hl \{ background-color: #3c3d38 \}'
|
||||
|
||||
Reference in New Issue
Block a user