Rename all occurrences of gutenberg to zola in code
This commit is contained in:
parent
dffd39aa8f
commit
f84ae7c93b
|
@ -4,7 +4,7 @@ services: docker
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- CRATE_NAME=gutenberg
|
- CRATE_NAME=zola
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
### Breaking
|
### Breaking
|
||||||
|
|
||||||
- Gutenberg has changed name to REPLACE_ME!
|
- Gutenberg has changed name to `zola`!
|
||||||
- The `pagers` variable of Paginator objects has been removed
|
- The `pagers` variable of Paginator objects has been removed
|
||||||
- `section.subsections` is now an array of paths to be used with the `get_section`
|
- `section.subsections` is now an array of paths to be used with the `get_section`
|
||||||
Tera function
|
Tera function
|
||||||
|
|
44
Cargo.lock
generated
44
Cargo.lock
generated
|
@ -810,28 +810,6 @@ dependencies = [
|
||||||
"regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "gutenberg"
|
|
||||||
version = "0.5.0"
|
|
||||||
dependencies = [
|
|
||||||
"actix-web 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"ctrlc 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"errors 0.1.0",
|
|
||||||
"front_matter 0.1.0",
|
|
||||||
"lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"notify 4.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"rebuild 0.1.0",
|
|
||||||
"site 0.1.0",
|
|
||||||
"termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"toml 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"utils 0.1.0",
|
|
||||||
"ws 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "h2"
|
name = "h2"
|
||||||
version = "0.1.13"
|
version = "0.1.13"
|
||||||
|
@ -2873,6 +2851,28 @@ dependencies = [
|
||||||
"linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "zola"
|
||||||
|
version = "0.5.0"
|
||||||
|
dependencies = [
|
||||||
|
"actix-web 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"ctrlc 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"errors 0.1.0",
|
||||||
|
"front_matter 0.1.0",
|
||||||
|
"lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"notify 4.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"rebuild 0.1.0",
|
||||||
|
"site 0.1.0",
|
||||||
|
"termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"toml 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"utils 0.1.0",
|
||||||
|
"ws 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[metadata]
|
[metadata]
|
||||||
"checksum actix 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "710e449bb7720ad245a7101f3698ebc743588e0f4ba2b07fe9d74323e348b835"
|
"checksum actix 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "710e449bb7720ad245a7101f3698ebc743588e0f4ba2b07fe9d74323e348b835"
|
||||||
"checksum actix-net 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6681a31050ab951f09050f08c5ddb4189659b8bca93b629b26547208861d1401"
|
"checksum actix-net 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6681a31050ab951f09050f08c5ddb4189659b8bca93b629b26547208861d1401"
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
[package]
|
[package]
|
||||||
name = "gutenberg"
|
name = "zola"
|
||||||
version = "0.5.0"
|
version = "0.5.0"
|
||||||
authors = ["Vincent Prouillet <prouillet.vincent@gmail.com>"]
|
authors = ["Vincent Prouillet <prouillet.vincent@gmail.com>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
description = "A fast static site generator with everything built-in"
|
description = "A fast static site generator with everything built-in"
|
||||||
homepage = "https://github.com/Keats/gutenberg"
|
homepage = "https://www.getzola.org"
|
||||||
repository = "https://github.com/Keats/gutenberg"
|
repository = "https://github.com/getzola/zola"
|
||||||
keywords = ["static", "site", "generator", "blog"]
|
keywords = ["static", "site", "generator", "blog"]
|
||||||
# build = "build.rs"
|
# build = "build.rs"
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ keywords = ["static", "site", "generator", "blog"]
|
||||||
clap = "2"
|
clap = "2"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "gutenberg"
|
name = "zola"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
atty = "0.2.11"
|
atty = "0.2.11"
|
||||||
|
|
17
README.md
17
README.md
|
@ -1,15 +1,15 @@
|
||||||
# Gutenberg
|
# zola (né Gutenberg)
|
||||||
[![Build Status](https://travis-ci.org/Keats/gutenberg.svg?branch=master)](https://travis-ci.org/Keats/gutenberg)
|
[![Build Status](https://travis-ci.org/Keats/gutenberg.svg?branch=master)](https://travis-ci.org/Keats/gutenberg)
|
||||||
[![Build status](https://ci.appveyor.com/api/projects/status/h4t9r6h5gom839q0/branch/master?svg=true)](https://ci.appveyor.com/project/Keats/gutenberg/branch/master)
|
[![Build status](https://ci.appveyor.com/api/projects/status/h4t9r6h5gom839q0/branch/master?svg=true)](https://ci.appveyor.com/project/Keats/gutenberg/branch/master)
|
||||||
|
|
||||||
A fast static site generator in a single binary with everything built-in.
|
A fast static site generator in a single binary with everything built-in.
|
||||||
|
|
||||||
Documentation is available on [its site](https://www.getgutenberg.io/documentation/getting-started/installation/) or
|
Documentation is available on [its site](https://www.getzola.org/documentation/getting-started/installation/) or
|
||||||
in the `docs/content` folder of the repository.
|
in the `docs/content` folder of the repository.
|
||||||
|
|
||||||
## Comparisons with other static site generators
|
## Comparisons with other static site generators
|
||||||
|
|
||||||
| | Gutenberg | Cobalt | Hugo | Pelican |
|
| | Zola | Cobalt | Hugo | Pelican |
|
||||||
|:-------------------------------:|:---------:|--------|------|---------|
|
|:-------------------------------:|:---------:|--------|------|---------|
|
||||||
| Single binary | ✔ | ✔ | ✔ | ✕ |
|
| Single binary | ✔ | ✔ | ✔ | ✕ |
|
||||||
| Language | Rust | Rust | Go | Python |
|
| Language | Rust | Rust | Go | Python |
|
||||||
|
@ -31,12 +31,13 @@ in the `docs/content` folder of the repository.
|
||||||
| Search | ✔ | ✕ | ✕ | ✔ |
|
| Search | ✔ | ✕ | ✕ | ✔ |
|
||||||
| Data files | ✔ | ✔ | ✔ | ✕ |
|
| Data files | ✔ | ✔ | ✔ | ✕ |
|
||||||
| LiveReload | ✔ | ✕ | ✔ | ✔ |
|
| LiveReload | ✔ | ✕ | ✔ | ✔ |
|
||||||
| Netlify support | ✔ | ✕ | ✔ | ✕ |
|
| Netlify support | ~ | ✕ | ✔ | ✕ |
|
||||||
|
| Breadcrumbds | ✔ | ✕ | ✕ | ✔ |
|
||||||
|
|
||||||
|
|
||||||
### Supported content formats
|
### Supported content formats
|
||||||
|
|
||||||
- Gutenberg: markdown
|
- Zola: markdown
|
||||||
- Cobalt: markdown
|
- Cobalt: markdown
|
||||||
- Hugo: markdown, asciidoc, org-mode
|
- Hugo: markdown, asciidoc, org-mode
|
||||||
- Pelican: reStructuredText, markdown, asciidoc, org-mode, whatever-you-want
|
- Pelican: reStructuredText, markdown, asciidoc, org-mode, whatever-you-want
|
||||||
|
@ -67,7 +68,7 @@ Syntax highlighting depends on submodules so ensure you load them first:
|
||||||
$ git submodule update --init
|
$ git submodule update --init
|
||||||
```
|
```
|
||||||
|
|
||||||
Gutenberg only works with syntaxes in the `.sublime-syntax` format. If your syntax
|
Zola only works with syntaxes in the `.sublime-syntax` format. If your syntax
|
||||||
is in `.tmLanguage` format, open it in Sublime Text and convert it to `sublime-syntax` by clicking on
|
is in `.tmLanguage` format, open it in Sublime Text and convert it to `sublime-syntax` by clicking on
|
||||||
Tools > Developer > New Syntax from ... and put it at the root of `sublime_syntaxes`.
|
Tools > Developer > New Syntax from ... and put it at the root of `sublime_syntaxes`.
|
||||||
|
|
||||||
|
@ -79,7 +80,7 @@ $ git submodule add https://github.com/elm-community/SublimeElmLanguageSupport
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that you can also only copy manually the updated syntax definition file but this means
|
Note that you can also only copy manually the updated syntax definition file but this means
|
||||||
Gutenberg won't be able to automatically update it.
|
Zola won't be able to automatically update it.
|
||||||
|
|
||||||
You can check for any updates to the current packages by running:
|
You can check for any updates to the current packages by running:
|
||||||
|
|
||||||
|
@ -95,7 +96,7 @@ $ cargo run --example generate_sublime synpack ../../sublime_syntaxes ../../subl
|
||||||
|
|
||||||
#### Adding a theme
|
#### Adding a theme
|
||||||
A gallery containing lots of themes is located at https://tmtheme-editor.herokuapp.com/#!/editor/theme/Agola%20Dark.
|
A gallery containing lots of themes is located at https://tmtheme-editor.herokuapp.com/#!/editor/theme/Agola%20Dark.
|
||||||
More themes can be easily added to gutenberg, just make a PR with the wanted theme added in the `sublime_themes` directory
|
More themes can be easily added to Zola, just make a PR with the wanted theme added in the `sublime_themes` directory
|
||||||
and run the following command from the root of the components/rendering:
|
and run the following command from the root of the components/rendering:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
|
@ -6,7 +6,7 @@ os: Visual Studio 2017
|
||||||
environment:
|
environment:
|
||||||
global:
|
global:
|
||||||
RUST_VERSION: stable
|
RUST_VERSION: stable
|
||||||
CRATE_NAME: gutenberg
|
CRATE_NAME: zola
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
- target: x86_64-pc-windows-msvc
|
- target: x86_64-pc-windows-msvc
|
||||||
|
@ -29,7 +29,7 @@ test_script:
|
||||||
)
|
)
|
||||||
|
|
||||||
before_deploy:
|
before_deploy:
|
||||||
- cargo rustc --target %TARGET% --release --bin gutenberg -- -C lto
|
- cargo rustc --target %TARGET% --release --bin zola -- -C lto
|
||||||
- ps: ci\before_deploy.ps1
|
- ps: ci\before_deploy.ps1
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
|
|
8
build.rs
8
build.rs
|
@ -8,8 +8,8 @@ include!("src/cli.rs");
|
||||||
fn main() {
|
fn main() {
|
||||||
// disabled below as it fails in CI
|
// disabled below as it fails in CI
|
||||||
// let mut app = build_cli();
|
// let mut app = build_cli();
|
||||||
// app.gen_completions("gutenberg", Shell::Bash, "completions/");
|
// app.gen_completions("zola", Shell::Bash, "completions/");
|
||||||
// app.gen_completions("gutenberg", Shell::Fish, "completions/");
|
// app.gen_completions("zola", Shell::Fish, "completions/");
|
||||||
// app.gen_completions("gutenberg", Shell::Zsh, "completions/");
|
// app.gen_completions("zola", Shell::Zsh, "completions/");
|
||||||
// app.gen_completions("gutenberg", Shell::PowerShell, "completions/");
|
// app.gen_completions("zola", Shell::PowerShell, "completions/");
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,8 +10,7 @@ Set-Location $STAGE
|
||||||
|
|
||||||
$ZIP = "$SRC_DIR\$($Env:CRATE_NAME)-$($Env:APPVEYOR_REPO_TAG_NAME)-$($Env:TARGET).zip"
|
$ZIP = "$SRC_DIR\$($Env:CRATE_NAME)-$($Env:APPVEYOR_REPO_TAG_NAME)-$($Env:TARGET).zip"
|
||||||
|
|
||||||
# TODO Update this to package the right artifacts
|
Copy-Item "$SRC_DIR\target\$($Env:TARGET)\release\zola.exe" '.\'
|
||||||
Copy-Item "$SRC_DIR\target\$($Env:TARGET)\release\gutenberg.exe" '.\'
|
|
||||||
|
|
||||||
7z a "$ZIP" *
|
7z a "$ZIP" *
|
||||||
|
|
||||||
|
|
|
@ -17,11 +17,9 @@ main() {
|
||||||
|
|
||||||
test -f Cargo.lock || cargo generate-lockfile
|
test -f Cargo.lock || cargo generate-lockfile
|
||||||
|
|
||||||
# TODO Update this to build the artifacts that matter to you
|
cross rustc --bin zola --target $TARGET --release -- -C lto
|
||||||
cross rustc --bin gutenberg --target $TARGET --release -- -C lto
|
|
||||||
|
|
||||||
# TODO Update this to package the right artifacts
|
cp target/$TARGET/release/zola $stage/
|
||||||
cp target/$TARGET/release/gutenberg $stage/
|
|
||||||
|
|
||||||
cd $stage
|
cd $stage
|
||||||
tar czf $src/$CRATE_NAME-$TRAVIS_TAG-$TARGET.tar.gz *
|
tar czf $src/$CRATE_NAME-$TRAVIS_TAG-$TARGET.tar.gz *
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#compdef gutenberg
|
#compdef zola
|
||||||
|
|
||||||
autoload -U is-at-least
|
autoload -U is-at-least
|
||||||
|
|
||||||
_gutenberg() {
|
_zola() {
|
||||||
typeset -A opt_args
|
typeset -A opt_args
|
||||||
typeset -a _arguments_options
|
typeset -a _arguments_options
|
||||||
local ret=1
|
local ret=1
|
||||||
|
@ -21,14 +21,14 @@ _gutenberg() {
|
||||||
'--help[Prints help information]' \
|
'--help[Prints help information]' \
|
||||||
'-V[Prints version information]' \
|
'-V[Prints version information]' \
|
||||||
'--version[Prints version information]' \
|
'--version[Prints version information]' \
|
||||||
":: :_gutenberg_commands" \
|
":: :_zola_commands" \
|
||||||
"*::: :->gutenberg" \
|
"*::: :->zola" \
|
||||||
&& ret=0
|
&& ret=0
|
||||||
case $state in
|
case $state in
|
||||||
(gutenberg)
|
(zola)
|
||||||
words=($line[1] "${words[@]}")
|
words=($line[1] "${words[@]}")
|
||||||
(( CURRENT += 1 ))
|
(( CURRENT += 1 ))
|
||||||
curcontext="${curcontext%:*:*}:gutenberg-command-$line[1]:"
|
curcontext="${curcontext%:*:*}:zola-command-$line[1]:"
|
||||||
case $line[1] in
|
case $line[1] in
|
||||||
(init)
|
(init)
|
||||||
_arguments "${_arguments_options[@]}" \
|
_arguments "${_arguments_options[@]}" \
|
||||||
|
@ -80,43 +80,43 @@ _arguments "${_arguments_options[@]}" \
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
(( $+functions[_gutenberg_commands] )) ||
|
(( $+functions[_zola_commands] )) ||
|
||||||
_gutenberg_commands() {
|
_zola_commands() {
|
||||||
local commands; commands=(
|
local commands; commands=(
|
||||||
"init:Create a new Gutenberg project" \
|
"init:Create a new Zola project" \
|
||||||
"build:Builds the site" \
|
"build:Builds the site" \
|
||||||
"serve:Serve the site. Rebuild and reload on change automatically" \
|
"serve:Serve the site. Rebuild and reload on change automatically" \
|
||||||
"help:Prints this message or the help of the given subcommand(s)" \
|
"help:Prints this message or the help of the given subcommand(s)" \
|
||||||
)
|
)
|
||||||
_describe -t commands 'gutenberg commands' commands "$@"
|
_describe -t commands 'zola commands' commands "$@"
|
||||||
}
|
}
|
||||||
(( $+functions[_gutenberg__build_commands] )) ||
|
(( $+functions[_zola__build_commands] )) ||
|
||||||
_gutenberg__build_commands() {
|
_zola__build_commands() {
|
||||||
local commands; commands=(
|
local commands; commands=(
|
||||||
|
|
||||||
)
|
)
|
||||||
_describe -t commands 'gutenberg build commands' commands "$@"
|
_describe -t commands 'zola build commands' commands "$@"
|
||||||
}
|
}
|
||||||
(( $+functions[_gutenberg__help_commands] )) ||
|
(( $+functions[_zola__help_commands] )) ||
|
||||||
_gutenberg__help_commands() {
|
_zola__help_commands() {
|
||||||
local commands; commands=(
|
local commands; commands=(
|
||||||
|
|
||||||
)
|
)
|
||||||
_describe -t commands 'gutenberg help commands' commands "$@"
|
_describe -t commands 'zola help commands' commands "$@"
|
||||||
}
|
}
|
||||||
(( $+functions[_gutenberg__init_commands] )) ||
|
(( $+functions[_zola__init_commands] )) ||
|
||||||
_gutenberg__init_commands() {
|
_zola__init_commands() {
|
||||||
local commands; commands=(
|
local commands; commands=(
|
||||||
|
|
||||||
)
|
)
|
||||||
_describe -t commands 'gutenberg init commands' commands "$@"
|
_describe -t commands 'zola init commands' commands "$@"
|
||||||
}
|
}
|
||||||
(( $+functions[_gutenberg__serve_commands] )) ||
|
(( $+functions[_zola__serve_commands] )) ||
|
||||||
_gutenberg__serve_commands() {
|
_zola__serve_commands() {
|
||||||
local commands; commands=(
|
local commands; commands=(
|
||||||
|
|
||||||
)
|
)
|
||||||
_describe -t commands 'gutenberg serve commands' commands "$@"
|
_describe -t commands 'zola serve commands' commands "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
_gutenberg "$@"
|
_zola "$@"
|
|
@ -2,12 +2,12 @@
|
||||||
using namespace System.Management.Automation
|
using namespace System.Management.Automation
|
||||||
using namespace System.Management.Automation.Language
|
using namespace System.Management.Automation.Language
|
||||||
|
|
||||||
Register-ArgumentCompleter -Native -CommandName 'gutenberg' -ScriptBlock {
|
Register-ArgumentCompleter -Native -CommandName 'zola' -ScriptBlock {
|
||||||
param($wordToComplete, $commandAst, $cursorPosition)
|
param($wordToComplete, $commandAst, $cursorPosition)
|
||||||
|
|
||||||
$commandElements = $commandAst.CommandElements
|
$commandElements = $commandAst.CommandElements
|
||||||
$command = @(
|
$command = @(
|
||||||
'gutenberg'
|
'zola'
|
||||||
for ($i = 1; $i -lt $commandElements.Count; $i++) {
|
for ($i = 1; $i -lt $commandElements.Count; $i++) {
|
||||||
$element = $commandElements[$i]
|
$element = $commandElements[$i]
|
||||||
if ($element -isnot [StringConstantExpressionAst] -or
|
if ($element -isnot [StringConstantExpressionAst] -or
|
||||||
|
@ -19,27 +19,27 @@ Register-ArgumentCompleter -Native -CommandName 'gutenberg' -ScriptBlock {
|
||||||
}) -join ';'
|
}) -join ';'
|
||||||
|
|
||||||
$completions = @(switch ($command) {
|
$completions = @(switch ($command) {
|
||||||
'gutenberg' {
|
'zola' {
|
||||||
[CompletionResult]::new('-c', 'c', [CompletionResultType]::ParameterName, 'Path to a config file other than config.toml')
|
[CompletionResult]::new('-c', 'c', [CompletionResultType]::ParameterName, 'Path to a config file other than config.toml')
|
||||||
[CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'Path to a config file other than config.toml')
|
[CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'Path to a config file other than config.toml')
|
||||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
|
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
|
||||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
|
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
|
||||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
|
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
|
||||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
|
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
|
||||||
[CompletionResult]::new('init', 'init', [CompletionResultType]::ParameterValue, 'Create a new Gutenberg project')
|
[CompletionResult]::new('init', 'init', [CompletionResultType]::ParameterValue, 'Create a new Zola project')
|
||||||
[CompletionResult]::new('build', 'build', [CompletionResultType]::ParameterValue, 'Builds the site')
|
[CompletionResult]::new('build', 'build', [CompletionResultType]::ParameterValue, 'Builds the site')
|
||||||
[CompletionResult]::new('serve', 'serve', [CompletionResultType]::ParameterValue, 'Serve the site. Rebuild and reload on change automatically')
|
[CompletionResult]::new('serve', 'serve', [CompletionResultType]::ParameterValue, 'Serve the site. Rebuild and reload on change automatically')
|
||||||
[CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Prints this message or the help of the given subcommand(s)')
|
[CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Prints this message or the help of the given subcommand(s)')
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
'gutenberg;init' {
|
'zola;init' {
|
||||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
|
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
|
||||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
|
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
|
||||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
|
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
|
||||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
|
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
'gutenberg;build' {
|
'zola;build' {
|
||||||
[CompletionResult]::new('-u', 'u', [CompletionResultType]::ParameterName, 'Force the base URL to be that value (default to the one in config.toml)')
|
[CompletionResult]::new('-u', 'u', [CompletionResultType]::ParameterName, 'Force the base URL to be that value (default to the one in config.toml)')
|
||||||
[CompletionResult]::new('--base-url', 'base-url', [CompletionResultType]::ParameterName, 'Force the base URL to be that value (default to the one in config.toml)')
|
[CompletionResult]::new('--base-url', 'base-url', [CompletionResultType]::ParameterName, 'Force the base URL to be that value (default to the one in config.toml)')
|
||||||
[CompletionResult]::new('-o', 'o', [CompletionResultType]::ParameterName, 'Outputs the generated site in the given path')
|
[CompletionResult]::new('-o', 'o', [CompletionResultType]::ParameterName, 'Outputs the generated site in the given path')
|
||||||
|
@ -50,7 +50,7 @@ Register-ArgumentCompleter -Native -CommandName 'gutenberg' -ScriptBlock {
|
||||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
|
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
'gutenberg;serve' {
|
'zola;serve' {
|
||||||
[CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'Interface to bind on')
|
[CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'Interface to bind on')
|
||||||
[CompletionResult]::new('--interface', 'interface', [CompletionResultType]::ParameterName, 'Interface to bind on')
|
[CompletionResult]::new('--interface', 'interface', [CompletionResultType]::ParameterName, 'Interface to bind on')
|
||||||
[CompletionResult]::new('-p', 'p', [CompletionResultType]::ParameterName, 'Which port to use')
|
[CompletionResult]::new('-p', 'p', [CompletionResultType]::ParameterName, 'Which port to use')
|
||||||
|
@ -65,7 +65,7 @@ Register-ArgumentCompleter -Native -CommandName 'gutenberg' -ScriptBlock {
|
||||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
|
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
'gutenberg;help' {
|
'zola;help' {
|
||||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
|
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
|
||||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
|
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
|
||||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
|
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
|
|
@ -1,137 +0,0 @@
|
||||||
_gutenberg() {
|
|
||||||
local i cur prev opts cmds
|
|
||||||
COMPREPLY=()
|
|
||||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
||||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
||||||
cmd=""
|
|
||||||
opts=""
|
|
||||||
|
|
||||||
for i in ${COMP_WORDS[@]}
|
|
||||||
do
|
|
||||||
case "${i}" in
|
|
||||||
gutenberg)
|
|
||||||
cmd="gutenberg"
|
|
||||||
;;
|
|
||||||
|
|
||||||
build)
|
|
||||||
cmd+="__build"
|
|
||||||
;;
|
|
||||||
help)
|
|
||||||
cmd+="__help"
|
|
||||||
;;
|
|
||||||
init)
|
|
||||||
cmd+="__init"
|
|
||||||
;;
|
|
||||||
serve)
|
|
||||||
cmd+="__serve"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
case "${cmd}" in
|
|
||||||
gutenberg)
|
|
||||||
opts=" -c -h -V --config --help --version init build serve help"
|
|
||||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
|
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
case "${prev}" in
|
|
||||||
|
|
||||||
*)
|
|
||||||
COMPREPLY=()
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
|
|
||||||
gutenberg__build)
|
|
||||||
opts=" -h -V -u --help --version --base-url "
|
|
||||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
case "${prev}" in
|
|
||||||
|
|
||||||
--base-url)
|
|
||||||
COMPREPLY=("<base_url>")
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
-u)
|
|
||||||
COMPREPLY=("<base_url>")
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
COMPREPLY=()
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
gutenberg__help)
|
|
||||||
opts=" -h -V --help --version "
|
|
||||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
case "${prev}" in
|
|
||||||
|
|
||||||
*)
|
|
||||||
COMPREPLY=()
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
gutenberg__init)
|
|
||||||
opts=" -h -V --help --version <name> "
|
|
||||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
case "${prev}" in
|
|
||||||
|
|
||||||
*)
|
|
||||||
COMPREPLY=()
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
gutenberg__serve)
|
|
||||||
opts=" -h -V -i -p --help --version --interface --port "
|
|
||||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
case "${prev}" in
|
|
||||||
|
|
||||||
--interface)
|
|
||||||
COMPREPLY=("<interface>")
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
-i)
|
|
||||||
COMPREPLY=("<interface>")
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
--port)
|
|
||||||
COMPREPLY=("<port>")
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
-p)
|
|
||||||
COMPREPLY=("<port>")
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
COMPREPLY=()
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
complete -F _gutenberg -o bashdefault -o default gutenberg
|
|
|
@ -1,34 +0,0 @@
|
||||||
function __fish_using_command
|
|
||||||
set cmd (commandline -opc)
|
|
||||||
if [ (count $cmd) -eq (count $argv) ]
|
|
||||||
for i in (seq (count $argv))
|
|
||||||
if [ $cmd[$i] != $argv[$i] ]
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
|
|
||||||
complete -c gutenberg -n "__fish_using_command gutenberg" -s c -l config -d 'Path to a config file other than config.toml'
|
|
||||||
complete -c gutenberg -n "__fish_using_command gutenberg" -s h -l help -d 'Prints help information'
|
|
||||||
complete -c gutenberg -n "__fish_using_command gutenberg" -s V -l version -d 'Prints version information'
|
|
||||||
complete -c gutenberg -n "__fish_using_command gutenberg" -f -a "init" -d 'Create a new Gutenberg project'
|
|
||||||
complete -c gutenberg -n "__fish_using_command gutenberg" -f -a "build" -d 'Builds the site'
|
|
||||||
complete -c gutenberg -n "__fish_using_command gutenberg" -f -a "serve" -d 'Serve the site. Rebuild and reload on change automatically'
|
|
||||||
complete -c gutenberg -n "__fish_using_command gutenberg" -f -a "help" -d 'Prints this message or the help of the given subcommand(s)'
|
|
||||||
complete -c gutenberg -n "__fish_using_command gutenberg init" -s h -l help -d 'Prints help information'
|
|
||||||
complete -c gutenberg -n "__fish_using_command gutenberg init" -s V -l version -d 'Prints version information'
|
|
||||||
complete -c gutenberg -n "__fish_using_command gutenberg build" -s u -l base-url -d 'Force the base URL to be that value (default to the one in config.toml)'
|
|
||||||
complete -c gutenberg -n "__fish_using_command gutenberg build" -s o -l output-dir -d 'Outputs the generated site in the given path'
|
|
||||||
complete -c gutenberg -n "__fish_using_command gutenberg build" -s h -l help -d 'Prints help information'
|
|
||||||
complete -c gutenberg -n "__fish_using_command gutenberg build" -s V -l version -d 'Prints version information'
|
|
||||||
complete -c gutenberg -n "__fish_using_command gutenberg serve" -s i -l interface -d 'Interface to bind on'
|
|
||||||
complete -c gutenberg -n "__fish_using_command gutenberg serve" -s p -l port -d 'Which port to use'
|
|
||||||
complete -c gutenberg -n "__fish_using_command gutenberg serve" -s o -l output-dir -d 'Outputs the generated site in the given path'
|
|
||||||
complete -c gutenberg -n "__fish_using_command gutenberg serve" -s u -l base-url -d 'Changes the base_url'
|
|
||||||
complete -c gutenberg -n "__fish_using_command gutenberg serve" -s h -l help -d 'Prints help information'
|
|
||||||
complete -c gutenberg -n "__fish_using_command gutenberg serve" -s V -l version -d 'Prints version information'
|
|
||||||
complete -c gutenberg -n "__fish_using_command gutenberg help" -s h -l help -d 'Prints help information'
|
|
||||||
complete -c gutenberg -n "__fish_using_command gutenberg help" -s V -l version -d 'Prints version information'
|
|
|
@ -1,4 +1,4 @@
|
||||||
_gutenberg() {
|
_zola() {
|
||||||
local i cur prev opts cmds
|
local i cur prev opts cmds
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
@ -9,8 +9,8 @@ _gutenberg() {
|
||||||
for i in ${COMP_WORDS[@]}
|
for i in ${COMP_WORDS[@]}
|
||||||
do
|
do
|
||||||
case "${i}" in
|
case "${i}" in
|
||||||
gutenberg)
|
zola)
|
||||||
cmd="gutenberg"
|
cmd="zola"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
build)
|
build)
|
||||||
|
@ -31,7 +31,7 @@ _gutenberg() {
|
||||||
done
|
done
|
||||||
|
|
||||||
case "${cmd}" in
|
case "${cmd}" in
|
||||||
gutenberg)
|
zola)
|
||||||
opts=" -h -V -c --help --version --config init build serve help"
|
opts=" -h -V -c --help --version --config init build serve help"
|
||||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||||
|
@ -55,7 +55,7 @@ _gutenberg() {
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
gutenberg__build)
|
zola__build)
|
||||||
opts=" -h -V -u -o --help --version --base-url --output-dir "
|
opts=" -h -V -u -o --help --version --base-url --output-dir "
|
||||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||||
|
@ -86,7 +86,7 @@ _gutenberg() {
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
gutenberg__help)
|
zola__help)
|
||||||
opts=" -h -V --help --version "
|
opts=" -h -V --help --version "
|
||||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||||
|
@ -101,7 +101,7 @@ _gutenberg() {
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
gutenberg__init)
|
zola__init)
|
||||||
opts=" -h -V --help --version <name> "
|
opts=" -h -V --help --version <name> "
|
||||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||||
|
@ -116,7 +116,7 @@ _gutenberg() {
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
gutenberg__serve)
|
zola__serve)
|
||||||
opts=" -h -V -i -p -o -u --help --version --interface --port --output-dir --base-url "
|
opts=" -h -V -i -p -o -u --help --version --interface --port --output-dir --base-url "
|
||||||
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||||
|
@ -166,4 +166,4 @@ _gutenberg() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
complete -F _gutenberg -o bashdefault -o default gutenberg
|
complete -F _zola -o bashdefault -o default zola
|
21
completions/zola.fish
Normal file
21
completions/zola.fish
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
complete -c zola -n "__fish_use_subcommand" -s c -l config -d 'Path to a config file other than config.toml'
|
||||||
|
complete -c zola -n "__fish_use_subcommand" -s h -l help -d 'Prints help information'
|
||||||
|
complete -c zola -n "__fish_use_subcommand" -s V -l version -d 'Prints version information'
|
||||||
|
complete -c zola -n "__fish_use_subcommand" -f -a "init" -d 'Create a new Zola project'
|
||||||
|
complete -c zola -n "__fish_use_subcommand" -f -a "build" -d 'Builds the site'
|
||||||
|
complete -c zola -n "__fish_use_subcommand" -f -a "serve" -d 'Serve the site. Rebuild and reload on change automatically'
|
||||||
|
complete -c zola -n "__fish_use_subcommand" -f -a "help" -d 'Prints this message or the help of the given subcommand(s)'
|
||||||
|
complete -c zola -n "__fish_seen_subcommand_from init" -s h -l help -d 'Prints help information'
|
||||||
|
complete -c zola -n "__fish_seen_subcommand_from init" -s V -l version -d 'Prints version information'
|
||||||
|
complete -c zola -n "__fish_seen_subcommand_from build" -s u -l base-url -d 'Force the base URL to be that value (default to the one in config.toml)'
|
||||||
|
complete -c zola -n "__fish_seen_subcommand_from build" -s o -l output-dir -d 'Outputs the generated site in the given path'
|
||||||
|
complete -c zola -n "__fish_seen_subcommand_from build" -s h -l help -d 'Prints help information'
|
||||||
|
complete -c zola -n "__fish_seen_subcommand_from build" -s V -l version -d 'Prints version information'
|
||||||
|
complete -c zola -n "__fish_seen_subcommand_from serve" -s i -l interface -d 'Interface to bind on'
|
||||||
|
complete -c zola -n "__fish_seen_subcommand_from serve" -s p -l port -d 'Which port to use'
|
||||||
|
complete -c zola -n "__fish_seen_subcommand_from serve" -s o -l output-dir -d 'Outputs the generated site in the given path'
|
||||||
|
complete -c zola -n "__fish_seen_subcommand_from serve" -s u -l base-url -d 'Changes the base_url'
|
||||||
|
complete -c zola -n "__fish_seen_subcommand_from serve" -s h -l help -d 'Prints help information'
|
||||||
|
complete -c zola -n "__fish_seen_subcommand_from serve" -s V -l version -d 'Prints version information'
|
||||||
|
complete -c zola -n "__fish_seen_subcommand_from help" -s h -l help -d 'Prints help information'
|
||||||
|
complete -c zola -n "__fish_seen_subcommand_from help" -s V -l version -d 'Prints version information'
|
|
@ -14,7 +14,7 @@ fn usage_and_exit() -> ! {
|
||||||
::std::process::exit(2);
|
::std::process::exit(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not an example of Gutenberg but is used to generate the theme and syntax dump
|
// Not an example of zola but is used to generate the theme and syntax dump
|
||||||
// used for syntax highlighting.
|
// used for syntax highlighting.
|
||||||
// Check README for more details
|
// Check README for more details
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -92,7 +92,7 @@ pub struct PageFrontMatter {
|
||||||
pub order: Option<usize>,
|
pub order: Option<usize>,
|
||||||
/// Integer to use to order content. Highest is at the bottom, lowest first
|
/// Integer to use to order content. Highest is at the bottom, lowest first
|
||||||
pub weight: Option<usize>,
|
pub weight: Option<usize>,
|
||||||
/// All aliases for that page. Gutenberg will create HTML templates that will
|
/// All aliases for that page. Zola will create HTML templates that will
|
||||||
/// redirect to this
|
/// redirect to this
|
||||||
#[serde(skip_serializing)]
|
#[serde(skip_serializing)]
|
||||||
pub aliases: Vec<String>,
|
pub aliases: Vec<String>,
|
||||||
|
|
|
@ -36,7 +36,7 @@ ident = @{
|
||||||
all_chars*
|
all_chars*
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Now specific to Gutenberg
|
/// Now specific to Zola
|
||||||
|
|
||||||
// shortcode is abbreviated to sc to keep things short
|
// shortcode is abbreviated to sc to keep things short
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ use front_matter::InsertAnchor;
|
||||||
use config::Config;
|
use config::Config;
|
||||||
|
|
||||||
|
|
||||||
/// All the information from the gutenberg site that is needed to render HTML from markdown
|
/// All the information from the zola site that is needed to render HTML from markdown
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct RenderContext<'a> {
|
pub struct RenderContext<'a> {
|
||||||
pub tera: &'a Tera,
|
pub tera: &'a Tera,
|
||||||
|
|
|
@ -10,7 +10,7 @@ use tera::Tera;
|
||||||
|
|
||||||
use config::Config;
|
use config::Config;
|
||||||
use front_matter::InsertAnchor;
|
use front_matter::InsertAnchor;
|
||||||
use templates::GUTENBERG_TERA;
|
use templates::ZOLA_TERA;
|
||||||
use rendering::{RenderContext, render_content};
|
use rendering::{RenderContext, render_content};
|
||||||
|
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ fn can_higlight_code_block_with_unknown_lang() {
|
||||||
fn can_render_shortcode() {
|
fn can_render_shortcode() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let config = Config::default();
|
let config = Config::default();
|
||||||
let context = RenderContext::new(&GUTENBERG_TERA, &config, "", &permalinks_ctx, InsertAnchor::None);
|
let context = RenderContext::new(&ZOLA_TERA, &config, "", &permalinks_ctx, InsertAnchor::None);
|
||||||
let res = render_content(r#"
|
let res = render_content(r#"
|
||||||
Hello
|
Hello
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ Hello
|
||||||
fn can_render_shortcode_with_markdown_char_in_args_name() {
|
fn can_render_shortcode_with_markdown_char_in_args_name() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let config = Config::default();
|
let config = Config::default();
|
||||||
let context = RenderContext::new(&GUTENBERG_TERA, &config, "", &permalinks_ctx, InsertAnchor::None);
|
let context = RenderContext::new(&ZOLA_TERA, &config, "", &permalinks_ctx, InsertAnchor::None);
|
||||||
let input = vec![
|
let input = vec![
|
||||||
"name",
|
"name",
|
||||||
"na_me",
|
"na_me",
|
||||||
|
@ -116,7 +116,7 @@ fn can_render_shortcode_with_markdown_char_in_args_name() {
|
||||||
fn can_render_shortcode_with_markdown_char_in_args_value() {
|
fn can_render_shortcode_with_markdown_char_in_args_value() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let config = Config::default();
|
let config = Config::default();
|
||||||
let context = RenderContext::new(&GUTENBERG_TERA, &config, "", &permalinks_ctx, InsertAnchor::None);
|
let context = RenderContext::new(&ZOLA_TERA, &config, "", &permalinks_ctx, InsertAnchor::None);
|
||||||
let input = vec![
|
let input = vec![
|
||||||
"ub36ffWAqgQ-hey",
|
"ub36ffWAqgQ-hey",
|
||||||
"ub36ffWAqgQ_hey",
|
"ub36ffWAqgQ_hey",
|
||||||
|
@ -134,7 +134,7 @@ fn can_render_shortcode_with_markdown_char_in_args_value() {
|
||||||
fn can_render_body_shortcode_with_markdown_char_in_name() {
|
fn can_render_body_shortcode_with_markdown_char_in_name() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let mut tera = Tera::default();
|
let mut tera = Tera::default();
|
||||||
tera.extend(&GUTENBERG_TERA).unwrap();
|
tera.extend(&ZOLA_TERA).unwrap();
|
||||||
let input = vec![
|
let input = vec![
|
||||||
"quo_te",
|
"quo_te",
|
||||||
"qu_o_te",
|
"qu_o_te",
|
||||||
|
@ -155,7 +155,7 @@ fn can_render_body_shortcode_with_markdown_char_in_name() {
|
||||||
fn can_render_body_shortcode_and_paragraph_after() {
|
fn can_render_body_shortcode_and_paragraph_after() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let mut tera = Tera::default();
|
let mut tera = Tera::default();
|
||||||
tera.extend(&GUTENBERG_TERA).unwrap();
|
tera.extend(&ZOLA_TERA).unwrap();
|
||||||
|
|
||||||
let shortcode = "<p>{{ body }}</p>";
|
let shortcode = "<p>{{ body }}</p>";
|
||||||
let markdown_string = r#"
|
let markdown_string = r#"
|
||||||
|
@ -183,7 +183,7 @@ Here is another paragraph.
|
||||||
fn can_render_two_body_shortcode_and_paragraph_after_with_line_break_between() {
|
fn can_render_two_body_shortcode_and_paragraph_after_with_line_break_between() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let mut tera = Tera::default();
|
let mut tera = Tera::default();
|
||||||
tera.extend(&GUTENBERG_TERA).unwrap();
|
tera.extend(&ZOLA_TERA).unwrap();
|
||||||
|
|
||||||
let shortcode = "<p>{{ body }}</p>";
|
let shortcode = "<p>{{ body }}</p>";
|
||||||
let markdown_string = r#"
|
let markdown_string = r#"
|
||||||
|
@ -216,7 +216,7 @@ Here is another paragraph.
|
||||||
fn can_render_several_shortcode_in_row() {
|
fn can_render_several_shortcode_in_row() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let config = Config::default();
|
let config = Config::default();
|
||||||
let context = RenderContext::new(&GUTENBERG_TERA, &config, "", &permalinks_ctx, InsertAnchor::None);
|
let context = RenderContext::new(&ZOLA_TERA, &config, "", &permalinks_ctx, InsertAnchor::None);
|
||||||
let res = render_content(r#"
|
let res = render_content(r#"
|
||||||
Hello
|
Hello
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ fn doesnt_render_ignored_shortcodes() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let mut config = Config::default();
|
let mut config = Config::default();
|
||||||
config.highlight_code = false;
|
config.highlight_code = false;
|
||||||
let context = RenderContext::new(&GUTENBERG_TERA, &config, "", &permalinks_ctx, InsertAnchor::None);
|
let context = RenderContext::new(&ZOLA_TERA, &config, "", &permalinks_ctx, InsertAnchor::None);
|
||||||
let res = render_content(r#"```{{/* youtube(id="w7Ft2ymGmfc") */}}```"#, &context).unwrap();
|
let res = render_content(r#"```{{/* youtube(id="w7Ft2ymGmfc") */}}```"#, &context).unwrap();
|
||||||
assert_eq!(res.body, "<p><code>{{ youtube(id="w7Ft2ymGmfc") }}</code></p>\n");
|
assert_eq!(res.body, "<p><code>{{ youtube(id="w7Ft2ymGmfc") }}</code></p>\n");
|
||||||
}
|
}
|
||||||
|
@ -251,7 +251,7 @@ fn doesnt_render_ignored_shortcodes() {
|
||||||
#[test]
|
#[test]
|
||||||
fn can_render_shortcode_with_body() {
|
fn can_render_shortcode_with_body() {
|
||||||
let mut tera = Tera::default();
|
let mut tera = Tera::default();
|
||||||
tera.extend(&GUTENBERG_TERA).unwrap();
|
tera.extend(&ZOLA_TERA).unwrap();
|
||||||
tera.add_raw_template("shortcodes/quote.html", "<blockquote>{{ body }} - {{ author }}</blockquote>").unwrap();
|
tera.add_raw_template("shortcodes/quote.html", "<blockquote>{{ body }} - {{ author }}</blockquote>").unwrap();
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let config = Config::default();
|
let config = Config::default();
|
||||||
|
@ -341,11 +341,11 @@ fn can_add_id_to_headers_same_slug() {
|
||||||
fn can_insert_anchor_left() {
|
fn can_insert_anchor_left() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let config = Config::default();
|
let config = Config::default();
|
||||||
let context = RenderContext::new(&GUTENBERG_TERA, &config, "", &permalinks_ctx, InsertAnchor::Left);
|
let context = RenderContext::new(&ZOLA_TERA, &config, "", &permalinks_ctx, InsertAnchor::Left);
|
||||||
let res = render_content("# Hello", &context).unwrap();
|
let res = render_content("# Hello", &context).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
res.body,
|
res.body,
|
||||||
"<h1 id=\"hello\"><a class=\"gutenberg-anchor\" href=\"#hello\" aria-label=\"Anchor link for: hello\">🔗</a>\nHello</h1>\n"
|
"<h1 id=\"hello\"><a class=\"zola-anchor\" href=\"#hello\" aria-label=\"Anchor link for: hello\">🔗</a>\nHello</h1>\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,11 +353,11 @@ fn can_insert_anchor_left() {
|
||||||
fn can_insert_anchor_right() {
|
fn can_insert_anchor_right() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let config = Config::default();
|
let config = Config::default();
|
||||||
let context = RenderContext::new(&GUTENBERG_TERA, &config, "", &permalinks_ctx, InsertAnchor::Right);
|
let context = RenderContext::new(&ZOLA_TERA, &config, "", &permalinks_ctx, InsertAnchor::Right);
|
||||||
let res = render_content("# Hello", &context).unwrap();
|
let res = render_content("# Hello", &context).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
res.body,
|
res.body,
|
||||||
"<h1 id=\"hello\">Hello<a class=\"gutenberg-anchor\" href=\"#hello\" aria-label=\"Anchor link for: hello\">🔗</a>\n</h1>\n"
|
"<h1 id=\"hello\">Hello<a class=\"zola-anchor\" href=\"#hello\" aria-label=\"Anchor link for: hello\">🔗</a>\n</h1>\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -366,11 +366,11 @@ fn can_insert_anchor_right() {
|
||||||
fn can_insert_anchor_with_exclamation_mark() {
|
fn can_insert_anchor_with_exclamation_mark() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let config = Config::default();
|
let config = Config::default();
|
||||||
let context = RenderContext::new(&GUTENBERG_TERA, &config, "", &permalinks_ctx, InsertAnchor::Left);
|
let context = RenderContext::new(&ZOLA_TERA, &config, "", &permalinks_ctx, InsertAnchor::Left);
|
||||||
let res = render_content("# Hello!", &context).unwrap();
|
let res = render_content("# Hello!", &context).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
res.body,
|
res.body,
|
||||||
"<h1 id=\"hello\"><a class=\"gutenberg-anchor\" href=\"#hello\" aria-label=\"Anchor link for: hello\">🔗</a>\nHello!</h1>\n"
|
"<h1 id=\"hello\"><a class=\"zola-anchor\" href=\"#hello\" aria-label=\"Anchor link for: hello\">🔗</a>\nHello!</h1>\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -379,11 +379,11 @@ fn can_insert_anchor_with_exclamation_mark() {
|
||||||
fn can_insert_anchor_with_link() {
|
fn can_insert_anchor_with_link() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let config = Config::default();
|
let config = Config::default();
|
||||||
let context = RenderContext::new(&GUTENBERG_TERA, &config, "", &permalinks_ctx, InsertAnchor::Left);
|
let context = RenderContext::new(&ZOLA_TERA, &config, "", &permalinks_ctx, InsertAnchor::Left);
|
||||||
let res = render_content("## [Rust](https://rust-lang.org)", &context).unwrap();
|
let res = render_content("## [Rust](https://rust-lang.org)", &context).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
res.body,
|
res.body,
|
||||||
"<h2 id=\"rust\"><a class=\"gutenberg-anchor\" href=\"#rust\" aria-label=\"Anchor link for: rust\">🔗</a>\n<a href=\"https://rust-lang.org\">Rust</a></h2>\n"
|
"<h2 id=\"rust\"><a class=\"zola-anchor\" href=\"#rust\" aria-label=\"Anchor link for: rust\">🔗</a>\n<a href=\"https://rust-lang.org\">Rust</a></h2>\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -391,11 +391,11 @@ fn can_insert_anchor_with_link() {
|
||||||
fn can_insert_anchor_with_other_special_chars() {
|
fn can_insert_anchor_with_other_special_chars() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let config = Config::default();
|
let config = Config::default();
|
||||||
let context = RenderContext::new(&GUTENBERG_TERA, &config, "", &permalinks_ctx, InsertAnchor::Left);
|
let context = RenderContext::new(&ZOLA_TERA, &config, "", &permalinks_ctx, InsertAnchor::Left);
|
||||||
let res = render_content("# Hello*_()", &context).unwrap();
|
let res = render_content("# Hello*_()", &context).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
res.body,
|
res.body,
|
||||||
"<h1 id=\"hello\"><a class=\"gutenberg-anchor\" href=\"#hello\" aria-label=\"Anchor link for: hello\">🔗</a>\nHello*_()</h1>\n"
|
"<h1 id=\"hello\"><a class=\"zola-anchor\" href=\"#hello\" aria-label=\"Anchor link for: hello\">🔗</a>\nHello*_()</h1>\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -404,7 +404,7 @@ fn can_make_toc() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let config = Config::default();
|
let config = Config::default();
|
||||||
let context = RenderContext::new(
|
let context = RenderContext::new(
|
||||||
&GUTENBERG_TERA,
|
&ZOLA_TERA,
|
||||||
&config,
|
&config,
|
||||||
"https://mysite.com/something",
|
"https://mysite.com/something",
|
||||||
&permalinks_ctx,
|
&permalinks_ctx,
|
||||||
|
@ -432,7 +432,7 @@ fn can_ignore_tags_in_toc() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let config = Config::default();
|
let config = Config::default();
|
||||||
let context = RenderContext::new(
|
let context = RenderContext::new(
|
||||||
&GUTENBERG_TERA,
|
&ZOLA_TERA,
|
||||||
&config,
|
&config,
|
||||||
"https://mysite.com/something",
|
"https://mysite.com/something",
|
||||||
&permalinks_ctx,
|
&permalinks_ctx,
|
||||||
|
@ -463,7 +463,7 @@ fn can_ignore_tags_in_toc() {
|
||||||
fn can_understand_backtick_in_titles() {
|
fn can_understand_backtick_in_titles() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let config = Config::default();
|
let config = Config::default();
|
||||||
let context = RenderContext::new(&GUTENBERG_TERA, &config, "", &permalinks_ctx, InsertAnchor::None);
|
let context = RenderContext::new(&ZOLA_TERA, &config, "", &permalinks_ctx, InsertAnchor::None);
|
||||||
let res = render_content("# `Hello`", &context).unwrap();
|
let res = render_content("# `Hello`", &context).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
res.body,
|
res.body,
|
||||||
|
@ -475,7 +475,7 @@ fn can_understand_backtick_in_titles() {
|
||||||
fn can_understand_backtick_in_paragraphs() {
|
fn can_understand_backtick_in_paragraphs() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let config = Config::default();
|
let config = Config::default();
|
||||||
let context = RenderContext::new(&GUTENBERG_TERA, &config, "", &permalinks_ctx, InsertAnchor::None);
|
let context = RenderContext::new(&ZOLA_TERA, &config, "", &permalinks_ctx, InsertAnchor::None);
|
||||||
let res = render_content("Hello `world`", &context).unwrap();
|
let res = render_content("Hello `world`", &context).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
res.body,
|
res.body,
|
||||||
|
@ -488,7 +488,7 @@ fn can_understand_backtick_in_paragraphs() {
|
||||||
fn can_understand_links_in_header() {
|
fn can_understand_links_in_header() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let config = Config::default();
|
let config = Config::default();
|
||||||
let context = RenderContext::new(&GUTENBERG_TERA, &config, "", &permalinks_ctx, InsertAnchor::None);
|
let context = RenderContext::new(&ZOLA_TERA, &config, "", &permalinks_ctx, InsertAnchor::None);
|
||||||
let res = render_content("# [Rust](https://rust-lang.org)", &context).unwrap();
|
let res = render_content("# [Rust](https://rust-lang.org)", &context).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
res.body,
|
res.body,
|
||||||
|
@ -500,7 +500,7 @@ fn can_understand_links_in_header() {
|
||||||
fn can_understand_link_with_title_in_header() {
|
fn can_understand_link_with_title_in_header() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let config = Config::default();
|
let config = Config::default();
|
||||||
let context = RenderContext::new(&GUTENBERG_TERA, &config, "", &permalinks_ctx, InsertAnchor::None);
|
let context = RenderContext::new(&ZOLA_TERA, &config, "", &permalinks_ctx, InsertAnchor::None);
|
||||||
let res = render_content("# [Rust](https://rust-lang.org \"Rust homepage\")", &context).unwrap();
|
let res = render_content("# [Rust](https://rust-lang.org \"Rust homepage\")", &context).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
res.body,
|
res.body,
|
||||||
|
@ -530,7 +530,7 @@ fn can_make_valid_relative_link_in_header() {
|
||||||
fn can_make_permalinks_with_colocated_assets_for_link() {
|
fn can_make_permalinks_with_colocated_assets_for_link() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let config = Config::default();
|
let config = Config::default();
|
||||||
let context = RenderContext::new(&GUTENBERG_TERA, &config, "https://vincent.is/about/", &permalinks_ctx, InsertAnchor::None);
|
let context = RenderContext::new(&ZOLA_TERA, &config, "https://vincent.is/about/", &permalinks_ctx, InsertAnchor::None);
|
||||||
let res = render_content("[an image](image.jpg)", &context).unwrap();
|
let res = render_content("[an image](image.jpg)", &context).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
res.body,
|
res.body,
|
||||||
|
@ -542,7 +542,7 @@ fn can_make_permalinks_with_colocated_assets_for_link() {
|
||||||
fn can_make_permalinks_with_colocated_assets_for_image() {
|
fn can_make_permalinks_with_colocated_assets_for_image() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let config = Config::default();
|
let config = Config::default();
|
||||||
let context = RenderContext::new(&GUTENBERG_TERA, &config, "https://vincent.is/about/", &permalinks_ctx, InsertAnchor::None);
|
let context = RenderContext::new(&ZOLA_TERA, &config, "https://vincent.is/about/", &permalinks_ctx, InsertAnchor::None);
|
||||||
let res = render_content("![alt text](image.jpg)", &context).unwrap();
|
let res = render_content("![alt text](image.jpg)", &context).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
res.body,
|
res.body,
|
||||||
|
@ -554,7 +554,7 @@ fn can_make_permalinks_with_colocated_assets_for_image() {
|
||||||
fn markdown_doesnt_wrap_html_in_paragraph() {
|
fn markdown_doesnt_wrap_html_in_paragraph() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let config = Config::default();
|
let config = Config::default();
|
||||||
let context = RenderContext::new(&GUTENBERG_TERA, &config, "https://vincent.is/about/", &permalinks_ctx, InsertAnchor::None);
|
let context = RenderContext::new(&ZOLA_TERA, &config, "https://vincent.is/about/", &permalinks_ctx, InsertAnchor::None);
|
||||||
let res = render_content(r#"
|
let res = render_content(r#"
|
||||||
Some text
|
Some text
|
||||||
|
|
||||||
|
@ -577,7 +577,7 @@ fn can_validate_valid_external_links() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let mut config = Config::default();
|
let mut config = Config::default();
|
||||||
config.check_external_links = true;
|
config.check_external_links = true;
|
||||||
let context = RenderContext::new(&GUTENBERG_TERA, &config, "https://vincent.is/about/", &permalinks_ctx, InsertAnchor::None);
|
let context = RenderContext::new(&ZOLA_TERA, &config, "https://vincent.is/about/", &permalinks_ctx, InsertAnchor::None);
|
||||||
let res = render_content("[a link](http://google.com)", &context).unwrap();
|
let res = render_content("[a link](http://google.com)", &context).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
res.body,
|
res.body,
|
||||||
|
@ -590,7 +590,7 @@ fn can_show_error_message_for_invalid_external_links() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let mut config = Config::default();
|
let mut config = Config::default();
|
||||||
config.check_external_links = true;
|
config.check_external_links = true;
|
||||||
let context = RenderContext::new(&GUTENBERG_TERA, &config, "https://vincent.is/about/", &permalinks_ctx, InsertAnchor::None);
|
let context = RenderContext::new(&ZOLA_TERA, &config, "https://vincent.is/about/", &permalinks_ctx, InsertAnchor::None);
|
||||||
let res = render_content("[a link](http://google.comy)", &context);
|
let res = render_content("[a link](http://google.comy)", &context);
|
||||||
assert!(res.is_err());
|
assert!(res.is_err());
|
||||||
let err = res.unwrap_err();
|
let err = res.unwrap_err();
|
||||||
|
@ -602,7 +602,7 @@ fn doesnt_try_to_validate_email_links_mailto() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let mut config = Config::default();
|
let mut config = Config::default();
|
||||||
config.check_external_links = true;
|
config.check_external_links = true;
|
||||||
let context = RenderContext::new(&GUTENBERG_TERA, &config, "https://vincent.is/about/", &permalinks_ctx, InsertAnchor::None);
|
let context = RenderContext::new(&ZOLA_TERA, &config, "https://vincent.is/about/", &permalinks_ctx, InsertAnchor::None);
|
||||||
let res = render_content("Email: [foo@bar.baz](mailto:foo@bar.baz)", &context).unwrap();
|
let res = render_content("Email: [foo@bar.baz](mailto:foo@bar.baz)", &context).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
res.body,
|
res.body,
|
||||||
|
@ -615,7 +615,7 @@ fn doesnt_try_to_validate_email_links_angled_brackets() {
|
||||||
let permalinks_ctx = HashMap::new();
|
let permalinks_ctx = HashMap::new();
|
||||||
let mut config = Config::default();
|
let mut config = Config::default();
|
||||||
config.check_external_links = true;
|
config.check_external_links = true;
|
||||||
let context = RenderContext::new(&GUTENBERG_TERA, &config, "https://vincent.is/about/", &permalinks_ctx, InsertAnchor::None);
|
let context = RenderContext::new(&ZOLA_TERA, &config, "https://vincent.is/about/", &permalinks_ctx, InsertAnchor::None);
|
||||||
let res = render_content("Email: <foo@bar.baz>", &context).unwrap();
|
let res = render_content("Email: <foo@bar.baz>", &context).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
res.body,
|
res.body,
|
||||||
|
|
|
@ -54,7 +54,7 @@ sit submisso coniuge tristis ubi!
|
||||||
```rs
|
```rs
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Site {
|
pub struct Site {
|
||||||
/// The base path of the gutenberg site
|
/// The base path of the zola site
|
||||||
pub base_path: PathBuf,
|
pub base_path: PathBuf,
|
||||||
/// The parsed config for the site
|
/// The parsed config for the site
|
||||||
pub config: Config,
|
pub config: Config,
|
||||||
|
|
|
@ -34,7 +34,7 @@ use config::{Config, get_config};
|
||||||
use utils::fs::{create_file, copy_directory, create_directory, ensure_directory_exists};
|
use utils::fs::{create_file, copy_directory, create_directory, ensure_directory_exists};
|
||||||
use utils::templates::{render_template, rewrite_theme_paths};
|
use utils::templates::{render_template, rewrite_theme_paths};
|
||||||
use utils::net::get_available_port;
|
use utils::net::get_available_port;
|
||||||
use templates::{GUTENBERG_TERA, global_fns, render_redirect_template};
|
use templates::{ZOLA_TERA, global_fns, render_redirect_template};
|
||||||
use front_matter::{InsertAnchor};
|
use front_matter::{InsertAnchor};
|
||||||
use library::{Page, Section, sort_actual_pages_by_date, Library, Taxonomy, find_taxonomies, Paginator};
|
use library::{Page, Section, sort_actual_pages_by_date, Library, Taxonomy, find_taxonomies, Paginator};
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ impl SitemapEntry {
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Site {
|
pub struct Site {
|
||||||
/// The base path of the gutenberg site
|
/// The base path of the zola site
|
||||||
pub base_path: PathBuf,
|
pub base_path: PathBuf,
|
||||||
/// The parsed config for the site
|
/// The parsed config for the site
|
||||||
pub config: Config,
|
pub config: Config,
|
||||||
|
@ -109,7 +109,7 @@ impl Site {
|
||||||
tera_theme.build_inheritance_chains()?;
|
tera_theme.build_inheritance_chains()?;
|
||||||
tera.extend(&tera_theme)?;
|
tera.extend(&tera_theme)?;
|
||||||
}
|
}
|
||||||
tera.extend(&GUTENBERG_TERA)?;
|
tera.extend(&ZOLA_TERA)?;
|
||||||
// the `extend` above already does it but hey
|
// the `extend` above already does it but hey
|
||||||
tera.build_inheritance_chains()?;
|
tera.build_inheritance_chains()?;
|
||||||
|
|
||||||
|
|
|
@ -189,7 +189,7 @@ fn can_build_site_without_live_reload() {
|
||||||
assert!(!file_contains!(public, "sitemap.xml", "draft"));
|
assert!(!file_contains!(public, "sitemap.xml", "draft"));
|
||||||
|
|
||||||
// robots.txt has been rendered from the template
|
// robots.txt has been rendered from the template
|
||||||
assert!(file_contains!(public, "robots.txt", "User-agent: gutenberg"));
|
assert!(file_contains!(public, "robots.txt", "User-agent: zola"));
|
||||||
assert!(file_contains!(public, "robots.txt", "Sitemap: https://replace-this-with-your-url.com/sitemap.xml"));
|
assert!(file_contains!(public, "robots.txt", "Sitemap: https://replace-this-with-your-url.com/sitemap.xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ fn can_build_site_and_insert_anchor_links() {
|
||||||
|
|
||||||
assert!(Path::new(&public).exists());
|
assert!(Path::new(&public).exists());
|
||||||
// anchor link inserted
|
// anchor link inserted
|
||||||
assert!(file_contains!(public, "posts/something-else/index.html", "<h1 id=\"title\"><a class=\"gutenberg-anchor\" href=\"#title\""));
|
assert!(file_contains!(public, "posts/something-else/index.html", "<h1 id=\"title\"><a class=\"zola-anchor\" href=\"#title\""));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
<a class="gutenberg-anchor" href="#{{ id }}" aria-label="Anchor link for: {{ id }}">🔗</a>
|
<a class="zola-anchor" href="#{{ id }}" aria-label="Anchor link for: {{ id }}">🔗</a>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<title>{{ config.title }}</title>
|
<title>{{ config.title }}</title>
|
||||||
<link>{{ config.base_url | safe }}</link>
|
<link>{{ config.base_url | safe }}</link>
|
||||||
<description>{{ config.description }}</description>
|
<description>{{ config.description }}</description>
|
||||||
<generator>Gutenberg</generator>
|
<generator>Zola</generator>
|
||||||
<language>{{ config.default_language }}</language>
|
<language>{{ config.default_language }}</language>
|
||||||
<atom:link href="{{ feed_url | safe }}" rel="self" type="application/rss+xml"/>
|
<atom:link href="{{ feed_url | safe }}" rel="self" type="application/rss+xml"/>
|
||||||
<lastBuildDate>{{ last_build_date | date(format="%a, %d %b %Y %H:%M:%S %z") }}</lastBuildDate>
|
<lastBuildDate>{{ last_build_date | date(format="%a, %d %b %Y %H:%M:%S %z") }}</lastBuildDate>
|
||||||
|
|
|
@ -26,7 +26,7 @@ use tera::{Tera, Context};
|
||||||
use errors::{Result, ResultExt};
|
use errors::{Result, ResultExt};
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
pub static ref GUTENBERG_TERA: Tera = {
|
pub static ref ZOLA_TERA: Tera = {
|
||||||
let mut tera = Tera::default();
|
let mut tera = Tera::default();
|
||||||
tera.add_raw_templates(vec![
|
tera.add_raw_templates(vec![
|
||||||
("404.html", include_str!("builtins/404.html")),
|
("404.html", include_str!("builtins/404.html")),
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Gutenberg</title>
|
<title>Zola</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>Welcome to Gutenberg!</h1>
|
<h1>Welcome to Zola!</h1>
|
||||||
<p>
|
<p>
|
||||||
You're seeing this page because we couldn't find a template to render.
|
You're seeing this page because we couldn't find a template to render.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
To modify this page, create a <b>{{filename}}</b> file in the templates directory or
|
To modify this page, create a <b>{{filename}}</b> file in the templates directory or
|
||||||
<a href="https://www.getgutenberg.io/documentation/themes/installing-and-using-themes/" target="_blank">install a theme</a>.
|
<a href="https://www.getzola.org/documentation/themes/installing-and-using-themes/" target="_blank">install a theme</a>.
|
||||||
<br>
|
<br>
|
||||||
You can find what variables are available in this template in the <a href="{{url}}" target="_blank">documentation</a>.
|
You can find what variables are available in this template in the <a href="{{url}}" target="_blank">documentation</a>.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
<a href="https://www.getgutenberg.io/documentation/getting-started/cli-usage/" target="_blank">Get started with Gutenberg</a>
|
<a href="https://www.getzola.org/documentation/getting-started/cli-usage/" target="_blank">Get started with Zola</a>
|
||||||
</footer>
|
</footer>
|
||||||
<style>
|
<style>
|
||||||
html {
|
html {
|
||||||
|
|
|
@ -14,7 +14,7 @@ pub fn get_reading_analytics(content: &str) -> (usize, usize) {
|
||||||
|
|
||||||
/// Resolves an internal link (of the `./posts/something.md#hey` sort) to its absolute link
|
/// Resolves an internal link (of the `./posts/something.md#hey` sort) to its absolute link
|
||||||
pub fn resolve_internal_link(link: &str, permalinks: &HashMap<String, String>) -> Result<String> {
|
pub fn resolve_internal_link(link: &str, permalinks: &HashMap<String, String>) -> Result<String> {
|
||||||
// First we remove the ./ since that's gutenberg specific
|
// First we remove the ./ since that's zola specific
|
||||||
let clean_link = link.replacen("./", "", 1);
|
let clean_link = link.replacen("./", "", 1);
|
||||||
// Then we remove any potential anchor
|
// Then we remove any potential anchor
|
||||||
// parts[0] will be the file path and parts[1] the anchor if present
|
// parts[0] will be the file path and parts[1] the anchor if present
|
||||||
|
|
|
@ -38,13 +38,13 @@ pub fn render_template(name: &str, tera: &Tera, context: &Context, theme: &Optio
|
||||||
// maybe it's a default one?
|
// maybe it's a default one?
|
||||||
match name {
|
match name {
|
||||||
"index.html" | "section.html" => {
|
"index.html" | "section.html" => {
|
||||||
render_default_tpl!(name, "https://www.getgutenberg.io/documentation/templates/pages-sections/#section-variables")
|
render_default_tpl!(name, "https://www.getzola.org/documentation/templates/pages-sections/#section-variables")
|
||||||
}
|
}
|
||||||
"page.html" => {
|
"page.html" => {
|
||||||
render_default_tpl!(name, "https://www.getgutenberg.io/documentation/templates/pages-sections/#page-variables")
|
render_default_tpl!(name, "https://www.getzola.org/documentation/templates/pages-sections/#page-variables")
|
||||||
}
|
}
|
||||||
"single.html" | "list.html" => {
|
"single.html" | "list.html" => {
|
||||||
render_default_tpl!(name, "https://www.getgutenberg.io/documentation/templates/taxonomies/")
|
render_default_tpl!(name, "https://www.getzola.org/documentation/templates/taxonomies/")
|
||||||
}
|
}
|
||||||
_ => bail!("Tried to render `{}` but the template wasn't found", name)
|
_ => bail!("Tried to render `{}` but the template wasn't found", name)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
[build]
|
[build]
|
||||||
base = "docs"
|
base = "docs"
|
||||||
publish = "docs/public"
|
publish = "docs/public"
|
||||||
command = "gutenberg build"
|
command = "zola build"
|
||||||
|
|
||||||
[build.environment]
|
[build.environment]
|
||||||
GUTENBERG_VERSION = "0.4.0"
|
ZOLA_VERSION = "0.5.0"
|
||||||
|
|
||||||
[context.deploy-preview]
|
[context.deploy-preview]
|
||||||
command = "gutenberg build --base-url $DEPLOY_PRIME_URL"
|
command = "zola build --base-url $DEPLOY_PRIME_URL"
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
name: gutenberg # you probably want to 'snapcraft register <name>'
|
name: zola # you probably want to 'snapcraft register <name>'
|
||||||
version: '0.3.3+git' # just for humans, typically '1.2+git' or '1.3.2'
|
version: '0.5.0+git' # just for humans, typically '1.2+git' or '1.3.2'
|
||||||
summary: A fast static site generator in a single binary with everything built-in.
|
summary: A fast static site generator in a single binary with everything built-in.
|
||||||
description: |
|
description: |
|
||||||
A fast static site generator in a single binary with everything built-in.
|
A fast static site generator in a single binary with everything built-in.
|
||||||
https://www.getgutenberg.io
|
https://www.getzola.org
|
||||||
|
|
||||||
grade: devel # must be 'stable' to release into candidate/stable channels
|
grade: devel # must be 'stable' to release into candidate/stable channels
|
||||||
confinement: strict # use 'strict' once you have the right plugs and slots
|
confinement: strict # use 'strict' once you have the right plugs and slots
|
||||||
|
|
||||||
apps:
|
apps:
|
||||||
gutenberg:
|
gutenberg:
|
||||||
command: gutenberg
|
command: zola
|
||||||
plugs:
|
plugs:
|
||||||
- network
|
- network
|
||||||
- network-bind
|
- network-bind
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use clap::{App, AppSettings, Arg, SubCommand};
|
use clap::{App, AppSettings, Arg, SubCommand};
|
||||||
|
|
||||||
pub fn build_cli() -> App<'static, 'static> {
|
pub fn build_cli() -> App<'static, 'static> {
|
||||||
App::new("gutenberg")
|
App::new("zola")
|
||||||
.version(crate_version!())
|
.version(crate_version!())
|
||||||
.author(crate_authors!())
|
.author(crate_authors!())
|
||||||
.about(crate_description!())
|
.about(crate_description!())
|
||||||
|
@ -16,7 +16,7 @@ pub fn build_cli() -> App<'static, 'static> {
|
||||||
)
|
)
|
||||||
.subcommands(vec![
|
.subcommands(vec![
|
||||||
SubCommand::with_name("init")
|
SubCommand::with_name("init")
|
||||||
.about("Create a new Gutenberg project")
|
.about("Create a new Zola project")
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("name")
|
Arg::with_name("name")
|
||||||
.required(true)
|
.required(true)
|
||||||
|
|
|
@ -16,7 +16,7 @@ base_url = "%BASE_URL%"
|
||||||
compile_sass = %COMPILE_SASS%
|
compile_sass = %COMPILE_SASS%
|
||||||
|
|
||||||
# Whether to do syntax highlighting
|
# Whether to do syntax highlighting
|
||||||
# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Gutenberg
|
# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola
|
||||||
highlight_code = %HIGHLIGHT%
|
highlight_code = %HIGHLIGHT%
|
||||||
|
|
||||||
# Whether to build a search index to be used later on by a JavaScript library
|
# Whether to build a search index to be used later on by a JavaScript library
|
||||||
|
@ -35,7 +35,7 @@ pub fn create_new_project(name: &str) -> Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
create_dir(path)?;
|
create_dir(path)?;
|
||||||
console::info("Welcome to Gutenberg!");
|
console::info("Welcome to Zola!");
|
||||||
|
|
||||||
let base_url = ask_url("> What is the URL of your site?", "https://example.com")?;
|
let base_url = ask_url("> What is the URL of your site?", "https://example.com")?;
|
||||||
let compile_sass = ask_bool("> Do you want to enable Sass compilation?", true)?;
|
let compile_sass = ask_bool("> Do you want to enable Sass compilation?", true)?;
|
||||||
|
@ -62,7 +62,7 @@ pub fn create_new_project(name: &str) -> Result<()> {
|
||||||
println!();
|
println!();
|
||||||
console::success(&format!("Done! Your site was created in {:?}", canonicalize(path).unwrap()));
|
console::success(&format!("Done! Your site was created in {:?}", canonicalize(path).unwrap()));
|
||||||
println!();
|
println!();
|
||||||
console::info("Get started by moving into the directory and using the built-in server: `gutenberg serve`");
|
console::info("Get started by moving into the directory and using the built-in server: `zola serve`");
|
||||||
println!("Visit https://www.getgutenberg.io for the full documentation.");
|
println!("Visit https://www.getzola.org for the full documentation.");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,7 +212,7 @@ pub fn serve(interface: &str, port: &str, output_dir: &str, base_url: &str, conf
|
||||||
{
|
{
|
||||||
"command": "hello",
|
"command": "hello",
|
||||||
"protocols": [ "http://livereload.com/protocols/official-7" ],
|
"protocols": [ "http://livereload.com/protocols/official-7" ],
|
||||||
"serverName": "Gutenberg"
|
"serverName": "Zola"
|
||||||
}
|
}
|
||||||
"#));
|
"#));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
User-agent: gutenberg
|
User-agent: zola
|
||||||
Allow: /
|
Allow: /
|
||||||
Sitemap: {{config.base_url}}/sitemap.xml
|
Sitemap: {{config.base_url}}/sitemap.xml
|
||||||
|
|
Loading…
Reference in a new issue