mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-02-20 02:30:09 +00:00
exampleSite: arrr, let pirrrates rrread sites from subfolder with canonifyURLs=false #163
This commit is contained in:
parent
fbd431c613
commit
676ba8a7bb
7 changed files with 17 additions and 12 deletions
|
@ -134,4 +134,4 @@ landingPageName = "<i class='fas fa-home'></i> Home"
|
||||||
|
|
||||||
The home button is going to look like this:
|
The home button is going to look like this:
|
||||||
|
|
||||||

|

|
||||||
|
|
|
@ -57,7 +57,7 @@ The Relearn theme let you choose between some predefined color scheme variants,
|
||||||
themeVariant = ""
|
themeVariant = ""
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### Red variant
|
### Red variant
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ The Relearn theme let you choose between some predefined color scheme variants,
|
||||||
themeVariant = "red"
|
themeVariant = "red"
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### Blue variant
|
### Blue variant
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ The Relearn theme let you choose between some predefined color scheme variants,
|
||||||
themeVariant = "blue"
|
themeVariant = "blue"
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### Green variant
|
### Green variant
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ The Relearn theme let you choose between some predefined color scheme variants,
|
||||||
themeVariant = "green"
|
themeVariant = "green"
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 'Mine‘ variant
|
### 'Mine‘ variant
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ Discover what this Hugo theme is all about and the core concepts behind it.
|
||||||
|
|
||||||
renders as
|
renders as
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
The Relearn theme provides archetypes to create skeletons for your website. Begin by creating your first chapter page with the following command
|
The Relearn theme provides archetypes to create skeletons for your website. Begin by creating your first chapter page with the following command
|
||||||
|
|
||||||
|
|
|
@ -8,4 +8,4 @@ Thanks to the simplicity of Hugo, this page is as empty as this theme needs requ
|
||||||
|
|
||||||
Just download latest version of [Hugo binary](https://gohugo.io/getting-started/installing/) for your OS (Windows, Linux, Mac) : it's that simple.
|
Just download latest version of [Hugo binary](https://gohugo.io/getting-started/installing/) for your OS (Windows, Linux, Mac) : it's that simple.
|
||||||
|
|
||||||

|

|
||||||
|
|
|
@ -11,7 +11,7 @@ It provides:
|
||||||
- Automatic menu generation from multilingual content
|
- Automatic menu generation from multilingual content
|
||||||
- In-browser language switching
|
- In-browser language switching
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Basic configuration
|
## Basic configuration
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ The Relearn theme defines two types of pages. *Default* and *Chapter*. Both can
|
||||||
A **Chapter** displays a page meant to be used as introduction for a set of child pages. Commonly, it contains a simple title and a catch line to define content that can be found under it.
|
A **Chapter** displays a page meant to be used as introduction for a set of child pages. Commonly, it contains a simple title and a catch line to define content that can be found under it.
|
||||||
You can define any HTML as prefix for the menu. In the example below, it's just a number but that could be an [icon](https://fortawesome.github.io/Font-Awesome/).
|
You can define any HTML as prefix for the menu. In the example below, it's just a number but that could be an [icon](https://fortawesome.github.io/Font-Awesome/).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
+++
|
+++
|
||||||
|
@ -67,7 +67,7 @@ To tell the Relearn theme to consider a page as a chapter, set `chapter=true` in
|
||||||
|
|
||||||
A **Default** page is any other content page.
|
A **Default** page is any other content page.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
+++
|
+++
|
||||||
|
@ -131,7 +131,7 @@ pre = "<i class='fab fa-github'></i> "
|
||||||
+++
|
+++
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### Ordering sibling menu/page entries
|
### Ordering sibling menu/page entries
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
{{- $langsrc := .Get 1 | default "en" }}
|
{{- $langsrc := .Get 1 | default "en" }}
|
||||||
{{- $langtrg := .Page.Language.Lang }}
|
{{- $langtrg := .Page.Language.Lang }}
|
||||||
|
{{- $baseURL := urls.Parse .Site.BaseURL }}
|
||||||
|
{{- $baseURLpath := $baseURL.Path | default "/" }}
|
||||||
{{- $words := dict
|
{{- $words := dict
|
||||||
"Hugo" "Cap'n Hugo"
|
"Hugo" "Cap'n Hugo"
|
||||||
"Info" "Ahoi"
|
"Info" "Ahoi"
|
||||||
|
@ -70,7 +72,7 @@
|
||||||
"(\\w)(?:[aeiou])mizes([\\s\\n<.,;?!:])" "'mizes"
|
"(\\w)(?:[aeiou])mizes([\\s\\n<.,;?!:])" "'mizes"
|
||||||
"(\\w)(?:[aeiou])nize([\\s\\n<.,;?!:])" "'nize"
|
"(\\w)(?:[aeiou])nize([\\s\\n<.,;?!:])" "'nize"
|
||||||
"(\\w)(?:[aeiou])nizes([\\s\\n<.,;?!:])" "'nizes"
|
"(\\w)(?:[aeiou])nizes([\\s\\n<.,;?!:])" "'nizes"
|
||||||
"(.)=\"/([^\".]*?\")" (printf "=\"/%s/" $langtrg)
|
(printf "(.)=\"%s([^\"]*?\")" $baseURLpath) (printf "=\"%s%s/" $baseURLpath $langtrg)
|
||||||
}}
|
}}
|
||||||
{{- $fix := dict
|
{{- $fix := dict
|
||||||
"warn'n" "warning"
|
"warn'n" "warning"
|
||||||
|
@ -82,6 +84,7 @@
|
||||||
{{- $c := "" }}
|
{{- $c := "" }}
|
||||||
{{- range .Page.Translations }}
|
{{- range .Page.Translations }}
|
||||||
{{- if eq .Language.Lang $langsrc }}
|
{{- if eq .Language.Lang $langsrc }}
|
||||||
|
{{- $l := .RelPermalink }}
|
||||||
{{- $c = .Content }}
|
{{- $c = .Content }}
|
||||||
{{- range $from, $to := $words }}
|
{{- range $from, $to := $words }}
|
||||||
{{- $c = replaceRE (printf "([\\s\\n>])%s([\\s\\n<.,;?!:])" $from) (printf "${1}%s${2}" $to) $c }}
|
{{- $c = replaceRE (printf "([\\s\\n>])%s([\\s\\n<.,;?!:])" $from) (printf "${1}%s${2}" $to) $c }}
|
||||||
|
@ -92,6 +95,8 @@
|
||||||
{{- range $from, $to := $fix }}
|
{{- range $from, $to := $fix }}
|
||||||
{{ $c = replace $c $from $to }}
|
{{ $c = replace $c $from $to }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- $c = replaceRE "(src|href)=\"(images/[^\"]*?\")" (printf "${1}=\"%s${2}" $l) $c }}
|
||||||
|
{{- $c = replaceRE "(src|href)=\"([^\"]*?)/pir/([^\"]*?.files/[^\"]*?\")" "${1}=\"${2}/${3}" $c }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- $c | safeHTML }}
|
{{- $c | safeHTML }}
|
Loading…
Add table
Reference in a new issue