mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-03-20 16:15: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:
|
||||
|
||||

|
||||

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

|
||||

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

|
||||

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

|
||||

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

|
||||

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

|
||||

|
||||
|
||||
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.
|
||||
|
||||

|
||||

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

|
||||

|
||||
|
||||
## 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.
|
||||
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
|
||||
+++
|
||||
|
@ -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.
|
||||
|
||||

|
||||

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

|
||||

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